cancel
Showing results for 
Search instead for 
Did you mean: 

XML to XSD

Former Member
0 Kudos

I have the XML, how to obtain the XSD from the XML, if there is any tool available?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member206604
Active Contributor
0 Kudos

Hi,

You can use Altova XML Spy to do that.

Thanks,

Prakash

Former Member
0 Kudos

Thanks Prakash. Would you be more specific on Altova XML spy please? How exactly I will do that?

former_member206604
Active Contributor
0 Kudos

Hi,

You open the XML document in the XML spy.

You can find a menu called DTD/Schema

goto DTD/Schema-->Generate DTD/Schema and you will get a popup select W3C Schema and say ok.

Thanks,

Prakash

Former Member
0 Kudos

Thanks prakash. I am able to create the XSD now.

Now in XI-Repository I am trying to import the XSD, the steps I carried out are

1) Created a new Data type "Test"

2) Went the XSD Tab

3)Imported the XSD file

I am getting the following error

Schema to be handled does not contain a definition of type Test

former_member206604
Active Contributor
0 Kudos

Hi,

There is no need for creating a datatype called test.

You can import it directly under External Definition.

The imported XSD will be your message type and you can use in Interface directly.

Thanks,

Prakash

Former Member
0 Kudos

I have imported the XSD into the External definitions.

I am trying to the message Interface. (Category: Outbound,Mode Asynchronous)

I am selecting the Type of External message and I am getting that. But the NAMESPACE OF THE EXTERNAL Message field is EMPTY.....

Why so?

The XSD imported was

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!W3C Schema generated by XMLSpy v2006 rel. 3 sp1 (http://www.altova.com)>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

<xs:element name="Credential">

<xs:complexType>

<xs:sequence>

<xs:element ref="Identity"/>

<xs:element ref="SharedSecret" minOccurs="0"/>

</xs:sequence>

<xs:attribute name="domain" use="required">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="NetworkId"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

</xs:complexType>

</xs:element>

<xs:element name="From">

<xs:complexType>

<xs:sequence>

<xs:element ref="Credential"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="GetPendingRequest">

<xs:complexType>

<xs:sequence>

<xs:element ref="MessageType"/>

</xs:sequence>

<xs:attribute name="lastReceivedTimestamp" use="required">

<xs:simpleType>

<xs:restriction base="xs:dateTime">

<xs:enumeration value="2005-01-12T00:00:25+00:00"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="maxMessages" use="required">

<xs:simpleType>

<xs:restriction base="xs:byte">

<xs:enumeration value="20"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

</xs:complexType>

</xs:element>

<xs:element name="Header">

<xs:complexType>

<xs:sequence>

<xs:element ref="From"/>

<xs:element ref="To"/>

<xs:element ref="Sender"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Identity">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="AN01000000001"/>

<xs:enumeration value="AN13000000259"/>

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="MessageType">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="StatusUpdateRequest"/>

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="Request">

<xs:complexType>

<xs:sequence>

<xs:element ref="GetPendingRequest"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Sender">

<xs:complexType>

<xs:sequence>

<xs:element ref="Credential"/>

<xs:element ref="UserAgent"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="SharedSecret">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="abracadabra"/>

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="To">

<xs:complexType>

<xs:sequence>

<xs:element ref="Credential"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="UserAgent">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="Our Procurement System 3.0"/>

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="cXML">

<xs:complexType>

<xs:sequence>

<xs:element ref="Header"/>

<xs:element ref="Request"/>

</xs:sequence>

<xs:attribute name="payloadID" use="required">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="1105574416.19583@hydra.buyer.com"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="timestamp" use="required">

<xs:simpleType>

<xs:restriction base="xs:dateTime">

<xs:enumeration value="2005-01-13T00:00:16+00:00"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

</xs:complexType>

</xs:element>

</xs:schema>

Former Member
0 Kudos

Resolved

First 3 lines was replaced by

Previous

-


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!W3C Schema generated by XMLSpy v2006 rel. 3 sp1 (http://www.altova.com)>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

NOW

---

<?xml version="1.0" encoding="ISO-8859-1"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ABC.com/xi"

" elementFormDefault="qualified" targetNamespace=="http://ABC.com/xi"

<xs:import namespace="http://www.w3.org/XML/1998/namespace" />

Answers (0)