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

Re: XPOINTER to HTML by XSL

Subject: Re: XPOINTER to HTML by XSL
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Thu, 7 Mar 2002 21:50:10 -0800
Re:  XPOINTER to HTML by XSL
On Thursday 07 March 2002 02:31, Jeni Tennison wrote:
> If you're just dealing with XPointers that look like XPaths, you could
> try splitting value of the href attribute and using Xalan's evaluate()
> extension function on the pointer. Something like:
>
> ? <xsl:for-each select="document(substring-before(@href, '#'))">
> ? ? <xsl:variable name="path"
> ? ? ? select="substring-before(substring-after(@href, '#xpointer('),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?')')" />
> ? ? <xsl:value-of select="xalan:evaluate($path)" />
> ? </xsl:for-each>

Careful that substring-before(..., ')') will get everything before the 
*first* ')' after the '#'.  So if the XPointer expression has a ')', then 
this would break.  Perhaps you could do:

substring-after(substring(@href, 1, string-length(@href) - 1), '#xpointer(')

so long as you always know that there is exactly one ')' and never anything 
else at the end of the href.

-- 
Peter Davis
In order to discover who you are, first learn who everybody else is;
you're what's left.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.