I\'d like to be able to read in an XML schema (i.e. xsd) and from that know what are valid attributes, child elements, values as I walk through it.
For example, let\'s
Many of the solutions for validating XML in java use the JAXB API. There's an extensive tutorial available here. The basic recipe for doing what you're looking for with JAXB is as follows:
xjc
, the JAXB compiler.JAXBContext
and Unmarshaller
Unmarshaller
's unmarshal
method.The parts of the tutorial you can read for this are: