Here is my current XML output:
这是我当前的XML输出:
<EmployeeImport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Employee>
<EmployeeNumber>123</EmployeeNumber>
<FirstName>Jose</FirstName>
</Employee>
</EmployeeImport>
and so on. What I would like to have my output is the following:
等等。我希望得到的输出如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EmployeeImport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Employee>
<EmployeeNumber>123</EmployeeNumber>
<FirstName>Jose</FirstName>
</Employee>
</EmployeeImport>
I would like to be able to add the first line to my output. In my XSLT, I have tried <
我希望能够将第一行添加到我的输出中。在我的XSLT中,我尝试过<
to print "<" but it is interpreted just as <
. I have also tried <xsl:text>
, but ran into the same issue. Is there a way to add this declaratory line to my XSLT?
打印“<”但它被解释为<。我也试过
1 个解决方案
#1
5
Just use xsl:output.
只需使用xsl:output。
Example...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output version="1.0" encoding="UTF-8" standalone="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
#1
5
Just use xsl:output.
只需使用xsl:output。
Example...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output version="1.0" encoding="UTF-8" standalone="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>