Solved

unrecognized input signature using MSXML2 on an otherwise fine XML document

Posted on 2011-02-15
3
1,452 Views
Last Modified: 2012-05-11
Hi there,

I am using ActiveState Perl and Win32::OLE->new('Msxml2.DOMDocument.6.0') along with an xml file. I want to read the contents into an object, which normally works fine, but for some xml files I get 'unrecognized input signature'. Yet these files work fine with say Altova XmlSpy.

Some browsing on the web leads me to assume that the message hints that not all characters in the file are utf-8. And I assume that MSXML2 is more sensative to this than for instance XmlSpy.

Can anyone confirm my assumptions? And of course: can anyone suggest how to handle these xml files, so that I can read them properly into MSXML2? Or maybe: how can I detect the characters that cause the issue?
0
Comment
Question by:Amkick
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 34895518
You can safely assume that you can not trust XML Spy, that I can confirm.

There are some things you should check however:
- is there any white-space preceding the root element or the xml-declaration? This is not allowed, but xml-spy ignores this
- is the encoding really UTF-8, or is another encoding listed in the xml-declaration. You might be using an encoding that is supported by Spy but not by msxml (though I am not aware there is such an encoding)

It could be wise to download a trial oxygen IDE (www.oxygenxml.com) and check the files against a different parser
That would be the way to figure out what is going one exactly

good luck
0
 
LVL 2

Author Closing Comment

by:Amkick
ID: 34895630
It turned out to be some coding that went bad and produced whitespace before the <?xml declaration. Simple, but so hard to find if you don't know where to look. Thanks for the advice. It is great to know what 'unrecognized input signature' actually means.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34895778
welcome
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now