Subject: [xsl] apply-templates vs value-of in leader line From: "Jennifer Phan" <jenn.phan72@xxxxxxxxx> Date: Mon, 24 Sep 2007 07:50:22 -0700 |
Hello, I'm having trouble getting the format correct in my FO style sheet. Currently I am showing my data using "value-of switch[2]" I need to instead use "apply-templates select="switch[2]", if don't use the apply-templates the "value" element is not pulled in and I have an empty parenthesis. But when I use apply-templates all the text stretches across and the leader line and switch[3] starts on a new line. Below are examples of my problem. If anyone could explain why this is I appreciate it. With value-of - (this is how I want it to look, but need the () to be filled with the text in the value element) 1. switch 2 is used in accordance with () specifications.....................ISO XSLT: <fo:block> <fo:list-block> <fo:list-item> <fo:list-item-label width="15pt" end-indent="label-end()" > <fo:block><xsl:number level="single" format="a. "/></fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block linefeed-treatment="preserve" text-align-last="justify" padding-bottom="2pt"> <xsl:value-of select="switch[2]"/> <fo:leader leader-pattern="dots" leader-alignment="reference-area"/> <xsl:value-of select="switch[3]"/> __ </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block> With apply-templates 1. switch 2 is used in accordance with all specifications ................................................................................................................I SO <fo:block> <fo:list-block> <fo:list-item> <fo:list-item-label width="15pt" end-indent="label-end()" > <fo:block><xsl:number level="single" format="a. "/></fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block linefeed-treatment="preserve" text-align-last="justify" padding-bottom="2pt"> <xsl:apply-templates select="switch[2]"/> <fo:leader leader-pattern="dots" leader-alignment="reference-area"/> <xsl:apply-templates select="switch[3]"/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block> <xsl:template match="switch"> <xsl:apply-templates/> </xsl:template> <xsl:template match="value"> <fo:inline><xsl:value-of select="."/></fo:inline> </xsl:template> XML EXAMPLE <switch>KB15684</switch> <switch>switch 2 is in accordance with (<value>all</value>) specifications</switch> <switch>ISO</switch>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] apply-templates vs value-of i, Jennifer Phan | Thread | [xsl] apply-templates vs value-of i, Jennifer Phan |
[xsl] apply-templates vs value-of i, Jennifer Phan | Date | [xsl] apply-templates vs value-of i, Jennifer Phan |
Month |