J'ai un problème avec write xsl pour transformer mon xml en version raport. On dirait que:Transformation XSLT en XML, regroupement par clé
<library>
<authors>
<author id="1001">John</author>
<author id="1002">Tom</author>
</authors>
<articles>
<article>
<authorId>1001</authorId>
<title>Article1</title>
</article>
<article>
<authorId>1002</authorId>
<title>Article2</title>
</article>
<article>
<authorId>1001</authorId>
<title>Article3</title>
</article>
</articles>
</library>
Je veux Tranform à:
<raport>
<authorArticles>
<author>John</author>
<articles>
<article>Article1</article>
<article>Article3</article>
</articles>
</authorArticles>
<authorArticles>
<author>Tom</author>
<articles>
<article>Article2</article>
</articles>
</authorArticles>
</raport>
Je idée d'utiliser pour chacun, sur des ids dans auteurs et neasted pour les articles, mais je ne sais pas comment pour le faire. Quelqu'un sait comment faire cette transformation?
Bonne question, +1. Voir ma réponse pour une solution complète et efficace démontrant l'utilisation des clés. :) –