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

Re: xsl:value-of select between quotes

Subject: Re: xsl:value-of select between quotes
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 19 Jul 2001 08:31:08 +0100
xsl value of select
Hi Vijay,

> I am trying to write XSL to replace value. But it is giving error. I
> am trying to put two xsl:value-of select statements between the
> double quotes of the value. Is there any way of doing this.
>
> <attribute name="rate" value="
> <xsl:value-of 
> select="TestCargoML/CargoML/Body/KBI/rate_information/iso_currency_code"/>
> <xsl:value-of 
> select="TestCargoML/CargoML/Body/KBI/rate_information//net_amount"/> "/>

Assuming that you are trying to create some XML that looks like:

  <attribute name="rate" value="USD32.99" />

where 'USD' is the value of the iso_currency_code element and 32.99 is
the net_amount, then you should use an attribute value template. I'd
be tempted to wrap it in an xsl:for-each so that you don't have to
write the entire path out again:

  <xsl:for-each
      select="TestCargoML/CargoML/Body/KBI/rate_information">
    <attribute name="rate" value="{iso_currency_code}{.//net_amount}" />
  </xsl:for-each>

You could use xsl:attribute instead to create the value attribute, but
it just means more code:

  <xsl:for-each
      select="TestCargoML/CargoML/Body/KBI/rate_information">
    <attribute name="rate">
      <xsl:attribute name="value">
        <xsl:value-of select="iso_currency_code" />
        <xsl:value-of select=".//net_amount" />
      </xsl:attribute>
    </attribute>
  </xsl:for-each>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.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.