xsl-list
[Top] [All Lists]

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

2011-08-04 07:42:07

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--