cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter C. Verhage" <pete...@zeelandnet.nl>
Subject Re: <xsl:param name="filename"/>
Date Mon, 26 Mar 2001 19:59:47 GMT

----- Original Message -----
From: "flourish" <cocooner@dork.com>
To: <cocoon-users@xml.apache.org>
Sent: Monday, March 26, 2001 9:46 PM
Subject: Re: <xsl:param name="filename"/>


: You could do it much more simply with xsp using the file utility methods
: provided by xsp, if you can/are will to run this through xsp at some
point.

This will be used within an XSP taglib, but, I use the document function to
read a certain document, specified within some user's XML file relative to
the path of that XML file... so for example:

<mytaglib:config file="../file.xml"/>

I will read this like this in my taglib:

<xsl:variable name="file">
  <xsl:choose>
    <xsl:when test="starts-with(//mytaglib:config/@file, '/')">
      <xsl:value-of select="//mytaglib:config/@file"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="concat($path, //mytaglib:config/@file)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="config" select="document($file)/config"/>

After this I can point to $config to get certain data from the configuration
file. Anyways, as you can see, to do this I can't switch to some java code
because I'm using it within XSL...

Peter


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message