[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: handling embedded XML tags

Subject: Re: handling embedded XML tags
From: ninti@xxxxxxxxx
Date: Wed, 02 Oct 2002 13:27:44 +1000 (EST)
xslt embedded xml
Sorry, the examples I provided in my original posting were not quite accurate.
This is an amended version:

> 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 here</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 emphasised words here and more text
here</p><span>emphasised words here</span>
 
The <para> elements are processed (including content of <emphasis> tags), 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@xxxxxxxxx                (08) 8951 8352
> H: ninti@xxxxxxxxx                    (08) 8953 1442
> ----------------------------------------------------
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 



----------------------------------------------------
MICHAEL HALL                 Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
W: mick.hall@xxxxxxxxx                (08) 8951 8352
H: ninti@xxxxxxxxx                    (08) 8953 1442
----------------------------------------------------

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.