Print Page | Close Window

Can't open file with XmlParts

Printed From: TMS Software
Category: .NET Components
Forum Name: .NET Flexcel
Forum Discription:
Printed Date: 27 May 2020 at 1:31am

Topic: Can't open file with XmlParts
Posted By: Ghislain Benrais
Subject: Can't open file with XmlParts
Date Posted: 26 Jan 2017 at 3:40pm
I save some custom xml parts in excel files with this program :
        public  void SaveContent(string xml )
                TCustomXmlPart xmlPart = new TCustomXmlPart(xml,null);
            catch (Exception e)
                throw new Exception("Erreur lors de la sauvegarde des donn?es dans un document FlexCel :" + "\n" + e.Message);

It works fine but when I open the saved file with this program :
            Xls = new XlsFile();

I get the an XmlException :
Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 41
Here are the first bytes of the xml part (I stripped the null characters) :
<?xml version="1.0" encoding="utf-16"?><Document xmlns:d1="" xmlns:d2="http://sch...
I noticed that BOM was missing, so I tried again with it and got the same exception.
Thanks for your help,

Posted By: Adrian Gallero
Date Posted: 26 Jan 2017 at 4:49pm
Thanks for reporting this: It is indeed a bug on FlexCel side.
We will be releasing a new version later today that will have this fixed.

Posted By: Adrian Gallero
Date Posted: 01 Feb 2017 at 4:26pm
Ok, the new version took a little longer than planned due to all changes Microsoft did in .NET core (now it is csproj based, not project.json based).
But the new version is already available on our site.

Posted By: Ghislain Benrais
Date Posted: 01 Feb 2017 at 4:41pm

Thanks a lot

Print Page | Close Window