xsl-list
[Top] [All Lists]

[xsl] newbie xsl apply-templates nesting question

2008-01-07 15:40:14
hi

i'm sure there's an easy way to do this, but i'm not getting it. it's
probably been answered many times before, if there's a URL or book for
this, please let me know.

let's say i have some XML like this

<opening>
  <p>this is plain <span class="underline">and this is underlined</span>
and this is plain again</p>
</opening>

and my stylesheet looks like this:

<xsl:template match="opening">
  <xsl:apply-templates select="p"/>
</xsl:template>

<xsl:template match="p">
  <xsl:apply-templates select="span[(_at_)class='underline']"/>
  <fo:block><xsl:value-of select="."/><fo:block>
</xsl:template>

<xsl:template match="span[(_at_)class='underline']">
  <fo:inline text-decoration="underline"><xsl:vaue-of
select="."/></fo:inline>
</xsl:template>

as you probably can guess, the underlined text comes up first, then the
plain text comes next. i have a feeling i'm misunderstanding something
very fundamental here.

any help is appreciated.


--
\js 

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