从xslt中,你可以输出整个XML吗?

Bla*_*man 4 c# xml asp.net xslt

在我正在转换订单XML的XSLT中,我想转储我目前正在使用的整个XML.我怎样才能做到这一点?

我正在编写一些基于XML的HTML,并希望将整个XML转储到textarea中.

Dim*_*hev 8

可能是最短的... :)

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="yes" indent="yes"/>

 <xsl:template match="/">
  <xsl:copy-of select="."/>
 </xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)


Gre*_*mil 1

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)