p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XSLT (http://p2p.wrox.com/forumdisplay.php?f=86)
-   -   Inner empty tag (http://p2p.wrox.com/showthread.php?t=69954)

jdzsolt August 8th, 2008 03:18 PM

Inner empty tag
 
Hi everyone. Here is my problem.

<bullet type="Item">
 Part 1
<image href="myImage.gif"/>
 part 2.
</bullet>

How can I distinguish between "Part 1" and "part 2."?
Both have the same xPath. When I am getting the text from the bullet tag, it gets the
full string: "Part 1 part 2."
How can I refer to them separately?

Thanks for your help/ideas.

mhkay August 8th, 2008 03:27 PM

You can refer to them as bullet/text()[1] and bullet/text()[2]

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference

jdzsolt August 8th, 2008 03:49 PM

Thanks a lot for the quick reply. It works.


All times are GMT -4. The time now is 07:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.