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

[XSL 1.0] How to use apply-templates to process a sub

Subject: [XSL 1.0] How to use apply-templates to process a sub-node
From: Keith Gilbert <kgilbert@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Feb 2011 15:51:21 -0600
 [XSL 1.0] How to use apply-templates to process a  sub
This is a real basic question, I think, but I can't get my head around it.
Given this XML:

		<Head>This is the title</Head>
		<Body>This is the body <Big>some of it is bold</Big> and some isn't</Body>
		<Body>This is some more body text.</Body>

And this XSL:

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

    <xsl:template match="Head">
        <h1><xsl:value-of select="."/></h1>

    <xsl:template match="Body">
        <p><xsl:value-of select="."/></p>

    <xsl:template match="Big">
        <bold><xsl:value-of select="."/></bold>


I'm trying to convert the XML to HTML with XSL. I've got it all figured out
and working, except for the <Big> text. I don't understand how to recursively
get to the <Big> element when it is a sub-element of <Body>. All the examples
I've read about in all my books expect the XML to be:

	<Big>text here</Big>

But this is a different structure, where the <Big> element is in the middle of
the Body element.

Can anyone shed some light on how I get to the <Big> element with


~ Keith

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.