xsl-list
[Top] [All Lists]

[xsl] use contains() function on a node set in XPath 1.0

2022-03-05 09:44:29
Hello,

My question is about XPath 1.0, not XSL, but I hope that I may still pose it here. The problem is, precisely, that I cannot use XSL because I am in a PHP context, using DOM to perform XPath queries on an XML document.

The situation is the following: I have <notion> elements that contain one <name> element and zero or more <translation> elements. I want to select them according to whether any of these child elements contains a certain string. I was hoping that it would be as easy as this:

//notion[contains(*, "string")]

But then I realized that the contains() function evaluates only the first node of the set of child elements. So how can I do what I want to do? Since I am using DOM, I have to remain within XPath 1.0.

Thanks in advance for your help!
Wolfhart
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>