🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #8294

Re: Parser et r��crire � l'identique II (le retour)

#8294
From: Pascal Cescon
Date: Mon, 12 Nov 2001 10:38
110 lines
4160 bytes
Tr�s juste !!! �a fonctionne pas mal avec ce code :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "html" encoding="ISO-8859-1"/>

    <xsl:template match="@*|*|text()" priority="-1">
      <xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
      </xsl:copy>
    </xsl:template>
</xsl:stylesheet>

Pascal

"Aurelien DEHAY" <aurelien.dehay@wanadoo.com> a �crit dans le message de
news: m3u1w05lqt.fsf@win000002.wanadoo.fr...
> "Pascal Cescon" <pascal.cescon@cityneo.com> writes:
>
> > Bonjour,
> >
> > Dans une question pr�c�dente j'obetnais une excellente r�ponce de Alain
qui
> > me conduisi � �crire le code suivant :
>
> [...]
>
> Moi j'ai un petit bout de code qui fait les choses suivantes:
>
> 1- selon un param�tre, g�n�re un des 2 processing-instruction (pour
> l'html ou le pdf)
>
> 2- applique un mod�le pour un xml dont le contenu est dans un autre
> xml
>
> 3- recopie tout le reste
>
> La v'l�:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
>   <xsl:include href="relations.xsl"/>
>
>   <xsl:param name="format">html</xsl:param>
>   <xsl:preserve-space elements="*"/>
>
>   <xsl:template match="document">
>     <xsl:choose>
>       <xsl:when test="$format='pdf'">
> <xsl:processing-instruction
name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
> <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
> <xsl:processing-instruction
name="cocoon-process">type="xinclude"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">version="1.0"
href="/styles/xsl/document-pdf.xsl"
type="text/xsl"</xsl:processing-instruction>
>       </xsl:when>
>       <xsl:when test="$format='html'">
> <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
> <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">version="1.0"
href="/styles/xsl/document-html.xsl"
type="text/xsl"</xsl:processing-instruction>
>       </xsl:when>
>     </xsl:choose>
>
>     <xsl:copy>
>       <xsl:apply-templates select="@*|*|text()"/>
>     </xsl:copy>
>
>     </xsl:template>
>
>     <xsl:template match="relations" priority="1">
>       <xsl:apply-templates
select="document('/usr/local/var/cvs/arbo.xml')/liens">
> <xsl:with-param name="type" select="@type"/>
> <xsl:with-param name="p" select="@p"/>
> <xsl:with-param name="m" select="@m"/>
> <xsl:with-param name="a" select="@a"/>
>       </xsl:apply-templates>
>     </xsl:template>
>
>     <xsl:template match="@*|*|text()" priority="-1">
>       <xsl:copy>
> <xsl:apply-templates select="@*|*|text()"/>
>       </xsl:copy>
>     </xsl:template>
>
>
> </xsl:stylesheet>
>
>
> A mon avis, il te manque un @* quelquepart.
>
> >
> > Merci
> >
> > Pascal
> >
> >
>
> --
> Aur�lien DEHAY
Technical Details
Message-ID: <9so8rl$ns3$1@wanadoo.fr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!wanadoo.fr!not-for-mail
References: <9so7l0$ml8$1@wanadoo.fr> <m3u1w05lqt.fsf@win000002.wanadoo.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,ae7792717d1891f9
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-11-12 02:38:46 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!wanadoo.fr!not-for-mail
From: "Pascal Cescon" <pascal.cescon@cityneo.com>
Newsgroups: fr.comp.text.xml
Subject: Re: Parser et r��crire � l'identique II (le retour)
Date: Mon, 12 Nov 2001 11:38:44 +0100
Organization: Wanadoo, l'internet avec France Telecom
Lines: 112
Message-ID: <9so8rl$ns3$1@wanadoo.fr>
References: <9so7l0$ml8$1@wanadoo.fr> <m3u1w05lqt.fsf@win000002.wanadoo.fr>
NNTP-Posting-Host: amarseille-101-1-1-5.abo.wanadoo.fr
X-Trace: wanadoo.fr 1005561525 24451 193.252.177.5 (12 Nov 2001 10:38:45 GMT)
X-Complaints-To: abuse@wanadoo.fr
NNTP-Posting-Date: 12 Nov 2001 10:38:45 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000