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

Re: how to setStyleSheetParam() passing a url

Subject: Re: how to setStyleSheetParam() passing a url
From: "Steve Muench" <smuench@xxxxxxxxxxxxx>
Date: Sun, 19 Mar 2000 14:48:56 -0800
setstylesheetparam xsl
| What I really need to do is replace object_key with a dynamic object_key
| but I can figure out if it's "legal" to imbed one parameter in the value
| of another.  For example:
| 
   :
| Is this valid and if so what's the correct syntax?

Here's a couple of ways you can do this...

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:param name="key">12345</xsl:param> <!-- Test value -->

  <!-- Technique 1, Using <xsl:text> and <xsl:value-of> -->
  <xsl:param name="url">
    <xsl:text>http://localhost:8000/servlet/servletName?objectKey=</xsl:text>
    <xsl:value-of select="$key"/>
  </xsl:param>

  <!-- Technique 2, Use concat() function. -->
  <xsl:param name="url2"
     select="concat('http://localhost:8000/servlet/servletName',
                    '?objectKey=', $key)" />

  <xsl:template match="/">
    <xsl:value-of select="$url"/>
    <xsl:text>&#xa;</xsl:text>
    <xsl:value-of select="$url2"/>
  </xsl:template>

</xsl:stylesheet>

If I try this from the command-line with Oracle XSLT,
passing a value for the parameter, I get:

$ oraxsl -p key='9988' data.xml test.xsl

http://localhost:8000/servlet/servletName?objectKey=9988
http://localhost:8000/servlet/servletName?objectKey=9988

Hope this helps.

_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team


 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.