This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: handling embedded XML tags
- From: Wendell Piez <wapiez at mulberrytech dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 02 Oct 2002 00:37:31 -0400
- Subject: Re: [xsl] handling embedded XML tags
- Reply-to: xsl-list at lists dot mulberrytech dot com
Mick,
At 11:17 PM 10/1/2002, you wrote:
What I am trying to achieve is this:
<p>Some text here <span>emphasised words</span> and more text here</p>
So, my question is, how can I apply the 'emphasis' template in an 'inline'
manner to elements 'embedded' inside other elements?
By doing this:
<xsl:template match="para">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="emphasis">
<span>
<xsl:apply-templates/>
</span>
</xsl:template>
Forget value-of until you've mastered working all the way through the node
tree applying templates (you'll get the value-of at the bottom in the text
node). Read up on the built in templates and how the processor traverses
the tree by default. Soon it will click.
Hope this is clear.
Very. :-)
Cheers,
Wendell
___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list