xsl-list
[Top] [All Lists]

Re: [xsl] How to insert Root Element in XML Output

2006-05-03 06:50:14
On 5/3/06, Gary E. Daniels <gdaniels(_at_)askdata(_dot_)net> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>