I'm always with the same problem. I've allready created a question : Namespace prefix xsl on value-of is not defined. thanks to Michael for his answers. I saw all similar questions, but I found nothing to help me. I test my code with saxon9he and I try to group it with muenchian method. XML file :
<invoice:request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:invoice="http://www.xmlData.ch/xmlInvoice/XSD"
xsi:schemaLocation="http://www.forum-datenaustausch.ch/invoice MDInvoiceRequest_400.xsd" role="production">
<invoice:invoice invoice_id="22">
<invoice:vat>0.00</invoice:vat>
<invoice:record_tarmed>Rapport médical sur formulaire assurance-maladie</invoice:record_tarmed>
</invoice:invoice>
<invoice:invoice invoice_id="23">
<invoice:vat>5.00</invoice:vat>
<invoice:record_tarmed>Salle d'examen et de traitement, chirurgie et chirurgie pédiatrique</invoice:record_tarmed>
</invoice:invoice>
</invoice:request>
XSLT file :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:invoice="http://www.xmlData.ch/xmlInvoice/XSD"
exclude-result-prefixes="invoice">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:key name="factures-par-TVA" match="invoice:invoice" use="invoice:vat"/>
<xsl:template match="invoice:request">
<Documents>
<xsl:for-each select="invoice:invoice[count(. | key('factures-par-TVA', invoice:vat)[1]) = 1]">
<xsl:sort select="invoice:vat" />
<Document>
<xsl:copy-of select="invoice:vat" />
<xsl:for-each select="key('factures-par-TVA',invoice:vat)">
<xsl:sort select="invoice:invoice/@invoice_id"/>
<xsl:copy-of select="invoice:record_tarmed"/>
</xsl:for-each>
</Document>
</xsl:for-each>
</Documents>
</xsl:template>
</xsl:stylesheet>
The result is the same : error XTDE0160. If I remove 'invoice:' for 'request', the temp.html file contains the text of the 4 nodes and I get this warning SXXP0005 : the source document is in namespace http://www.xmlData.ch/xmlInvoice/XSD, but all the template rules match elements in no namespace.
I tried the mode attribute of xsl:template but it does'nt work.
what can I do ?
thanks for your help