🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: insertion de JavaScript dans XSL

#8211
From: Rapha�l THERY
Date: Fri, 23 Nov 2001 13:18
77 lines
3446 bytes
salut,

as tu essay� !
nous nous avons eu recours � cette astuce pour r�soudre le probl�me sous
Oracle.

<xsl:comment>
<![CDATA[
     ici tu mets ton javascript
]]>
</xsl:comment>
l'un sans l'autre �a ne marchait pas. Par contre avec xalan sans les deux �a
marche aussi ....
ce n'est donc pas une explication (je laisse ce soins � d'autres) ni la
solution.

Rapha�l

"Guillaume BERTHOMMIER" <berthomg@igbmc.u-strasbg.fr> a �crit dans le
message news: 3BFE4797.EB56143F@igbmc.u-strasbg.fr...
> Bonjour a tous,
>
> Voila mon probleme :
> Je desire inserer un Javascript dans ma feuille de style XSL.
> Actuellement j'effectue la transformation en HTML par un script PHP qui
> fait appel a Sablotron pour effectuer la transformation a la volee cote
> serveur de mes fichiers XML.
>
> j'ai essaye diverses methodes dont :
>
> - <xsl:script>  ne semble pas etre pris en charge par Sablotron 0.60 .
> J'ai donc decide d'utiliser la derniere version qui est la 0.71. MAIS je
> n'obtient plus aucune transformation lorsque j'utilise le fichier
> sablot.dll (sous Windows) de la version 0.71 (et meme sans utiliser
> <xsl:script> et en gardant ma feuille de style qui fonctionne bien avec
> la version 0.60, ce qui est quand meme etrange vous ne trouvez pas). La
> doc de Sablotron etant ce qu'elle est, je m'en remets donc a vous.
>
> - une section CDATA ne fonctionne pas non plus
>
> - une autre technique ne fonctionnant pas non plus etait de mettre le
> script dans une balise <xsl:comment>, j'ai vu ca sur le net.
>
> Pour vous aider voici le script PHP qui fait la transformation:
> <?php
>
>  $xmlFile = $xml;
>  $xslFile = $xsl;
>
>  // Create a new processor handle
>  $th = @xslt_create() or die("Can't create XSLT handle!");
>
>  // Open the XML and XSL files
>  $xh = fopen($xmlFile, "r") or die("Can't open XML file");
>  $sh = fopen($xslFile, "r") or die("Can't open XSL file");
>
>  // Read in the XML and XSL contents
>  $xmlContent = fread($xh, filesize($xmlFile));
>  $xslContent = fread($sh, filesize($xslFile));
>
>  // Perform the XSL transformation
>  @xslt_process($xslContent, $xmlContent, $XSLtransformation);
>
>  // Output the transformed XML file
>  echo $XSLtransformation;
>
>  // Free up the resources
>  @xslt_free($th);
>
> ?>
>
> Je serais vraiemnt heureux si vous pouviez m'aider
> Merci de votre attention
>
> Guillaume
>
>
Technical Details
Message-ID: <3bfe4cea$0$15833$626a54ce@news.free.fr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!fr.clara.net!heighliner.fr.clara.net!proxad.net!feeder2-1.proxad.net!news1-1.free.fr!not-for-mail
References: <3BFE4797.EB56143F@igbmc.u-strasbg.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,96e57fa81ad33464
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-11-23 05:19:41 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!fr.clara.net!heighliner.fr.clara.net!proxad.net!feeder2-1.proxad.net!news1-1.free.fr!not-for-mail
From: "Rapha�l THERY" <raphael.thery@free.fr>
Newsgroups: fr.comp.text.xml
References: <3BFE4797.EB56143F@igbmc.u-strasbg.fr>
Subject: Re: insertion de JavaScript dans XSL
Date: Fri, 23 Nov 2001 14:18:09 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Lines: 79
Message-ID: <3bfe4cea$0$15833$626a54ce@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 23 Nov 2001 14:19:40 MET
NNTP-Posting-Host: 195.115.154.77
X-Trace: 1006521580 news1-1.free.fr 15833 195.115.154.77
X-Complaints-To: abuse@proxad.net