orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 221 forks source link

Fix XML extraction using XPath in DB2 #6285

Closed obruchez closed 5 months ago

obruchez commented 5 months ago

Following #1069, fix the workaround that was added in Provider (see fixedPath method).

Strangely, XPath expressions starting with "/*/" don't work with XML data extracted using XMLTABLE. The current workaround consists of replacing "/*/" with "//", which works but is semantically incorrect.

obruchez commented 5 months ago

"A slash character (/) at the beginning of a path expression means that the path is to begin at the root node of the tree that contains the context node. That root node must be a document node."

Does that mean that DB2 doesn't consider a fragment of an XML tree as a document?

obruchez commented 5 months ago

Using XMLDOCUMENT to "tag" the XML fragment as a document seems to work.