xsl-list
[Top] [All Lists]

Re: [xsl] block and templates.

2006-09-21 13:17:12
Hmm, that doesn't seem to be it.

When this template is called:

<xsl:template match="t">
        <fo:block keep-together="always" start-indent="1.25in">
                <xsl:apply-templates />
        </fo:block>
</xsl:templates>

My interpretation is that any thing that has a <t> tag is indented.

When this template is called:

<xsl:template match="line">
        <fo:block line-hieght="2.0">
                <xsl:value-of select="./@number" />
                <xsl:value-of select="./line"/>
                <xsl:apply-templates />
        </fo:block>
</xsl:template>

I believe it is saying everything inside line tag is printed.

The more I mess around with things, I've noticed that I don't need
<xsl:value-of select="./line" />.  1.) Because its not a correct
statement (as you pointed out), and 2.) the apply-templates is making a
call similar to <xsl:value-of select="." />.  So if I have another value
of, my lines are getting printed twice.

What I can't seem to handle is when I indent a specific line, and then
jump to handling the rest of the lines.  So I believe what it comes down
to is can I specify HOW it applies the template? So if I have the
following XML:

<line number ="1">
<t>a;a;kljaf;dkfja;dfkj</t>
</line>

Can I handle the <t> tags within the line template?

Thanks!





On Thu, 2006-09-21 at 21:22 +0200, Florent Georges wrote:
Luke Jones wrote:

Input looks something like this.

<para>
    <line number="3">
            <t>This is the first sentence in a paragraph.</t>
    </line>
    <line number="4">
            This is the second line in a paragraph.
    </line>
</para>

  You didn't say what to do with the second line (have the whitespaces
at the beginning of the text node to be kept?).  Maybe your can adapt
this:

    <xsl:value-of select="@number"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="normalise-spaces(.)"/>

  Not tested.

  Regards,

--drkm


















      

      
              
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le 
sujet ! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et 
vos expériences. 
http://fr.answers.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>
--~--


--~------------------------------------------------------------------
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>