Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XPath: Problem with inline elements

From: Rainer <wolf.rainer@-----.--->
To: NULL
Date: 10/6/2008 8:58:00 AM
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?

Kind regards,

Rainer



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent