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

apply-templates vs value-of in leader line

Subject: apply-templates vs value-of in leader line
From: "Jennifer Phan" <jenn.phan72@xxxxxxxxx>
Date: Mon, 24 Sep 2007 07:45:38 -0700
 apply-templates vs value-of in leader line
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

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.