Say I have the following (simplistic) schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<xs:element name="RootNode" >
<xs:complexType >
<xs:sequence>
<xs:element name="FirstChil dElement" type="Integer8T ype" minOccurs="1"/>
<xs:element name="SecondChi ldElement" type="Integer8T ype"
minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleTyp e name="Integer8T ype">
<xs:restricti on base="xs:intege r">
<xs:minInclusiv e value="0"/>
<xs:maxInclusiv e value="99999999 "/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
I have "Integer8Ty pe" as a custom type. Now, keeping it so that
my "FirstChildElem ent" element is of "Integer8Ty pe", how can I
define that the "FirstChildElem ent" element has an attribute? I've
looked everywhere I can think of and I can't find an example that
would keep that element as type "Integer8Ty pe". It always shows
that I'd have to make the "FirstChildElem ent" element a complex
type.
Could anyone point me in the right direction where I can find the
relevant information on defining attributes for custom typed
elements?
thnx,
Christoph
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<xs:element name="RootNode" >
<xs:complexType >
<xs:sequence>
<xs:element name="FirstChil dElement" type="Integer8T ype" minOccurs="1"/>
<xs:element name="SecondChi ldElement" type="Integer8T ype"
minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleTyp e name="Integer8T ype">
<xs:restricti on base="xs:intege r">
<xs:minInclusiv e value="0"/>
<xs:maxInclusiv e value="99999999 "/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
I have "Integer8Ty pe" as a custom type. Now, keeping it so that
my "FirstChildElem ent" element is of "Integer8Ty pe", how can I
define that the "FirstChildElem ent" element has an attribute? I've
looked everywhere I can think of and I can't find an example that
would keep that element as type "Integer8Ty pe". It always shows
that I'd have to make the "FirstChildElem ent" element a complex
type.
Could anyone point me in the right direction where I can find the
relevant information on defining attributes for custom typed
elements?
thnx,
Christoph
Comment