?
Solved

unrecognized input signature using MSXML2 on an otherwise fine XML document

Posted on 2011-02-15
3
Medium Priority
?
1,563 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 2000 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

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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

718 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