xml - XSLT transformation results in characters at the beginning of the document -


hi have xml doc like

<?xml version="1.0" encoding="utf-8"?> <arrayofapifeedproduct xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema">    <apifeedproduct>       <code>c119x</code>       <offercode>mjf*q*mj*13</offercode>       <producttype>straight</producttype>       <title>joseph perrier cuvée royale brut champagne</title>       <sdesc>joseph perrier cuvée royale brut champagne</sdesc>... 

and xslt doc like

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform">   <xsl:template match="/">     <add>       <xsl:for-each select="arrayofapifeedproduct/apifeedproduct">         <doc>           <field name="code">             <xsl:value-of select="code"/>           </field>           <field name="offercode">             <xsl:value-of select="offercode"/>           </field>           <field name="producttype">             <xsl:value-of select="producttype"/>           </field>           <field name="title">             <xsl:value-of select="title"/>           </field>           <field name="sdesc">             <xsl:value-of select="sdesc"/>           </field>... 

but results in xml document like

��<?xml version="1.0" encoding="utf-8"?> <add> <doc> <field name="code">c119x</field> <field name="offercode">mjf*q*mj*13</field> <field name="producttype">straight</field> <field name="title">joseph perrier cuvée royale brut champagne</field> <field name="sdesc">joseph perrier cuvée royale brut champagne</field>... 

where first 2 characters come from?? i.e. ��?

i suspect make unicode byte order mark (bom) encoded utf-8. if document considered well-formed conforming xml processor, guarantees it, other characters before xml declaration render file not well-formed.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -