xsl-list
[Top] [All Lists]

XSL newbie question formatting

2005-03-31 10:44:23
I have the following xsl code.  This one works but the
when I try to break it into a new template it does not
work.  Ideas?  The broken code is at the bottom

<xsl:template match="/">
 
 <fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
 
   <fo:layout-master-set>
     <fo:simple-page-master master-name="mailer"
                   page-height="29.7cm" 
                   page-width="21cm"
                   margin-top="1cm" 
                   margin-bottom="2cm" 
                   margin-left="2.5cm" 
                   margin-right="2.5cm">
       <fo:region-body margin-top="3cm"/>
       <fo:region-before extent="3cm"/>
       <fo:region-after extent="1.5cm"/>
     </fo:simple-page-master>
   </fo:layout-master-set>
 
 
   <fo:page-sequence master-reference="mailer">
        <fo:flow flow-name="xsl-region-body">
                <fo:block font-size="10pt" 
                font-family="sans-serif" 
                line-height="15pt"
                space-after.optimum="3pt"
                text-align="justify">
                        <fo:block>
                                <xsl:value-of select="/header/contact"/>
                        </fo:block>
                        <fo:block>
                                <xsl:value-of select="/header/addr1"/>
                        </fo:block>
                        <fo:block>
                                <xsl:value-of select="/header/addr2"/>
                        </fo:block>
                        <fo:block>
                                <xsl:value-of select="/header/addr3"/>
                        </fo:block>
                        <fo:block>
                                 <xsl:value-of
select="/header/city"/>&#160;<xsl:value-of
select="/header/state"/>&#160;<xsl:value-of
select="/header/zip_code"/>
                        </fo:block>
                </fo:block>
        </fo:flow>
   </fo:page-sequence>

  </fo:root> 
 </xsl:template>


THIS DOES NOT WORK WHY?  All I did was make a template
out of it.  Or did I do more?

<xsl:template match="/">
 
 <fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
 
   <fo:layout-master-set>
     <fo:simple-page-master master-name="mailer"
                   page-height="29.7cm" 
                   page-width="21cm"
                   margin-top="1cm" 
                   margin-bottom="2cm" 
                   margin-left="2.5cm" 
                   margin-right="2.5cm">
       <fo:region-body margin-top="3cm"/>
       <fo:region-before extent="3cm"/>
       <fo:region-after extent="1.5cm"/>
     </fo:simple-page-master>
   </fo:layout-master-set>
 
 
   <fo:page-sequence master-reference="mailer">
        <fo:flow flow-name="xsl-region-body">
                <fo:block>
                        <xsl:apply-templates select="mailingAddr"/>
                </fo:block>
        </fo:flow>
   </fo:page-sequence>

  </fo:root> 
 </xsl:template>
 

 <!-- DATA FIELD TEMPLATES -->
 <xsl:template name="mailingAddr">
        <fo:block font-size="10pt" 
     font-family="sans-serif" 
     line-height="15pt"
     space-after.optimum="3pt"
     text-align="justify">
                <fo:block>
                        <xsl:value-of select="/header/contact"/>
                </fo:block>
                <fo:block>
                        <xsl:value-of select="/header/addr1"/>
                </fo:block>
                <fo:block>
                        <xsl:value-of select="/header/addr2"/>
                </fo:block>
                <fo:block>
                        <xsl:value-of select="/header/addr3"/>
                </fo:block>
                <fo:block>
                         <xsl:value-of
select="/header/city"/>&#160;<xsl:value-of
select="/header/state"/>&#160;<xsl:value-of
select="/header/zip_code"/>
                </fo:block>
        </fo:block>
</xsl:template>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>