Xerces 2.11 "]" problem ( Right square bracket )
------------------------------------------------
Key: XERCESJ-1495
URL: https://issues.apache.org/jira/browse/XERCESJ-1495
Project: Xerces2-J
Issue Type: Bug
Affects Versions: 2.11.0
Reporter: Ugur Seker
Fix For: 2.11.0
Hi
I see following problem after upgrading from Xerces1 to Xerces2
Xerces2 misbehaves if the value includes "]" character.
Here is an example for old (Xerces1) and new (Xerces2) behaviour the given xml
chunk. ( Problem not exist for CDATA fields )
I believe same problem (logically) was reported for Xerces C++ before
(https://issues.apache.org/jira/browse/XERCESC-1226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs
)
XML Chunk
```````````````````````
<pattern>[A-Za-z0-9/_]+</pattern>
Source Logic
`````````````````````
public void characters(char[] ch, int start, int length)
{
final String text = new String( ch, start, length );
final String text1 = text.trim();
System.out.println("MYTEXT :"+ text1.toString());
System.out.println("MYSTART :"+ start);
System.out.println("MYLENGTH :"+ length);
System.out.println("MYELEMENT :" + element.toString());
System.out.println("------------------------------");
}
Xerces1 behaviour (output from character function)
```````````````````````````````````````````
------------------------------
MYTEXT :[A-Za-z0-9/_]+
MYSTART :10320
MYLENGTH :21
MYELEMENT :pattern
------------------------------
Xerces2 behaviour - has bug (output from character function)
```````````````````````````````````````````
------------------------------
MYTEXT :[A-Za-z0-9/_
MYSTART :27
MYLENGTH :19
MYELEMENT :pattern
------------------------------
MYTEXT :]
MYSTART :0
MYLENGTH :1
MYELEMENT :pattern
------------------------------
MYTEXT :+
MYSTART :47
MYLENGTH :1
MYELEMENT :pattern
------------------------------
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]