Hello everybody,
I have a question concerning XPath expressions. Consider this XML
snippet:
<foo title="an attempt">
<ul>
<li>This works fine</li>
<li>Before the inline element <em>Inside the inline element</em> after
the inline element</li>
<li>This also works fine</li>
</ul>
</foo>
In order to reach the first list element, I would use the XPath expression "/foo/ul/li[1]", which works fine. (I get the first list element with "This works fine", as expected.)
However, I need an XPath expression that returns the second list
element in three "portions":
- "Before the inline element "
- "Inside the inline element"
- " after the inline element"
I can get the inside of the inline element with "/foo/ul/li/em", but I have no idea how to get the surrounding strings. Any ideas?
Bookmarks