[ http://issues.apache.org/jira/browse/XMLBEANS-154?page=all ]
Wei Yin Teo updated XMLBEANS-154: --------------------------------- Attachment: path.diff I have fixed it, please see the attached diff. > 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 > Attachments: path.diff > > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]