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

parameter concatinating

Subject: parameter concatinating
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 7 Aug 1999 14:51:45 -0400
concatinating
 Hello,

I am having trouble using parameters, using the July 09 draft. I'd like to use
parameters to pass patterns to named templates, then add to those patterns in
particular situations. For example, I've defined the path parameter for this
purpose. In the following XSLT fragment , I'm trying to add '/@id' to the
pattern in the path parameter.

    <xsl:when test="$path/@id">

I've also tried:

    <xsl:when test="{$path}/@id">
and
    <xsl:when test="concat($path,'/@id')">

I am slowly coming to the conclusion that it is not possible to do what I want.
I guess the problem is that test does not allow attribute value templates ({ }).

The full template, which doesn't work, follows:

<xsl:template name="idcatcher_path">
  <xsl:param name="catch"/>
  <xsl:param name="path"/>
  <xsl:choose>
    <xsl:when test="$path/@id">
      <xsl:attribute name="{$catch}"><xsl:value-of
select="$path/@id"/></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
      <xsl:attribute name="{$catch}"><xsl:value-of
select="generate-id($path)"/></xsl:attribute>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

The xsl:call-template follows:

        <xsl:call-template name="idcatcher_path">
          <xsl:with-param name="catch">url</xsl:with-param>
          <xsl:with-param name="path">child::SECTION[1]</xsl:with-param>
        </xsl:call-template>


Thanks,

Richard.

Richard Lander
relander at uwaterloo.ca
http://pdbeam.uwaterloo.ca/~rlander/

Professional XML Authoring
http://www.on-line-learning.com/



 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.