XSLT surround with element

AlM

New Member
Ok, I feel like this is a really stupid question, but I've been trying for some time to get it so my XSLT file will spit out the output encapsulated in some arbitrary element, let's call it "root". How would I achieve this?Here is my current XSLT if that helps at all:\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"><xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/><xsl:template match="DCField"> <xsl:choose> <xsl:when test="@FieldValueType='None'"> <xsl:element name="{Name}"> <xsl:value-of select="Value" /> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:element name="{@FieldValueType}"> <xsl:value-of select="Value" /> </xsl:element> </xsl:otherwise> </xsl:choose></xsl:template><xsl:template match="text()"/></xsl:stylesheet>\[/code\]And I want it so my output looks like:\[code\]<root> <element1> <element2> ...</root>\[/code\]
 
Back
Top