G
Guest
Hi,
Sorry if this is not hte right group, but I couln't find a XPath group.
In a XML document I have an attribute that conatains a text. I would like
the node to be selected if the attibute contains a specified substring. Is it
possibe to use the XPath function 'contains()' to filter out a substring in
an attribure. I can only find XSL examples.
If I have :
<root><foo attr='hi;mom'><yada/></foo></root>
I would like something like this:
XmlDocument.SelectSingeNode("root/foo[attr='{contains('mom')}']/yada");
to return the node yada. I.e. if the substring 'mom' is present in the text
of the attribute node attr.
Is it possible an if yes what is the correct syntax. Thanks.
Brgds Jesper, Denmark.
Sorry if this is not hte right group, but I couln't find a XPath group.
In a XML document I have an attribute that conatains a text. I would like
the node to be selected if the attibute contains a specified substring. Is it
possibe to use the XPath function 'contains()' to filter out a substring in
an attribure. I can only find XSL examples.
If I have :
<root><foo attr='hi;mom'><yada/></foo></root>
I would like something like this:
XmlDocument.SelectSingeNode("root/foo[attr='{contains('mom')}']/yada");
to return the node yada. I.e. if the substring 'mom' is present in the text
of the attribute node attr.
Is it possible an if yes what is the correct syntax. Thanks.
Brgds Jesper, Denmark.