[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

extract xpath locator

Subject: extract xpath locator
From: Nicolas Mazziotta <nicolas.mazziotta@xxxxxxxxx>
Date: Wed, 11 Aug 2004 15:25:47 +0200
nicolas mazziotta
Hello,

I would like to write template that returns the exact xpath expression that locates a tag in mixed-content documents.

eg, i have:

<doc>
	This <i>is</i> a <b>T</b>est
</doc>

and I would like to get 

the Xpath that says that "i" includes char 6 and 7, and	"b"  char 11 of "/doc"

Besides, it should handle complex nesting like

<doc>
	This <i>i<b>s</b></i> a <b><i>T</i></b>est
</doc>

So that I can write an xpath such as substring(/doc/text(),6,2) to point on a bare sentence

<doc>
	This is a Test
</doc>

and know that "is" is labeled as "i"

I messed a bit with "substring", "string-length", etc. but could not figure out how to get the offset of the opening tag...


Any idea?

Thanks in advance


Nicolas Mazziotta

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.