Hello,

Despite many trials, i am failing extracting the value of an attribute with xmlXPath().
Here is an example:

text = ["<main>"
        "    <itag  target=""valueA""  url=""valueB"" />"
        "    <itag  target=""valueA2"" url=""valueB2"" />"
        "    <itag  target=""valueA3"" url=""valueB3"" />"
        "</main>"
        ];
doc = xmlReadStr(text)

Now, we want to select all <itagentries for which the targetattribute has a given value (say valueA2), and for them, get the related urlvalue:

-->e = xmlXPath(doc, "//itag[@target=""valueA2""]") // works:
 e  =
XML List
size: 1

but ehas no attributes fields. So i cannot get its url contents:
-->e.name
 ans  =
 itag

-->e.attributes
    !--error 999
%XMLSet_e: Unknown field: attributes

How is it possible to do what we expect, whether it is?
Reading examples on the official xmlXPath webpage did not help...

Thanks for any hints
Samuel

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to