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

inconsistent whiteSpace handling for list type in different versions of Xerces

Hi All,

I've encountered a problem with whiteSpace handling
for list type. I noticed that the behavior is changed
from Xerces library 1.7 to Xerces 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 

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


inconsistent whiteSpace handling for list type in different versions of Xerces

Posted by Frank Zhou <fc...@yahoo.com>.
Hi All,

A few days ago I posted this message, but I haven't
got any response. I still would like to seek advice on
this one, so I re-posted it again. 

Thanks much.
====================================
I've encountered a problem with whiteSpace handling
for list type. I noticed that the behavior is changed
from Xerces library 1.7 to Xerces 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 

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org