Is there an XSLT way to echo from XML to its power?

I am using XSLT for XML conversion. Is there any way for XSLT to spit out XML that feeds it? Sort of:

<xsl:echo-xml />
+5
source share
3 answers

Next, the full XML is copied to the resulting tree:

<xsl:copy-of select="." />

If you want to send this message "message output", you can simply wrap it as follows:

<xsl:message>
    <xsl:copy-of select="."/>
</xsl:message>
+6
source

I mainly use some XSLTs to convert XML, is there an XSLT way to spill out XML that feeds it? Sort of:

The easiest and shortest way :

<xsl:copy-of select="/"/>

This outputs the current XML document.

<xsl:copy-of select="."/>

, node.

XSLT ( ):

 <xsl:template match="node()|@*">
  <xsl:copy>
    <xsl:apply-templates select="node()|@*"/>
  </xsl:copy>
 </xsl:template>

, XML-, .

XSLT. , , , (, , ,... ..)/

+8

name() XPath node:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="serialize.xml"?>
<xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"
            >
<xsl:output method="xml" encoding="utf-8" version="" indent="yes" standalone="no" media-type="text/html" omit-xml-declaration="no" doctype-system="about:legacy-compat" />

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

<xsl:template match="/">
  <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    </head>
    <body>
      <xsl:apply-templates select="*" mode="serialize"/>
    </body>
  </html>
</xsl:template>

    <xsl:template match="*" mode="serialize">
      &lt;<xsl:value-of select="name()" />&gt;
    <xsl:apply-templates select="*" mode="serialize"/>
</xsl:template>
</xsl:stylesheet>

Jeni Tennison XML HTML, XML- XSL-List

0

All Articles