Thread View: fr.comp.text.xml
2 messages
2 total messages
Started by Joseph Vallot
Thu, 28 Sep 2000 00:00
xsl: templates et priorites
Author: Joseph Vallot
Date: Thu, 28 Sep 2000 00:00
Date: Thu, 28 Sep 2000 00:00
35 lines
1439 bytes
1439 bytes
Bonjour, y a-t-il une r�gle de "priorit�" lorsque deux templates applicables sont disponibles ? pour pr�ciser ma question, j'ai � traiter un doc xml du type : === <?xml version="1.0"?> <foo> <bar><pif>a</pif></bar> <bar><pif>zzz</pif></bar> <bar><pif>b</pif></bar> </foo> === o� un traitement "g�n�ral" devra s'appliquer aux /foo/bar[pif = 'a' ou 'b' ou toute autre valeur inconnue de moi], et un autre aux /foo/bar[pif = 'zzz'] donc, j'ai dans mon fichier xsl les choses suivantes : === <xsl:template match="/foo/bar">...</xsl:template> <xsl:template match="/foo/bar[pif='zzz']">...</xsl:template> === avec xalan, j'ai un warning me disant que j'ai deux templates concurrents (puisque le premier s'applique � pif='zzz' aussi), et qu'il prend le dernier rencontr�. msxml ne dit rien mais agit pareil, sauf erreur.. bref, comment faire mieux que �a ? merci d'avance -- Joseph
Re: templates et priorites
Author: (TOM)
Date: Thu, 28 Sep 2000 00:00
Date: Thu, 28 Sep 2000 00:00
15 lines
1331 bytes
1331 bytes
Joseph Vallot a �crit dans <39D34B06.B65D353@axime-is.fr> > y a-t-il une r�gle de "priorit�" lorsque deux templates applicables sont > disponibles ? Oui, cf. http://www.w3.org/TR/xslt#conflict && http://www.w3.org/TR/xslt#section-Defining-Template-Rules > <xsl:template match="/foo/bar">...</xsl:template> > <xsl:template match="/foo/bar[pif='zzz']">...</xsl:template> [...] > bref, comment faire mieux que �a ? <xsl:template match="/foo/bar">...</xsl:template> <xsl:template match="/foo/bar[pif='zzz']" priority="1.0">...</xsl:template>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads