evaluateXPathAsString

Post your questions and help other users.

Moderator: Martin

Post Reply
thephiloospher
Posts: 29
Joined: 05 Jan 2014 10:28

evaluateXPathAsString

Post by thephiloospher » 13 Feb 2014 20:57

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)?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: evaluateXPathAsString

Post by Martin » 14 Feb 2014 07:53

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

thephiloospher
Posts: 29
Joined: 05 Jan 2014 10:28

Re: evaluateXPathAsString

Post by thephiloospher » 14 Feb 2014 11:09

Thanks Martin.

Post Reply