Look at classes/interfaces in the package org.apache.xercs.impl.dv,
especially XSSimpleType, which is derived from XSSimpleTypeDefinition by
adding various validate() methods to it.
You can cast your XSSimpleTypeDefinition to XSSimpleType if you have one,
or you can create new simple types by using methods provided by
SchemaDVFactory.
Hope this helps,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]
"Jeff Greif"
<[EMAIL PROTECTED]
inceton.edu> To
<[EMAIL PROTECTED]>
08/13/2004 05:28 cc
PM
Subject
utility for validating a string
Please respond to against a simple type
xerces-j-user
I'm looking for a little Java utility based on Xerces (in lieu of writing
it
myself) to validate against its corresponding XSSimpleTypeDefinition a
string that is supposed to conform to a simple type.
An ugly but obvious approach is to create an document whose root element is
designated to have the appropriate xsi:type with the string as its value
and
parse the serialized document. I'm looking for something better, if it
exists.
I see there is a class called
org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl
which might be used, but I don't yet see how to produce one from the
XSSimpleTypeDefinition.
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]