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

Re: How to insert Root Element in XML Output

Subject: Re: How to insert Root Element in XML Output
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Wed, 3 May 2006 08:49:50 -0500
insert node in xml document
On 5/3/06, Gary E. Daniels <gdaniels@xxxxxxxxxxx> wrote:
Hi. Newbie here.  I have an XSL Stylesheet that produces XML as
output.  How do I code the XSL sheet to add a Root Element to the outputted
XML document?  Below is an example of the  current XML output and the
desired XML output with the root element <foo>.  Thanks.
Gary



Ummm.... <xsl:template match="/"> <foo> <xsl:apply-templates /> </foo> </xsl:template>

/ matches the "top" of the document.  This wraps all the elements,
even the root element.

You might want to browse through the XPath specs for more info:
http://www.w3.org/TR/xpath

Jon Gorman

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.