[xsl] Should be simple?

Subject: [xsl] Should be simple?
From: "Cross, Neal - Development Controller" <ncross@xxxxxxxxx>
Date: Tue, 13 May 2003 11:31:18 +0100
Hi,
I have this problem which is driving me nuts!

My XML is
 
<map>
<x>
    <a>040061002000000</a>
    <b>00101000</b>
    <c>0000</c>
    <d>agriculture                                         ;</d>
</x>
<x>
    <a>040061002000000</a>
    <b>00101100</b>
    <c>0000</c>
    <d>general agriculture                                 ;</d>
</x>
<x>
    <a>040061002000000</a>
    <b>00101110</b>
    <c>0000</c>
    <d>fruit farming or crop cultivation                   ;</d>
</x>
</map>

And I need to acces it as an external document using 

<xsl:template name="map item">
<xsl:param name="code"/>
<xsl:param name="item"/>
<xsl:param name="document"/>
<xsl:variable name="area" select="document('codemap.xml','')/map/x[a=$item and b=$code]"/>
    <xsl:value-of select="$area/x/d"/>
</xsl:for-each>
</xsl:template>

I am hopefully trying to get the value of 'd' so that I can add this as an attribute in my output XML.

Any ideas?
Regards,

<name>Neal Cross</name>
<role>Senior Developer</role>
<company>ICC Information Ltd.</company>
<telephone>0208 4818770</telephone>
<email>ncross@xxxxxxxxx</email>
----------------------


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread