Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - Schema 0 or more

 
Thread Tools Search this Thread
Old 07-13-2006, 09:07 PM   #1
Default Schema 0 or more


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 xmlnss="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>





sk
  Reply With Quote
Old 07-14-2006, 08:47 AM   #2
George Bina
 
Posts: n/a
Default Re: Schema 0 or more

<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
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


sk wrote:
> 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 xmlnss="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>


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump