I doubt that there is something like this, but I decided to ask: Does anyone know if there is a Java library that reads the xsd file and "creates" certain elements, for example. in String format for use in code?
For example. read in the following diagram:
<?xml version="1.0" encoding="utf-8"?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Address"> <xs:complexType> <xs:sequence> <xs:element name="Street" type="xs:string" /> <xs:element name="Town" type="xs:string" /> <xs:element name="Country" type="xs:string" minOccurs="0" /> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
And have a string in the following format:
<Address> <Street></Street> <Town></Town> <Country></Country> </Address>
Automated tools do something similar, that is, they analyze WSDL and from the type section create, for example, JAXB classes, which can be instances of elements defined in the scheme.
Is there a library for this?
UPDATE:
For example, in Eclipse, when creating an xml descriptor for a web application, it presents a tree table with all the necessary elements for users to fill in according to the scheme. How do they do it? I guess they analyze the xsds included in banks. Any input is greatly appreciated.
Thanks!
java dom xml xsd jaxp
Cratylus
source share