How do I remove the BOM character from my xml file [duplicate]

I am using xsl to control the output of my xml file, but the BOM character is being added.


# vim file.xml
:set nobomb
:wq

just need to add this in your xslt file:

<xsl:output method="text"
        encoding="ASCII"/>

Just strip first two bytes using any hex editor.


Remove the BOM symbol from string with XSLT is pretty simple:

<xsl:value-of select="translate(StringWithBOM,'','')"/>