xsl-list
[Top] [All Lists]

Re: formatting text with nested features

2003-10-24 03:19:19

  <xsl:for-each select="//p">
            <fo:block font-family="Times-Roman" space-before="10pt">
              <xsl:for-each select=".//text()">


You don't want to use .// here as that can easily result in pulling your
document out of sequence.

Just let xslt do the work for you.

don't use for-each, just use

<xsl:apply-templates/>

then have

<xsl:template match="p">
 <fo:block font-family="Times-Roman" space-before="10pt">
   <xsl:apply-templates/>
 </fo:block>
</xsl:template>

<xsl:template match="i">
 <fo:inline font-style="oblique">
   <xsl:apply-templates/>
 </fo:inline>
</xsl:template>

<xsl:template match="b">
 <fo:inline font-weight="bold">
   <xsl:apply-templates/>
 </fo:inline>
</xsl:template>



etc, and XSL will just automatically do the right thing with respect to
nesting.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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