Solved

unrecognized input signature using MSXML2 on an otherwise fine XML document

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL FO - text wrapping and empty spaces 1 31
Issue with XSLT mapping 10 35
Eliminate additional border 1 17
XSLT Display Label Name 1 22
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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

7 Experts available now in Live!

Get 1:1 Help Now