Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Can't open file with XmlParts

 Post Reply Post Reply
Author
Ghislain Benrais View Drop Down
New Member
New Member
Avatar

Joined: 06 Nov 2014
Posts: 6
Post Options Post Options   Quote Ghislain Benrais Quote  Post ReplyReply Direct Link To This Post Topic: Can't open file with XmlParts
    Posted: 26 Jan 2017 at 3:40pm
Hello,
I save some custom xml parts in excel files with this program :
        public  void SaveContent(string xml )
        {
            try
            {
                TCustomXmlPart xmlPart = new TCustomXmlPart(xml,null);
                _xlsFile.AddCustomXmlPart(xmlPart);
            }
            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();
            Xls.Open(fileName);

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="http://www.w3.org/2001/XMLSchema" 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,
Ghislain




Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1245
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1245
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Ghislain Benrais View Drop Down
New Member
New Member
Avatar

Joined: 06 Nov 2014
Posts: 6
Post Options Post Options   Quote Ghislain Benrais Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2017 at 4:41pm

Thanks a lot
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down