[
https://issues.apache.org/jira/browse/XERCESJ-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Glavassevich resolved XERCESJ-542.
------------------------------------------
Resolution: Invalid
Assignee: (was: Xerces-J Developers Mailing List)
This is working as designed. \p{Zl} is not a "new line on any platform". It
has a fixed definition (see [1]) and only contains one character: the Unicode
line separator (0x2028). Characters such as carriage return (0xD) and new line
(0xA) are not in this category and thus will not match the pattern you
specified.
[1] http://www.unicode.org/Public/5.2.0/ucd/PropList.txt
> xerces 2.0.1- 2.2.1 does not implement \p{Zl} correctly
> --------------------------------------------------------
>
> Key: XERCESJ-542
> URL: https://issues.apache.org/jira/browse/XERCESJ-542
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.0 Datatypes
> Affects Versions: 2.2.1
> Environment: Operating System: Other
> Platform: All
> Reporter: Jing Yang
>
> 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 \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 [email protected] by Roger.
> Regards,
> Jing Yang
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]