You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Frank Zhou <fc...@yahoo.com> on 2006/09/09 21:16:37 UTC

inconsistent whiteSpace handling for list type from different versions of Xerces C++ library

Hi All,

I've encountered a problem with whiteSpace handling
for list type. I noticed that the behavior is changed
from Xerces-c library 1.7 to Xerces-c 2.7.

Here is the detail:

I have a simple type defined as this:

<element name="test" nillable="true">
   <simpleType>
     <restriction>
       <simpleType>
          <list itemType="int" />
       </simpleType>
       <minLength value="2" />
     </restriction>
   </simpleType>
</element> 

And the instance is like this:

<test>

	51 32 59

</test>

In Xerces 1.7, when I turned on schema validation, I
got "51 32 59" as the character data for element test,
and if validation is turned off, I got the whole
thing, including the leading/ending carriage return
and spaces.

However, in Xerces 2.7, not matter validation is
turned on or off, I always got the whole thing. This
does not seem right to me, my understanding of the XML
schema spec is that facet whileSpace can only be
"collapse" for list type. So I am expecting either a
validation error for this case or the same behavior as
Xerces 1.7.

Can anybody provide suggestions? 

Thanks in advance.

Frank



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com