Here is my current XML output:
<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 <
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?
Just use 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With