G
Gus Gassmann
A group of us is building a parser for a w3c schema and have some
interpretation question concerning whitespace in an element.
The definition is as follows:
<xs:complexType name="OSnLNodeNumber">
<xs:complexContent>
<xs:attribute name="type" use="optional" default="real">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="real"/>
<xs:enumeration value="string"/>
<xs:enumeration value="realtime"/>
<xs:enumeration value="random"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="number" type="OSnLNodeNumber"
substitutionGroup="OSnLNode"/>
This is used in an XML file as follows:
<number type="real" value="1.0"/>
<number type="real" value="2.0"></number>
<number type="real" value="3.0"> </number>
Both XMLSpy and Xerces parse the first two numbers, but not the third.
XMLSpy gives the error message:
"The content of complextype definition 'OSnLNodeNumber' is 'empty'.
This forbids any content for element <number>."
Some of us say that whitespace should not matter, particularly if I
want to say
<number type="real" value="4.0">
</number>
Anyone know the official w3c position on this? Can you quote chapter
and verse or point us into the right direction?
Thanks a million.
interpretation question concerning whitespace in an element.
The definition is as follows:
<xs:complexType name="OSnLNodeNumber">
<xs:complexContent>
<xs:attribute name="type" use="optional" default="real">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="real"/>
<xs:enumeration value="string"/>
<xs:enumeration value="realtime"/>
<xs:enumeration value="random"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="number" type="OSnLNodeNumber"
substitutionGroup="OSnLNode"/>
This is used in an XML file as follows:
<number type="real" value="1.0"/>
<number type="real" value="2.0"></number>
<number type="real" value="3.0"> </number>
Both XMLSpy and Xerces parse the first two numbers, but not the third.
XMLSpy gives the error message:
"The content of complextype definition 'OSnLNodeNumber' is 'empty'.
This forbids any content for element <number>."
Some of us say that whitespace should not matter, particularly if I
want to say
<number type="real" value="4.0">
</number>
Anyone know the official w3c position on this? Can you quote chapter
and verse or point us into the right direction?
Thanks a million.