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

Re: getting an attribute value through <apply-template

Subject: Re: getting an attribute value through <apply-templates/>
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 10 Jun 2002 15:38:35 +0100
Re:  getting an attribute value through <apply-template
Hi Michael,

> For some reason, I still cant get the ID? Here are the xml/xsl
> excerpts:
[snip]
> <xsl:template match="InsClaimsContact">
>                 <xsl:call-template name="PartyGenInfo"/>
>                 <xsl:call-template name="InjuryDetails"/>
>                 <xsl:call-template name="VehicleInfo">
>                         <xsl:with-param name="id" select="@id"/>
>                 </xsl:call-template>
> </xsl:template>
[snip]
>  <InsClaimsContact Id="1-16HHT">

XML is case sensitive. In your XML, InsClaimsContact's Id attribute
has a capital 'I'; in your call to the VehicleInfo template,
you're trying to select an id attribute (small i) instead. Try:

  <xsl:call-template name="VehicleInfo">
    <xsl:with-param name="id" select="@Id" />
  </xsl:call-template>

[I'd use moded templates here instead; do:

  <xsl:apply-templates select="." mode="VehicleInfo" />

and then have:

<xsl:template match="InsClaimsContact" mode="VehicleInfo">
  <b>---Vehicle Details---</b>
  CLAIM ID IS: <xsl:value-of select="@Id"/>
</xsl:template>

but that's just a personal preference.]

Cheers,

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.