> -----Original Message-----
> From: xml-tech-bounce@xmlfr.org [mailto:xml-tech-bounce@xmlfr.org]
> On Behalf Of Dominique Millot
> Sent: jeudi 10 février 2005 15:12
> To: xml-tech@xmlfr.org
> Subject: [xml-tech] Décortiquer le contenu d'un XHTML du type :
> <P>Paragraphe1<BR/>Paragraphe2</P>
>
> Bonjour,
>
> Je cherche à « décortiquer » le contenu d'un XHTML via XSLT.
>
> [...]
> Merci d'avance pour vos conseils.
> Dominique
Bonjour,
Pas besoin de script -- une sélection XPath de la forme "p//text()" doit suffire; ce n'est qu'un exemple (en "pull-processing") :
-- data.xml :
<?xml version="1.0" ?>
<root>
<p>du texte<br/>encore du texte</p>
<p>et encore du texte<b>toujours du texte</b>enfin du texte</p>
</root>
-- style.xsl :
<?xml version="1.0" ?>
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<xsl:apply-templates />
</html>
</xsl:template>
<xsl:template match="root">
<body>
<ol>
<xsl:for-each select="p//text()">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ol>
</body>
</xsl:template>
</xsl:transform>
-- resultat.html :
<html>
<body>
<ol>
<li>du texte</li>
<li>encore du texte</li>
<li>et encore du texte</li>
<li>toujours du texte</li>
<li>enfin du texte</li>
</ol>
</body>
</html>
Cordialement,
Cyril Jandia
______________________________________________________________________________________________________________________________
This email, the information contained within and any files transmitted with it (herein after referred as "the message")
are confidential. It is intended solely for the addressees and access to this message by any other person is not permitted.
If you are not the named addressee, please send it back immediately to the sender and delete it. Unauthorized disclosure,
publication, use, dissemination, forwarding, printing or copying of this message, either in whole or in part, is strictly
prohibited.
Emails are susceptible to alteration and their integrity cannot be guaranteed. Our company shall not be liable for this
message if modified or falsified.
--
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 Thu Feb 10 15:35:09 2005