on 11-19-2008 10:49 AM
Hi Experts,
How to generate a xsd from xml?
Regards
Sara
Use free tools like Altova. XI isn't used to perform this.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the info Prateek..
We manually created the xsd. Please tell me whether it is correct or not?
In XML file.
<xs:element name="Invoice">
- <xs:complexType>
- <xs:sequence>
<xs:element name="KRS" type="xs:string" />
<xs:element name="SYS" type="xs:string" />
- <xs:element minOccurs="1" maxOccurs="1" name="Header">
- <xs:complexType>
- <xs:sequence>
<xs:element name="ART" type="xs:string" />
<xs:element name="DAT" type="xs:string" />
<xs:element name="BAT" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
I have to create the xsd like below. Is it correct?
- Invoice ( 1st level)
- - KRS ( 2nd level under invoice)
- - SYS ( 2nd level under invoice)
- - Header ( 2nd level under invoice)
- - - ART ( 3rd level under header)
- - - DAT ( 3rd level under header)
- - - BAT ( 3rd level under header)
Regards
Sara
Hi,
Looks correct, provided you are giving the end tag </xs:xyz>
Once again check whether between Invoice and Header this is the flow...
<xs:element name="Invoice">
........
........
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Header">
.............
.............
</xs:element>
</xs:complexType>
</xs:sequence>
</xs:element>
btw, if you have any xml tool like stylus Studio or Altova that will help you in checking, creating your xsd.
Regards
The following is completely valid
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Invoice">
<xs:complexType>
<xs:sequence>
<xs:element name="KRS" type="xs:string"/>
<xs:element name="SYS" type="xs:string"/>
<xs:element minOccurs="1" maxOccurs="1" name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="ART" type="xs:string"/>
<xs:element name="DAT" type="xs:string"/>
<xs:element name="BAT" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Regards,
Prateek
Hi
Try using Stylus Studio Option
Click on File->Document Wizard->Click on XML Schema(XSD) to XML, last option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use XML authority to convert XML into XSD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sara
Use can use oxygenxml plugin in your eclipse/NWDS as well to generate XSD from XML
http://www.oxygenxml.com/eclipse_plugin.html
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can generate XSD from XML using XOMLITE45.jar
c:>Java u2013jar xomLite45.jar MyFile.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use any External Available tool to convert XML into XSD.XI not provide such facility
Like Stylus Studio,Altova.
Open your XML in Any tool to check error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.