You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/12/11 17:05:16 UTC

DO NOT REPLY [Bug 15277] New: - xerces 2.0.1- 2.2.1 does not implement \p{Zl} correctly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15277>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15277

xerces 2.0.1- 2.2.1  does not implement \p{Zl} correctly

           Summary: xerces 2.0.1- 2.2.1  does not implement \p{Zl} correctly
           Product: Xerces2-J
           Version: 2.2.1
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: XML Schema datatypes
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: jyang@jbmanagement.com


My understanding of \p{Zl} is that it stands for "new line on any
platform".  Correct?  Given such understanding, I have done some testing
and determined that xerces 2.2.1 does not correctly implement this
symbol.

Here is my schema:

line-test.xsd

<?xml version = "1.0" encoding = "UTF-8"?>
<schema xmlns = "http://www.w3.org/2001/XMLSchema">
    <element name="Test">
        <complexType>
            <sequence>
	        <element name = "LineTest">
	            <simpleType>
		        <restriction base = "string">
			    <pattern value = 
                                 "([a-zA-Z&#x020;\p{Zl}])*"/>
		        </restriction>
	            </simpleType>         
                </element>
            </sequence>
        </complexType>
    </element>
</schema>

Notice that the <LineTest> element contains a string.  The string can
contain any character a-Z, a space, or a new line.  There can be any
number of such characters.

Here's my instance document:

line-test.xml

<?xml version="1.0" encoding="UTF-8"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="line-test.xsd">
    <LineTest>one 
two</LineTest>
</Test>

Observe that the contents of <LineTest> contains a new line.

Upon validating the instance document I get this error message:

[Error] line-test.xml:5:15: cvc-type.3.1.3: The value 'one
two' of element 'LineTest' is not valid.

Note that if I do not put a new line in <LineTest>, e.g.,

   <LineTest>one two</LineTest>

then xerces does not generate an error.

Unless I totally misunderstand \p{Zl} then I mark this as an error with
xerces.  /Roger

I submitted this  once was posted in xerces-j-user@xml.apache.org by Roger.

Regards,
Jing Yang

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