Subject: Re: [xsl] question on line breaks / chess From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 17 Jul 2009 07:36:10 -0400 |
Now I have three questions: 1) How can I inspect the output of the transformation in the browser? "View source" does not help since it shows the XML input.
2) How can I make the output of the browser transformation similar to that of xsltproc?
board.html looks like this, all in a single line (split into many lines here for readybility, only):
<html><table border="1"><tr><td><img src="gif/brw.gif"><img src="gif/ bnb.gif"><img src="gif/bbw.gif"><img src="gif/bqb.gif"><img src="gif/ bkw.gif"><img src="gif/bbb.gif"><img src="gif/bnw.gif"><img src="gif/ brb.gif"><br><img src="gif/bpb.gif">... ...<img src="gif/wrw.gif"><br></td></tr></table></html>
3) Is there a better way than having template matching "f" with mode in order to handle field background color appropriately?
... <xsl:template match="row"> <xsl:choose> <xsl:when test="(position() mod 2)=0"> <xsl:apply-templates select="f" mode="w"/><br/>? </xsl:when> <xsl:otherwise> <xsl:apply-templates select="f" mode="b"/><br/>? </xsl:otherwise> </xsl:choose> </xsl:template>
<xsl:template match="f" mode="w"> <xsl:call-template name="img">> <xsl:with-param name="pos" select="position()+0"/> </xsl:call-template> </xsl:template>
<xsl:template match="f" mode="b"> <xsl:call-template name="img">> <xsl:with-param name="pos" select="position()+1"/> </xsl:call-template> </xsl:template> ...
<xsl:template match="row"> <xsl:apply-templates select="f"> <xsl:with-param name="rowOffset" select="position() mod 2"/> </xsl:apply-templates/> </xsl:template> <xsl:template match="f" name="img"> <xsl:param name="rowOffset"/> <xsl:variable name="pos" select="position() + $rowOffset"/> ... img template stuff ... </xsl:template>
-- XSLT/XSL-FO/XQuery hands-on training - Oakland, CA, USA 2009-08-03 Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] question on line breaks /, Hermann Stamm-Wilbra | Thread | [xsl] for-each-group for multiple n, Ramkumar |
Re: [xsl] question on line breaks /, Martin Honnen | Date | Re: [xsl] question on line breaks /, Michael Ludwig |
Month |