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

Re: XSL nested tag help

Subject: Re: XSL nested tag help
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Mon, 07 Oct 2002 23:40:55 +0200
nested tags xml xsl
Hi Mani,

then you either have a non-compliant XSLT processor or your source is not the one you wrote or you didn't use <xsl:apply-templates/>. What processor did you use and how exactly did your XSLT code look like??


Mani Malarvannan wrote:
For my XSL nested tag question some of you responded with a solution of using text(), but that solution is not working. When I tried with the solution, the text under "Target" tag is printing at the end of text under "Main" ie,

<h1>This is a first test message it is important<h1>
<h2> and <h2>

But I need the output to be <h1>This is a first test message <h2> and </h2> it is important</h1>

Thanks for all the help


From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE:  XSL nested tag help
Date: Saturday, October 05, 2002 5:29 PM

I've following XML file.
This is a first test message
<Target> and </Target>
it is important

From the above XML file I'd like to write and XSL so that I'll get following output
<h1>This is a first test message<h1> <h2> and </h2> <h1>it is important </h1>

<xsl:template match="Main/text()"> <h1><xsl:value-of select="."/></h1> </xsl:template>

<xsl:template match="Target">
  <h2><xsl:value-of select="."/></h2>

But before you do that, try to choose a better design for your XML.
Using mixed content (text and elements as siblings of each other)
probably isn't the best approach here.

Michael Kay

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

Current Thread


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.
First Name
Last Name
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.