T
tslettebo
Hi.
I don't know if the following is possible (I haven't found it in
examples/tutorials, or using a search, but then, it's hard to tell what
to search for), but it seems so obvious, so I'm wondering if I just
don't know the right syntax for it:
I'm using XSLT and have an input XML like this:
<root>
<name1><value>1</value></name1>
<name2><value>2</value></name2>
<name3><value>3</value></name3>
</root>
I'd like to read the contents of the right <value> node, with the
parent name given with a variable/string, something like:
/root/$name/value // This gives "1", "2" or "3", depending on whether
$value has "name1", "name2" or "name3".
However, the above doesn't work, at least on Sablotron. Any ideas how
to accomplish this?
Regards,
Terje
I don't know if the following is possible (I haven't found it in
examples/tutorials, or using a search, but then, it's hard to tell what
to search for), but it seems so obvious, so I'm wondering if I just
don't know the right syntax for it:
I'm using XSLT and have an input XML like this:
<root>
<name1><value>1</value></name1>
<name2><value>2</value></name2>
<name3><value>3</value></name3>
</root>
I'd like to read the contents of the right <value> node, with the
parent name given with a variable/string, something like:
/root/$name/value // This gives "1", "2" or "3", depending on whether
$value has "name1", "name2" or "name3".
However, the above doesn't work, at least on Sablotron. Any ideas how
to accomplish this?
Regards,
Terje