Solved

unrecognized input signature using MSXML2 on an otherwise fine XML document

Posted on 2011-02-15
3
1,470 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

920 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

16 Experts available now in Live!

Get 1:1 Help Now