Matching a node by text data
Brought to you by:
bs_php,
nigelswinson
|
From:
<ro...@pr...> - 2003-05-08 07:08:11
|
Hi!
When i have this xml:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<node>
<tag attrib="1/1">item1/1</tag>
<tag attrib="1/2">item1/2</tag>
<tag attrib="1/3">item1/3</tag>
</node>
<node>
<tag attrib="2/1">item2/1</tag>
<tag attrib="2/2">item2/2</tag>
<tag attrib="2/3">item2/3</tag>
</node>
</root>
I can use the @ to search for nodes, that has the specified attribute, like:
match("/root/node/tag[@attrib='1/2']")
would result:
/root[1]/node[1]/tag[2]
But how can i search for a node with specified text data, for example to
have the result
/root[1]/node[2]/tag[3]
when i search for the text data: "item2/3"?
For example match("/root/node/tag='item2/3'") or something would be fine,
but now, it isn't working for me.
Thanx
Roti
|