[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|