Re: [xsl] transformation of narrative documents with nested elements

Subject: Re: [xsl] transformation of narrative documents with nested elements
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Sun, 16 Jan 2005 18:58:45 +0100
Tempore 19:26:54, die 01/16/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Andrea Fiore <a.flow@xxxxxxxxxx>:

* I have to select only the news where an English title is available

* I have to transform all the elements inside the English description,
and they may occur as nested elements, as in line 17: X PATH: /news_list/news/description[lang='it']/bold/emph at the moment i wrote this stylesheet, that does not achieve the second goal: i have a correct output for line 15 and 16, but i have no output for line 17
Hi,

Just replace 'xsl:value-of' elements with 'xsl:apply-templates' elements in the templates:

<xsl:template match="bold">
    <xsl:element name="strong">
      <xsl:apply-templates/>
    </xsl:element>
</xsl:template>
<xsl:template match="emph">
    <xsl:element name="em">
      <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

Note that I also replaced 'i' with 'em'; html has an element that expresses emphasis, you should preserve the markup as much as possible.

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Vincit omnia simplicitas
Keep it simple

Current Thread