| Subject: Re: [xsl] XPOINTER to HTML by XSL From: Peter Davis <pdavis152@xxxxxxxxx> Date: Thu, 7 Mar 2002 21:50:10 -0800 | 
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 | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] XPOINTER to HTML by XSL, Jeni Tennison | Thread | Re: [xsl] XPOINTER to HTML by XSL, NILESH PATEL | 
| [xsl] A doubt, Bagchi Ratul | Date | RE: [xsl] RFC XSLT Standard - "Furt, Peter Bray | 
| Month |