Re: [xsl] Newbie cannot find syntax error in attribute select

Subject: Re: [xsl] Newbie cannot find syntax error in attribute select
From: Graydon <graydon@xxxxxxxxx>
Date: Tue, 15 Feb 2011 22:22:49 -0500
On Wed, Feb 16, 2011 at 03:14:14AM +0000, thehulk@xxxxxxxxxxx scripsit:
[snip[
> My (bad) template is:
> 
> <xsl:template match="Account_or_Subaccount">
>   <xsl:element name="Contract">
>     <xsl:attribute name="Sub_ID">
>       <xsl:value-of select="./Subscriber_Info@Sub_Id" />
>     </xsl:attribute>
>     <xsl:attribute name="Org_ID">
>       <xsl:value-of select="./Characteristic[@Display_Lable=&quot;Organization ID&quot;]" />
>     </xsl:attribute>
>   </xsl:element>
> </xsl:template>

It's ./Subscriber_Info/@Sub_Id if you're trying to match the Sub_Id attribute
associated with the Subscriber_Info element child of the context node.
You need the slash to separate all the nodes in a path match, and
attributes are nodes.

-- Graydon

Current Thread