Schema 0 or more


S

sk

For the following xml document, schema is going to be like the following
but i am not sure how I can define meta_attribute in the schema so that
meta_attribute can be 0 or more.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="iims11526672557483110">
<xs:complexType>
<xs:sequence>
<xs:element name="iims11526672678667402">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50">
</xs:maxLength></xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="iims11526672818165646">
<xs:simpleType>
<xs:restriction base="xs:integer">
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
=======XML DOC=================
<?xml version="1.0" encoding="UTF-8"?>
<ms11526672557483110>
<ms11526672678667402><![CDATA[This is my xml.]]></ms11526672678667402>
<ms11526672818165646>45</ms11526672818165646>
<meta_attribute>
<item1>11:45:07</item2>
<item2>11:47:10</item2>
</meta_attribute>
</ms11526672557483110>
 
Ad

Advertisements

G

George Bina

<xs:sequence>
<xs:element name="iims11526672678667402">
...
</xs:element>
<xs:element name="iims11526672818165646">
...
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded"
name="meta_attribute">
...
</xs:element>
</xs:sequence>

Best Regards,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top