Combiner 2 fichiers XML en un seul avec XSLT
Bonjour,
Avez-vous une méthode simple pour combiner deux fichiers XML ?
Je cherche à faire l'équivalent d'un JOIN en SQL.
Voici le premier fichier avec des factures (Numero de facture et montant). C'est le fichier Invoices.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?xml version="1.0" encoding="UTF-8"?>
<Invoices>
<Invoice>
<InvNbr>12</InvNbr>
<InvAmount>120</InvAmount>
</Invoice>
<Invoice>
<InvNbr>13</InvNbr>
<InvAmount>130</InvAmount>
</Invoice>
<Invoice>
<InvNbr>14</InvNbr>
<InvAmount>140</InvAmount>
</Invoice>
</Invoices> |
et voici le second fichier (Numéro de facture et monnaie). C'est le fichier Currencies.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?xml version="1.0" encoding="UTF-8"?>
<Currencies>
<Invoice>
<InvoiceNbr>12</InvoiceNbr>
<Curr>EUR</Curr>
</Invoice>
<Invoice>
<InvoiceNbr>13</InvoiceNbr>
<Curr>NOK</Curr>
</Invoice>
<Invoice>
<InvoiceNbr>14</InvoiceNbr>
<Curr>GBP</Curr>
</Invoice>
</Currencies> |
Vous remarquez le numéro de facture commun aux deux fichiers.
Je désire obtenir un fichier XML reprenant toutes les données du premier fichier et la monnaie de la facture (balise <Curr>) provenant du second fichier. Comment puis-je obtenir ceci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?xml version="1.0" encoding="UTF-8"?>
<Invoices>
<Invoice>
<InvNbr>12</InvNbr>
<InvAmount>120</InvAmount>
<Curr>EUR</Curr>
</Invoice>
<Invoice>
<InvNbr>13</InvNbr>
<InvAmount>130</InvAmount>
<Curr>NOK</Curr>
</Invoice>
<Invoice>
<InvNbr>14</InvNbr>
<InvAmount>140</InvAmount>
<Curr>GBP</Curr>
</Invoice>
</Invoices> |
Merci pour vos suggestions.