[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Created: (XMLBEANS-154) selectPath throws exception when concat  is used with element contain
From:       "Wei Yin Teo (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2005-05-23 14:09:02
Message-ID: 638169783.1116857342603.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

selectPath throws exception when concat  is used with element containing '&'
----------------------------------------------------------------------------

         Key: XMLBEANS-154
         URL: http://issues.apache.org/jira/browse/XMLBEANS-154
     Project: XMLBeans
        Type: Bug
    Reporter: Wei Yin Teo
    Priority: Minor


I have tried to use the following xpath
  "concat('Issues ', issue/issueDescription)"

for the xml:

  <issue>
    <issueDescription>Important & Urgent Issue </issueDescription>
  </issue>

It ends with exception:

java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error: Unexpected \
character encountered (lex state 3): ' '  at \
org.apache.xmlbeans.impl.newstore2.Path$SaxonPathImpl$SaxonPathEngine.next(Path.java:424)
  at org.apache.xmlbeans.impl.newstore2.Cursor._toSelection(Cursor.java:889)
	at org.apache.xmlbeans.impl.newstore2.Cursor._toNextSelection(Cursor.java:878)
	at org.apache.xmlbeans.impl.newstore2.Cursor.toNextSelection(Cursor.java:2624)
	at org.apache.xmlbeans.impl.newstore2.Cursor._hasNextSelection(Cursor.java:870)
	at org.apache.xmlbeans.impl.newstore2.Cursor.hasNextSelection(Cursor.java:2606)
	at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:429)
	at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:411)

On the other hand, if there is no '&' in the 'issueDescription', then it is fine.

This is due to the following line in \
src/store/org/apache/xmlbeans/impl/store/Path.java

                            pos = l.load("<xml-fragment>"
                            + value + "</xml-fragment>").tempCur();
                            SchemaType type = getType(node);

where value = 'Important & Urgent Issue ' which is not a valid xml content.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic