xsl-list
[Top] [All Lists]

Re: [xsl] Turning css (font-weight:bold) attributes into tags <b>

2007-03-13 10:10:08
Abel Braaksma wrote:
This example template assumes $input with 'span' elements and only text therein, but it is build with expansion in mind, so it won't be too hard to make it work with nodes inside 'span'.

A little bug crawled into the stylesheet, throwing away any attributes you'd have in the $css-mapping table. Change the treewalker to the following and it's fixed:

  <!-- simple treewalker template to go from flat to hierarchical -->
  <xsl:template match="* | @*" mode="flat-to-hier">
      <xsl:param name="text" tunnel="yes" />
      <xsl:copy>
<xsl:apply-templates select="@* | following-sibling::*[1]" mode="#current"/> <xsl:sequence select="if(following-sibling::*) then '' else $text" />
      </xsl:copy>
  </xsl:template>


Cheers,
-- Abel



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>