Java equivalent of .NET's System.Xml.Schema classes?
The .NET Framework exposes a rather useful set of classes as part of the System.Xml.Schema namespace.
Among other things, clas开发者_运维技巧ses such as XmlSchema and XmlSchemaElement provide a useful API for defining/writing and parsing/reading/traversing XML schema files.
Does an equivalent library exist for Java?
The tools to accomplish this are there, but I don't think there's anything specific like that in Java. What I would do is run JAXB on the XML Schema schema (http://www.w3.org/2001/XMLSchema), which will generate Java classes corresponding to the XSD constructs. Then you can use those to read/write XML schemas, and validate against the XML Schema schema.
精彩评论