Bug in TXpXPathParser.Tokenize
Brought to you by:
tpsfadmin
This xpath does not work when passed to selectNode:
'/dataSetLibrary/dataSet
[@name="FullTest"]/defineSelect/where/or/whereField'
Tokenize mistakes the "or" element in the path for a
boolean operator.
This works, but doesn't give the same level of control:
'/dataSetLibrary/dataSet
[@name="FullTest"]/defineSelect/where/*/whereField'
I don't really know, but I didn't think xpath excluded
those operators from use as element names.
-tor
Logged In: YES
user_id=685196
This path represents a workaround, and worked in my test:
'/dataSetLibrary/dataSet
[@name="FullTest"]/defineSelect/where/child::*[name()
="or"]/whereField'
But there may be other problems, because this did not work
(removing the dataSet name test, got no node):
'/dataSetLibrary/dataSet/defineSelect/where/child::*[name()
="or"]/whereField'
I think I should have gotten at least 1 node, though maybe in
the wrong dataSet. (Or my xpath skills may be too weak.)
-tor
Logged In: YES
user_id=685196
I enclose a proposed fix (both a diff file and a corrected
XpDom.pas). What I have done is identified some preceding
token types that should prevent and, or, mod, div, and quo
from being interpreted as operators - thereby causing them
to be elements.
The list of token types is probably not correct (types missing,
types that should not be there).
-tor
diff of my fix in XpDom.pas vs. 2.60 beta1
XpDom.pas with proposed fix