I load follow XML in a XSL Variable
<files>
<documents lang="en">
<Invoice>22345</Invoice>
<Invoice>22346</Invoice>
<Offer>22345</Offer>
<Offer>22346</Offer>
</documents>
<documents lang="de">
<Invoice>92345</Invoice>
<Invoice>92346</Invoice>
<Offer>92345</Offer>
<Offer>92346</Offer>
</documents>
</files>
Now I like to filter the documents with the attribute lang="de" for and all invoice elements.
<xsl:variable name="documents" select="document('documents.xml')/files/documents" />
<xsl:variable name="documentName" select="'Invoice'" />
<xsl:apply-templates
mode="filter"
select="$documents[@lang='de' and name() = $documentName]"/>
<xsl:template mode="filter" match="entrys[@lang] | *">
<xsl:value-of select="."/>
</xsl:template>
of course is not working is should be like this
<xsl:apply-templates
mode="filter"
select="$documents[@lang='de' and */name() = $documentName]"/>
but this give me an syntax error.
So may someone can help me with an idea.
EDIT Before 'Invoice' was hard coded in the filter.
I have add that
Thanks in advance.
T.S
"Invoice"
s/b'Invoice'
– Joel M. Lamsen