This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
handling embedded XML tags
- From: ninti at ninti dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 02 Oct 2002 13:17:26 +1000 (EST)
- Subject: [xsl] handling embedded XML tags
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi:
I am currently converting documents at the Institute where I work into XML
format. We are using standard simplified DocBook XML tags and PHP/Sablotron to
do transformations. The XSLT stylesheets I am using have worked fine until the
following problem arose:
I have <emphasis> tags embedded in <para> tags like this:
<para>Some text here <emphasis>emphasised words</emphasis> and more text here</para>
I am using the following templates to handle this:
<xsl:template match="para">
<p>
<xsl:value-of select="."/>
<xsl:apply-templates select="emphasis"/>
</p>
</xsl:template>
<xsl:template match="emphasis">
<span>
<xsl:value-of select="."/>
</span>
</xsl:template>
The output I'm getting is like this:
<p>Some text here and more text here</p><span>emphasised words</span>
The <para> elements are processed, then the <emphasis> elements are processed.
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?
Hope this is clear.
TIA
Mick
----------------------------------------------------
MICHAEL HALL Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
W: mick.hall@nt.gov.au (08) 8951 8352
H: ninti@ninti.com (08) 8953 1442
----------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list