xsl-list
[Top] [All Lists]

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

2011-08-04 07:36:24
Hi, 

If the template that contains this for-each matches an element from the file 
that is being processed then you could use current() to acces elements from 
that file. 


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick(_dot_)szabo(_at_)lexisnexis(_dot_)at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-----Ursprüngliche Nachricht-----

Von: Mansour Al Akeel [mailto:mansour(_dot_)alakeel(_at_)gmail(_dot_)com] 
Gesendet: Donnerstag, 04. August 2011 14:32
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: [xsl] accessing xml elements from current and external file

Hello all,

I have a separate configuration file for some configuration. I am trying to 
access elements from this file, and compare them to elements in the file being 
processed. However, when I use for-each and select elements from configuration 
file, I can not access elements in the file being processed at the same time.

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="/s:root/s:element[ s:id=1 ]= ." >
                    <xsl:value-of select="'true'" />
                    </xsl:when>
                </xsl:choose>
                </xsl:attribute>
            </option>
            </xsl:for-each>

If there is something not clear, please let me know.

Thank you.



--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>
--~--