schema inference(parsing)
- used to infer XSD (XML Schema Definition) after parsing the structure of any XML document.
- one can generate the XSD from the structure of XML document and can use it to validate the same original XML document.
- .NET framework, class known as c present at the namespace of System.Xml.Schema can be used to generate XSD from the XML document which can be used to validate the original document.
So, how to infer?
in JAVA Platform using xsd-gen-0.2.0-jar-with-dependencies.jar or xbean-2.2.0.jar.
XsdGen gen = new XsdGn(); gen.parse(file).toString();
input
<person value="2"> <name>Samir</name> <address>L5B 2E8</address> </person> <person value="B"/>
output
<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="" elementFormDefault="qualified"> <xsd:element name="person"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="name" minOccurs="0" type="xsd:normalizedString" /> <xsd:element name="address" minOccurs="0" type="xsd:string" /> </xsd:sequence> <xsd:attribute name="value" type="xsd:int" use="required" /> </xsd:complexType> </xsd:element> </xsd:schema>
can be used to get the response SOAP XML msg's XSD.
From satrys,
Kristen wang
浙公网安备 33010602011771号