Jon Pryce wrote:
Boris,

According to
the XML 1.0 spec, section 3.3.3, leading and trailing whitespaces
are discarded in attribute values only if the attribute type declared
in DTD is not CDATA. Furthermore, any attribute for which there is no
declaration should be treated as if declared CDATA. I believe this is
exactly what happens in your case.

Yes, I saw that as well. In fact we use XSchema, not DTD. And the declarations 
look like this:

        <xs:attribute name="name" type="xs:string" use="required"/>

I don't *think* that is declaring it as CDATA is it? (I must admit I find the 
XML specifications very hard to decipher!)

Yes, it is. The default whitespace facet is preserve, which matches the default normalization behavior from XML 1.0. This is explicit in the XML schema recommendation:

http://www.w3.org/TR/2000/WD-xml-2e-20000814#AVNormalize

4.3.6 whiteSpace

[Definition:] whiteSpace constrains the ·value space· of types ·derived· from string such that the various behaviors specified in Attribute Value Normalization in [XML 1.0 (Second Edition)] are realized. The value of whiteSpace must be one of {preserve, replace, collapse}.

Dave

Reply via email to