On mer, 2005-06-29 at 12:00 +0200, Lasserre Lionel wrote:
> En fait j'ai un xsl ressemblant a cela :
> <ns0:IMAGE2>
> <xsl:for-each select="@ns0:*|@*[namespace-uri()='']">
> <xsl:attribute name="{name()}" namespace="{namespace-uri()}">
> <xsl:value-of select="." />
> </xsl:attribute>
> </xsl:for-each>
> <w:p>
> <w:pPr>
> <w:jc w:val="center" />
> <w:rPr>
> <w:b />
> <w:sz w:val="36" />
> <w:sz-cs w:val="36" />
> </w:rPr>
> </w:pPr>
> <w:r>
> <w:t>
> <xsl:value-of select="." />
> </w:t>
> </w:r>
> </w:p>
> </ns0:IMAGE2>
>
> Pareil avec ns0: IMAGE1 etc ....
>
> je souhaite remplacer le <xsl:value-of select="." /> par :
> <w:pict>
> <w:binData w:name="wordml://06000001.emz">
> <xsl:value-of select="."/>
> </w:binData>
> </w:pict>
>
> mais il me faudrait pouvoir changer la valeur de w:name en fonction du
> nom du tag IMAGE
> par exemple pour le noeud IMAGE2:
> <w:pict>
> <w:binData w:name="wordml://IMAGE2.emz">
> <xsl:value-of select="."/>
> </w:binData>
> </w:pict>
> ...
>
> la solution d'eric semble sympa, et comme il le stipule il me faudrait
> trouver la bonne expression xpath ;>
Je ne suis pas certain de comprendre le contexte... Lorsque vous
écrivez <ns0:IMAGE2>, voulez-vous réellement créer un élément
<ns0:IMAGE2> ou voulez-vous dire que votre noeud contexte est
<ns0:IMAGE2>? et où trouvez-vous le nom de l'élément IMAGE?
Juste une remarque :
<xsl:for-each select="@ns0:*|@*[namespace-uri()='']">
<xsl:attribute name="{name()}" namespace="{namespace-uri()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:for-each>
peut-être remplacé par <xsl:copy-of select="@*"/>
Cordialement,
Eric
>
--
Have you ever thought about unit testing XSLT templates?
http://xsltunit.org
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
--
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)
Received on Wed Jun 29 12:37:28 2005