Wang K H wrote: > Hi all, I am new to schema and is trying to write a schema. Please > refer to the example below :<Value POSITION="4">PART</Value> > > How do I define the schema for the above element? > > Right now, I am writing as : > > <xsd:element name="Value" minOccurs="0" maxOccurs="unbounded"> > > <xsd:complexType> > <xsd:attribute name="POSITION" type="xsd:positiveInteger" > use="optional"/> > > </xsd:complexType> > > </xsd:element> <xsd:element name="Value" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute name="POSITION" type="positiveInteger" use="optional"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:element> This will give you the element definition you want and in this case the content of element Value is of type xsd:string. Cheers, /EddieReceived on Friday, 30 March 2001 02:01:38 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT