W3C home > Mailing lists > Public > www-xsl-fo@w3.org > April 2005

convert html-tags with class

From: torsten krohn | tsdb | the simpsons database <torsten@tsdb.de>
Date: Fri, 22 Apr 2005 00:53:31 +0200
To: <www-xsl-fo@w3.org>
Message-ID: <002301c546c4$f1d83560$0301a8c0@HOMER>

Hi!

I'd like to convert html-tags with attribute 'class="blue"' in general,
e.g.

<ul>
	<li class="blue">litext</li>
</ul>
<span class="blue">spantext</span>

spantext gets blue with following xsl, but litext stays black. Error
message: children of list-blocks must be list-items. How can I change it
for a proper parsing?

<xsl:template match ="*[@class='blue']"> 
   <fo:inline color="rgb(0,51,153)">
   	<xsl:apply-templates/>
   </fo:inline>
 </xsl:template>

<xsl:template match="ul">
	<fo:list-block>
		<xsl:apply-templates/>
	</fo:list-block>
</xsl:template>
	
<xsl:template match="li">
	<fo:list-item space-after="5mm">
		<fo:list-item-label start-indent="0.2in">
			<fo:block>
				<fo:inline
font-family="Symbol">&#x2022;</fo:inline>
			</fo:block>
		</fo:list-item-label>
		<fo:list-item-body start-indent="0.4in"
end-indent="0.1in">
			<fo:block>
				<xsl:apply-templates/>
			</fo:block>
		</fo:list-item-body>
	</fo:list-item>
</xsl:template>

Thank you, Torsten
Received on Thursday, 21 April 2005 22:53:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:13 GMT