xsl-list
[Top] [All Lists]

Re: transformation of narrative documents with nested elements

2005-01-16 10:58:45
Tempore 19:26:54, die 01/16/2005 AD, hinc in xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Andrea Fiore <a(_dot_)flow(_at_)tiscali(_dot_)it>:

 * 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--