Solved

unrecognized input signature using MSXML2 on an otherwise fine XML document

Posted on 2011-02-15
3
1,547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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…
Six Sigma Control Plans

627 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