Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xmlschema-dev]

From: Chris Drozdowski <c.d@---------.--->
To: xmlschema-dev@--.---
Date: 12/11/2004 5:39:00 AM
Hello,

Can an element in an XML document be empty if it is defined as a token 
type in the schema (see example below)?
My validator will accept empty elements if the type is string but 
chokes on token.

<?xml version="1.0"?>
<people>
     <person>
         <fname>John</fname>
         <mname/>
         <lname>John</lname>
     </person>
</people>

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="people">
     <xs:complexType>
         <xs:sequence>
             <xs:element name="person" type="persontype" minOccurs="0" 
maxOccurs="unbounded"/>
         </xs:sequence>
     </xs:complexType>
</xs:element>

<xs:complexType name="persontype">
     <xs:sequence>
         <xs:element name="fname" type="xs:token"/>
         <xs:element name="mfname" type="xs:token"/>
         <xs:element name="lfname" type="xs:token"/>
     </xs:sequence>
</xs:complexType>

</xs:schema>


Thanks,

Chris Drozdowski

c.d@e...



From mike@s... Sat Dec 11 18:58:39 2004
Received: from lisa.w3.org ([128.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent