xsl-list
[Top] [All Lists]

RE: [xsl] inline troubles

2006-09-05 15:36:12
This is what template rules are designed for.

Cut out all the sequential logic involving xsl:for-each, replace it with a
template rule for each inline element type that says how to handle that
element, and then just do xsl:apply-templates.

Michael Kay
http://www.saxonica.com/

 

-----Original Message-----
From: Luke Jones [mailto:ljones(_at_)unicam(_dot_)state(_dot_)ne(_dot_)us] 
Sent: 05 September 2006 22:13
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] inline troubles

I'm having some trouble trying to underline and line-through 
specific text from my xml.  My xml is formatted like so:

///XML///

<line number=3>
      This is some regular old text, <a> and now I want this
      underlined </a> and then maybe some more regular old text, 
      <d>and this to be line-through</d> and finish up with some
      regular text.
</line>

Here is what I currently have in my xsl:

///XSL///
<xsl: for-each select = "line">
      <xsl:value-of select="./@number>
      <xsl:for-each select = "a">
              <fo:inline text-decoration="underline">
                      <xsl:value-of select="."/>
              </fo:inline>
      </xsl:for-each>
      <xsl:for-each select = "d">
              <fo:inline text-decoration="line-through">
                      <xsl:value-of select="."/>
              </fo:inline>
      </xsl:for-each>
</xsl:for-each>

The above xsl however prints the line with both the 
underline/strike through section and the non formatted 
version, giving me repeated lines.
Any ideas on how to properly handle this?

Thanks,
L

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