![]() |
|
|
|
#1 |
|
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: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 |
|
|
|
|
#2 |
|
Posts: n/a
|
<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 xmlns > <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> |
|