Article View: fr.comp.text.xml
Article #8340Re: xslt
From: Philippe Batailler
Date: Wed, 21 Nov 2001 10:18
Date: Wed, 21 Nov 2001 10:18
91 lines
3707 bytes
3707 bytes
Alain Ketterlin <alain@dpt-info.u-strasbg.fr> writes:
> > Oui c'est ce que j'ai fait jusqu'� pr�sent; et j'analyse le
> > document-r�sultat avec nsgmls : pas d'erreur.
>
> Attention : nsgmls c'est pour SGML. Que dit un parseur XML ? (Il
> devrait etre content aussi, ce n'est pas important.)
xsltproc ne dit rien.
>
> > <xsl:otherwise>
> > <varlistentry>
> > <term>
> > <xsl:apply-templates/>
> > </term>
> > </xsl:otherwise>
> > ...
>
> Ouch. Cela veut dire que ton <varlistentry> est ferme en-dehors du
> <xsl:choose>,
oui
>donc que chaque <xsl:when> doit aussi introduire une
> balise <varlistentry>.
non, seul le otherwise l'ouvre.
structure source structure arriv�e
taglist variablelist
varlistentry
tag term
tag term
tag term
item listitem
tag </varlistentry>
item varlistentry
term
listitem
</taglist> </varlistentry>
</variablist>
>
> En general, la transfo XSLT est plutot dirigee par la structure en
> sortie.
Ce que je fais ne doit pas �tre tr�s efficace ni �l�gant !!
voici :
<xsl:template match="taglist">
<variablelist>
<xsl:apply-templates/>
</variablelist>
</xsl:template>
<xsl:template match="tag">
<xsl:choose>
<xsl:when test="(following-sibling::*[1]/self::item) and
(preceding-sibling::*[1]/self::tag)">
<term>
<xsl:apply-templates/>
</term>
</xsl:when>
<xsl:when test="(following-sibling::*[1]/self::tag) and
(preceding-sibling::*[1]/self::tag)">
<term>
<xsl:apply-templates/>
</term>
</xsl:when>
<xsl:otherwise>
<varlistentry>
<term>
<xsl:apply-templates/>
</term>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="taglist/item">
<listitem>
<xsl:apply-templates/>
</listitem>
<xsl:text disable-output-escaping="yes">
</varlistentry>
</xsl:text>
</xsl:template>
amicalement,
--
philippe batailler
in girum imus nocte et consumimur igni
Technical Details
Message-ID:
<871yisv34b.fsf@clalis.pclnet>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.25.12.36!oleane.net!oleane!teaser.fr!clalis!not-for-mailReferences:
<87lmh2g5wn.fsf@clalis.pclnet> <wyu1vq3kmq.fsf@polya.u-strasbg.fr> <87n11hn7p7.fsf@clalis.pclnet> <wysnb97t88.fsf@polya.u-strasbg.fr> <87r8qt2nnw.fsf@clalis.pclnet> <wypu6c7gjk.fsf@polya.u-strasbg.fr> <87u1vo7c6r.fsf@clalis.pclnet> <wyk7wk7dyn.fsf@polya.u-strasbg.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,6f15fa792995f48a X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-11-21 02:09:46 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.25.12.36!oleane.net!oleane!teaser.fr!clalis!not-for-mail From: Philippe Batailler <pbatailler@teaser.fr> Newsgroups: fr.comp.text.xml Subject: Re: xslt Date: 21 Nov 2001 11:18:28 +0100 Organization: Guest of France-Teaser Lines: 91 Sender: phil@clalis.pclnet Message-ID: <871yisv34b.fsf@clalis.pclnet> References: <87lmh2g5wn.fsf@clalis.pclnet> <wyu1vq3kmq.fsf@polya.u-strasbg.fr> <87n11hn7p7.fsf@clalis.pclnet> <wysnb97t88.fsf@polya.u-strasbg.fr> <87r8qt2nnw.fsf@clalis.pclnet> <wypu6c7gjk.fsf@polya.u-strasbg.fr> <87u1vo7c6r.fsf@clalis.pclnet> <wyk7wk7dyn.fsf@polya.u-strasbg.fr> NNTP-Posting-Host: d45-109.ppp.teaser.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: feed.teaser.net 1006337385 78943 213.91.45.109 (21 Nov 2001 10:09:45 GMT) X-Complaints-To: abuse@teaser.fr NNTP-Posting-Date: Wed, 21 Nov 2001 10:09:45 +0000 (UTC) User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7