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

RE: [XSLT 2] base-uri of input's dir

Subject: RE: [XSLT 2] base-uri of input's dir
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 15 Jun 2003 21:17:32 +0100
xsl base uri
Could you start by stating the problem, not stating a solution that
appears to work?

I'm confused by your references to base URI and "base dir", I don't know
what you're actually trying to do.

I can't see why you have to fiddle about with the base URI of the
current document before using it as an argument to resolve-uri().

Michael Kay


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Tobias Reif
> Sent: 14 June 2003 18:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  [XSLT 2] base-uri of input's dir
> 
> 
> Hi :)
> 
> The following works, but I suspect there is a much simpler way.
> 
> <xsl:template match="textdata[@fileref]">
>    <xsl:variable name="dir_abs"
>      select="replace(base-uri(/),'[^\/]+$','')"/>
>    <!--
>    AFAICS, basically resolve-uri()
>    concatenates if @fileref is relative, and
>    leaves unchanged if it's absolute
>    -->
>    <xsl:variable name="file_abs"
>      select="resolve-uri(@fileref,$dir_abs)"/>
>    <xsl:copy-of select="unparsed-text($file_abs,'utf-8')"/>
> </xsl:template>
> 
> <xsl:template match="textobject[textdata[@fileref]]">
>    <xsl:apply-templates/>
> </xsl:template>
> 
> How could I get the base dir of the input ($dir_abs), 
> directly, without 
> doing replace()?
> 
> Tobi
> 
> -- 
> http://www.pinkjuice.com/
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.