On 03.06.06 14:54:58, Stefan Behnel wrote:
There's all sorts of weird expressions you could come up with...
Thanks for that input. I guess for now I just skip attributes and text nodes and only highlight element nodes. Maybe I'll look into this at a later time again.
The only problem I see is that I need to traverse the text-childs of the elements returned when the XPath selects text nodes to know which strings belong to which elements.
Note that you can get back a wild combination of strings, nodes and numbers, so there is a bit of work to do anyway.
Ah, I didn't see "|" until now. Well, that makes the whole thing a bit "harder", because I can't tell wether a given string is created from a text node or is the value of an attribute.
It already makes it harder to find its parent element. You may still end up having to parse the expression to find partial '|' expressions etc.
I might end up writing my own XPath Parser, which is clearly out of my reach atm.
Again thanks for your help on this. After all, I myself only need XPath's that return element nodesets for my purposes...