Is there a standard way to validate a string against any of the standard xml schema datatypes (see XML Schema Part 2: Datatypes Second Edition or more specifically Built-in-datatypes)?
I don't want to validate a complete XSD, I just wand to validate some user input against XML datatypes (e.g. against http://www.w3.org/2001/XMLSchema#date or http://www.w3.org/2001/XMLSchema#boolean). Is there a way to do it using standard APIs? If not, are there other possibilitie instead of writing it from scratch?
The classes in the package javax.xml.validation seem to be targeted at validating complete schemas instead of specific datatypes.
Example of what I am trying to do:
String content = "abc";
String datatype = "http://www.w3.org/2001/XMLSchema#long";
boolean isValid = Validator.isValid(content, datatype); //return false