[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Turning css (font-weight:bold) attributes into tag

Subject: Re: Turning css (font-weight:bold) attributes into tags <b>
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 13 Mar 2007 18:07:20 +0100
Re:  Turning css (font-weight:bold) attributes into tag
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.