I have found several similar answers but I can't quite get why this is not working; This is a stripped down version of my real problem, but I have tested it and get the same result;
test1.xml
<?xml version="1.0" encoding="UTF8"?>
<fieldList>
<sourceField name="SourceTime">
<fid>REC_TIME</fid>
</sourceField>
</fieldList>
lookup.xml
<?xml version="1.0" encoding="UTF-8"?>
<data>
<field name="REC_TIME" fid_type="DATE"/>
</data>
joinTest.xsml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" media-type="text/plain"/>
<xsl:variable name="fieldDict" select="'lookup.xml'" />
<xsl:template match="/fieldList/*[fid]">
<xsl:variable name="id" select="current()"/>
<xsl:value-of select="$id"/>
<xsl:for-each select="document($fieldDict)/data/field[@name = $id]">
<xsl:value-of select="@type"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Now if I change the xpath to [@name] I get
REC_TIME
MONKEY
which is the result I want, but obviously the real file has much more than one entry so I need the filter to actually work!
I am testing this with xsltproc on Linux
xsltproc --version
Using libxml 20705, libxslt 10124 and libexslt 813
xsltproc was compiled against libxml 20632, libxslt 10124 and libexslt 813
libxslt 10124 was compiled against libxml 20632
libexslt 813 was compiled against libxml 20632
Many thanks.