I understand the whitespace facet to be a directive to the parser
regarding how to deal with whitespace.  If the whitespace facet is set
to "collapse", as it is in an xsd:token, then the following tag is
legal:
<MyToken>This is my token       </MyToken>
The parser will read it in, collapse the whitespace, and then validate the data.

That said, this doesn't seem to be the behavior I'm getting from
Xerces, or from other online validators either, for that matter. 
Below is a sample schema:

<?xml version="1.0" ?>
<xsd:schema xmlns="xyz"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema";
      targetNamespace="xyz">
  <xsd:element name="Tag" type="xsd:token" />
</xsd:schema>

and a corresponding instance document:

<?xml version="1.0" ?>
<Tag xmlns="xyz">My token    </Tag>

This instance document will not validate in Xerces, and it won't
validate at any of the online validators I've checked, either
(including http://tools.decisionsoft.com/schemaValidate.html and
http://apps.gotdotnet.com/xmltools/xsdvalidator/ ).  If I remove the
trailing whitespace, the file validates just fine.

Is my understanding of the whitespace facet incorrect, or is something
else going on here?

Thanks,
Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to