Page 1 of 1

evaluateXPathAsString

Posted: 13 Feb 2014 20:57
by thephiloospher
Hi,
Ex: I have this xml:

<one>
<example>
<two>Hi</two>
</example>

<example>
<two>Martin</two>
</example>
</one>

evaluateXPathAsString(link, "one/example") return "Hi".
But if I wanted to refer to second <example> (Martin)?

Re: evaluateXPathAsString

Posted: 14 Feb 2014 07:53
by Martin
Hi,

You can refer to elements like this:
evaluateXPathAsString(link, "one/example[1]"); returns "Hi"
evaluateXPathAsString(link, "one/example[2]"); returns "Martin"

Here's an XPath tutorial with some more examples: XPath Tutorial.
Please note that Automagic supports only XPaths expressions returning a simple string but no node-sets.

Regards,
Martin

Re: evaluateXPathAsString

Posted: 14 Feb 2014 11:09
by thephiloospher
Thanks Martin.