Hello people,
Is is possbile to validate single attributes without encapsulating them in complex-types?
what we would like to do is
if( validator.validate( logonImpl.getUserID() ) )
{
System.out.println("our error message");
}
where UserID is a string attribute of logon.
i.e.
<xs:complexType name="Logon">
<xs:attribute name="userID" type="xs:string" minOccurs="0"/>
</xs:complexType>
our current solution is to encapsulate the attribute in a complex type, but this is not a nice solution and we would like to remove this.
i.e.
<xs:complexType name="Logon">
<xs:attribute name="userID" type="userIDComplexType" minOccurs="0"/>
</xs:complexType>
alternativly, is there a way to obtain the attribute which fails so that we can implement our own error messages?
many thanks.