cancel
Showing results for 
Search instead for 
Did you mean: 

XSD generation

Former Member
0 Kudos

Hi Experts,

How to generate a xsd from xml?

Regards

Sara

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

Use free tools like Altova. XI isn't used to perform this.

Regards,

Prateek

Former Member
0 Kudos

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

Former Member
0 Kudos

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

prateek
Active Contributor
0 Kudos

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

Answers (5)

Answers (5)

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

Try using Stylus Studio Option

Click on File->Document Wizard->Click on XML Schema(XSD) to XML, last option.

dharamveer_gaur2
Active Contributor
0 Kudos

Use XML authority to convert XML into XSD.

Former Member
0 Kudos

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

Former Member
0 Kudos

How to convert xml to xsd using Stylus Studio?

GabrielSagaya
Active Contributor
0 Kudos

Hi

You can generate XSD from XML using XOMLITE45.jar

c:>Java u2013jar xomLite45.jar MyFile.xml

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bf0e8a97-0d01-0010-f0a2-af3b18b7...

dharamveer_gaur2
Active Contributor
0 Kudos

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.