After further investigation, it appears that the latter (XPath) bug is actually in the Saxon code (net.sf.saxon.dom.NodeWrapper.getStringValueCS() blindly appends the text values of all child nodes, regardless of type).
The good news is that it looks like this bug was fixed somewhere between 8.6.1 (the version supported by XmlBeans) and 8.8.0.6 (the current version). In 8.8.0.6, net.sf.saxon.jdom.NodeWrapper.getStringValueCS() utilizes the org.jdom.Element.getValue() method, which complies with the Xml 1.0 specification by concatenating the values of all descendant text nodes. In the meantime, I guess we'll have to wait until XmlBeans becomes synchronized with a more recent version of Saxon. -Coram cbryant wrote: > > > This apparent bug becomes more critical when evaluating XPath expressions. > It appears that the same value returned by getTextValue is that which is > passed on to the Saxon XPath engine for evaluating element values, as the > following test shows: > > String xml = "<element><!--A Comment-->999<?PI A Processing > Instruction?></element>"; > XmlObject xo = XmlObject.Factory.parse(xml); > xo.selectPath("/element = 3"); > > This code snippet causes a Saxon ValidationException, with the message: > Cannot convert string " A Comment 999A Processing Ins..." to a double > > > If these results are a side-effect of misunderstanding, then we would > greatly appreciate some insight. Otherwise, we're not sure how to enter > them as bugs, other than to post on this forum. > > Thanks, > Coram > > -- View this message in context: http://www.nabble.com/XmlBeans-bugs-involving-comments-and-processing-instructions-tf3118340.html#a8659545 Sent from the Xml Beans - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]