Originally posted by Paul Clapham:
Well, yes, the XPath expression you have in that element does return a string, whereas "/a/c" returns a node list. So you can't pass its result to something that's expecting a node. You'll need to fix your design.
Hmm. Do you think it is best that I create my own string parsers then?.. such as I accept the object "substring("/a/b",1,3) and deal with that myself in the code rather than relying on the classes doing it for me?
I'm very new to XML but understand how it works with open and close tags, attributes, values, etc. I just have run into trouble seeing as the system I am implementing this on cannot be upgraded to
Java 1.5 and that's what a lot of the information on the web speaks about now since it has javax.xml.xpath built in.
Originally posted by Paul Clapham:
You started out with a lot of description, but it just seems to be background and you don't have any description of your actual problem that I can see. However my diagnosis is, instead of trying to write a generic XPath evaluator where you're going to keep hitting problems every time you try to add a new feature, why not just put those things into an XSL transformation and just run that?
I'm sorry that I got a little lax on the description. I'm simply looking to have my XPath expression perform a
test on one XPath expression. Pending the result of that test, I would then want the result of one XPath or another to be the one which is actually being the returned value. Perhaps this is a better example in layman's terms.
So this code block would have to perform the /a/b query, then compare it to 7. If /a/b is in fact 7, it would get the value of /c/d and return it to the XPath query, otherwise it would get the value of /e/f and return that.