The XPath 1.0 reference describes the | operator (xpath cover page - W3C) as the “union” operator.
So the following syntax //AAA|//BBB
should return the nodes that match //AAA
and //BBB
. But it seems that it only returns the ones matching //AAA
The syntax seems to be accepted as it doesn’t raise an XMLException (wrong expression syntax) but the XQL method doesn’t handle it as it should…
Am I wrong ?
By the way I created a Feedback case <https://xojo.com/issue/51390>
I suggest you make a small test project that confirm the problem, and upload it to feedback.
it seems not so, Xojo team will ask you soon.
your suggestion was more than good !
while making a little test app I make it work !
So the issue is not where I thought…
The issue happens on a XML document build from scratch.
But if I create a new XML document from the toString method of the previous one, the xql query (with |) works !
Thai is strange… I have to digg more…
Thank you.
I am going to suppress the Feedback case.
Well, I think I found the bug…
with this very simple XML Document :
<?xml version="1.0" encoding="UTF-8"?>
<AAA>
<BBB/>
<CCC/>
<DDD>
<CCC/>
</DDD>
<EEE/>
</AAA>
if the XmlDocument instance if created by parsing the xml string (in the constructor), the XQL union operator runs well (/AAA/EEE | //BBB
for instance)
But, when the same XmlDocument instance if built “manually” from code like so :
dim xml2 as new XmlDocument
dim root as XmlNode = xml2.AppendChild(xml2.CreateElement("AAA"))
root.AppendChild(xml2.CreateElement("BBB"))
root.AppendChild(xml2.CreateElement("CCC"))
dim ddd as XmlNode = xml2.CreateElement("DDD")
root.AppendChild(ddd)
ddd.AppendChild(xml2.CreateElement("CCC"))
root.AppendChild(xml2.CreateElement("EEE"))
the XQL union operator doesn’t work anymore (/AAA/EEE | //BBB
)
I created a Feedback case with a test app that shows the issue (<https://xojo.com/issue/51393>) …