xsl-list
[Top] [All Lists]

[xsl] outputting <?xml version="1.0" encoding="UTF-8" ?>

2006-09-15 05:23:49
I'm generating an Excel xml file as output and I've got the following as
the beginning of my xsl sheet:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet 
        xmlns:x="urn:schemas-microsoft-com:office:excel"
        xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

<xsl:output method="xml" version="1.0" encoding="UTF-8"
omit-xml-declaration="no"/>

<xsl:template match="/">
        <xsl:processing-instruction name="mso-application">
                <xsl:text>progid="Excel.Sheet"</xsl:text>
        </xsl:processing-instruction>

My problem is that the <?xml version="1.0" encoding="UTF-8" ?> which
should appear at the top as a header, doesn't. Anyone got any
suggestions as to why this would be? I've checked though dpdawsons site
and spent several hours trawling google without getting anywhere.

I'm using vb.net 1.1 to do the transforms and feed files them out via
iis. I generate the file using the following (abreviated) code:

        oXmlTxtWrt = New XmlTextWriter(oFsXML,
System.Text.Encoding.Unicode)
        oXslTran = New Xml.Xsl.XslTransform
        oXslTran.Load(strXSLFile)
        oXPathNavigator = oXPath.CreateNavigator
      oXslTran.Transform(oXPathNavigator, Nothing, oXmlTxtWrt, Nothing)

My file is correctly formatted, except for the missing xml header. It
must be something obvious but I just can't see it.

Thanks
 
Ian Murphy
Integra XP
http://www.integra-xp.com
00 34 94 621 5265
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>