How do I create a schema for elements with attributes
-
How can I create a schema for the following?
<Data>
<Value unit="m/s">10</Value>
<Value unit="ºF">25</Value>
</Data>I would like to have the following description in the xsd
<xs:complexType name="rootSchema">
xs:sequence
<xs:element name="Value" type="valueSchema" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:element name="Multicalc" type="rootSchema" />How do I write the definition of valueSchema? (I hope I didn't make any mistakes in the definitions. I simplified things a bit compared to my own xsd.)
-
How can I create a schema for the following?
<Data>
<Value unit="m/s">10</Value>
<Value unit="ºF">25</Value>
</Data>I would like to have the following description in the xsd
<xs:complexType name="rootSchema">
xs:sequence
<xs:element name="Value" type="valueSchema" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:element name="Multicalc" type="rootSchema" />How do I write the definition of valueSchema? (I hope I didn't make any mistakes in the definitions. I simplified things a bit compared to my own xsd.)
see if this works
<xs:complexType name="valueSchema">
xs:simpleContent
<xs:extension base="xs:integer">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>led mike
-
see if this works
<xs:complexType name="valueSchema">
xs:simpleContent
<xs:extension base="xs:integer">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>led mike
Thanks a bunch. It did the trick it seems. :)