[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] accessing xml elements from current and external file


Subject: Re: [xsl] accessing xml elements from current and external file
From: Mansour Al Akeel <mansour.alakeel@xxxxxxxxx>
Date: Thu, 4 Aug 2011 08:58:55 -0400

Thank you all for the fast response.
Yep putting the root in a variable seems to be what I need.
It helped ! :)

Thank you.


On Thu Aug 04,2011 08:42 am, Murray McDonald wrote:
> 
> Hi Mansour,
> 
> It's a problem of context -- you need to put a "pointer" to "/s:root" into a
> varible and then access it that way:
> 
> <xsl:variable name="docroot" select="/s:root"/>
> 
> 
> Here is some code that explains what I am doing:
>             <xsl:for-each
> select="document('configuration.xml')/d:config/d:options">
>             <option>
>                 <xsl:attribute name="label" >
>                 <xsl:choose>
>                     <xsl:when test="$docroot/s:element[ s:id=1 ]= ." >
>                     <xsl:value-of select="'true'" />
>                     </xsl:when>
>                 </xsl:choose>
>                 </xsl:attribute>
>             </option>
>             </xsl:for-each>
> 
> Murray


Current Thread