XSLT tri alphabétique de chaque élément avec ses attributs
Bonjour à tous,
J'ai besoin de vos lumières sur une transformation XSLT parce que je sèche complètement. J'essaie de faire une transformation qui fasse l'inventaire de toutes les occurrences de chaque élément dans le fichier XML avec un tri alphabétique sans perdre les attributs, qui devront également être par ordre alphabétique, ainsi que le contenu textuel.
Code du fichier XML
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| <?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="colloque1.xsl"?>
<TEI>
<teiHeader>
<fileDesc>
<titleStmt>
<title>Un titre</title>
<author>Un auteur</author>
<editor>Un éditeur</editor>
<funder>Un fondateur</funder>
<respStmt>
<resp>Balisage</resp>
<name>Micha Ch</name>
</respStmt>
<sourceDesc>
Manuscrit Ars 5075
</sourceDesc>
</titleStmt>
<publicationStmt>
<distributor>
<name>Nom du laboratoire</name>
<name>Université de Lille</name>
<address>
<addrLine>Adresse</addrLine>
<addrLine>Adresse suite</addrLine>
<addrLine>Code postal</addrLine>
<addrLine>Téléphone</addrLine>
</address>
</distributor>
<distributor>
<name>Nom de l'université</name>
<address>
<addrLine>Adresse</addrLine>
<addrLine>Suite adresse</addrLine>
<addrLine>Code postal et Ville</addrLine>
<addrLine>Pays</addrLine>
<addrLine>Téléphone</addrLine>
<addrLine>Courriel</addrLine>
<addrLine>Site web</addrLine>
</address>
</distributor>
<availability>
Libre de droits pour des usages non commerciaux.
</availability>
</publicationStmt>
</fileDesc>
<encodingDesc>
<projectDesc>
<p>Dictionnaire</p>
</projectDesc>
<editorialDecl>
<p>Les transcriptions ont été effectuées par M.</p>
</editorialDecl>
<revisionDesc>
<change who="Micha" when="17 décembre 2014">Création du document XML à partir d'un fichier texte</change>
</revisionDesc>
</encodingDesc>
</teiHeader>
<text>
<body>
<pb n="31"/>
<cb n="a"/>
<l n="1"><w lemma="que2/3" type="pron/adv/rel/inter">Qui</w> <w lemma="petit" type="adj/adv/sn">petit</w> <w lemma="semer1" type="v">seme</w> <w lemma="petit" type="adj/adv/sn">petit</w> <w lemma="coillir" type="v">quialt</w>, </l>
<l n="2"><w lemma="et" type="conj">et</w> <w lemma="que2/3" type="pron/adv/rel/inter">qui</w> <w lemma="auques" type="pronindéf/adv">auques</w> <w lemma="recoillir" type="v">recoillir</w> <w lemma="voloir" type="v">vialt</w></l>
<l n="3"><w lemma="en1" type="prép">an</w> <w lemma="tel" type="adj">tel</w> <w lemma="lieu" type="sm">leu</w> <w lemma="son4" type="pron/adjposs">sa</w> <w lemma="semence" type="sf">semance</w> <w lemma="espandre" type="v">espande</w></l>
</body>
</text>
</TEI> |
Code (fautif) du fichier XSLT
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
<xsl:template match="*">
<xsl:text>(</xsl:text>
<xsl:value-of select="local-name()"/>
<xsl:text>)</xsl:text>
<xsl:apply-templates>
<xsl:sort select="." order="ascending"/>
</xsl:apply-templates>
</xsl:template> |
D'avance merci pour tout renseignement me permettant de résoudre cette difficulté. Amicalement,
Micha