From: Elliotte Rusty Harold (elharo@metalab.unc.edu)
Date: 14/11/2003 - 15:20
At 3:10 PM +0100 11/14/03, chris bable wrote:
>Mais le pb est que mes fichiers FICHIER_1.xml et
>FICHIER_2.xml sont très longs et leurs noms
>aussi (plutôt du style
>FICHIER_1.xml =
>un_nom_de_fichier_a_rallonge_pour_differencier_fichier_1_fichier_2.xml
>- je ne suis pas à l'origine de ces
>fichiers).
>
>Comment puis-je remplacer
>"document('FICHIER_2.xml')" par "fic2", par
>exemple ?
Utilisez un xsl:variable:
<xsl:variable name="fic1"
select="document('un_nom_de_fichier_a_rallonge_pour_differencier_fichier_1_fichier_2.xml')"/>
<xsl:variable name="fic2" select="document('FICHIER_2.xml')"/>
<xsl:template match="/">
<config>
<xsl:apply-templates
select="$fic1/th:FICHIER_1_config/th:network_interface"/>
</config>
</xsl:template>
<xsl:template match="$fic1/th:FICHIER_1_config/th:network_interface">
<xsl:value-of select="th:arp"/>
<xsl:value-of select="$fic2/th:network/th:interface_name"/>
<xsl:value-of select="$fic2/th:network/th:ip_adresse"/>
<xsl:value-of select="$fic2/th:network/th:net_mask"/>
<xsl:value-of select="$fic2/th:network/th:mtu"/>
etc...
</xsl:template>
>De plus, dans FICHIER_1 et dans FICHIER_2, on fait référence à un namespace.
>
>Lorsque l'on définit un namespace, doit-on
>obligatoirement lui associer un préfixe (ici th)
>?
Oui. On doit.
--
Elliotte Rusty Harold
elharo@metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|