Thanks for the quick response. I’ll try to fashion a small case to reproduce.
I've produced a simple test that tries to reproduce this, and it works correctly for me. So we need to reproduce the circumstances under which the failure occurs. Could you please try to put together a little application that demonstrates the problem? It will also be necessary to know exactly what software versions you are using.
There don't seem to be any known bugs in this area. However, most of my testing (including the test mentioned above) has been with XmlDocument instances generated directly by parsing source XML documents. Experience with the Java product suggests that most of the problems with wrapping a DOM come when the DOM is constructed programmatically. There are many different ways of building a DOM, including many ways of creating structures that will never be produced directly by the XML parser.
From: Bill Cohagan [mailto:email@example.com]
Sent: 09 October 2009 19:15
To: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: [saxon] Wrap() method is not preserving default namespace spec?
I’m running saxonb9-1-0-5n and having problems converting a System.Xml.XmlDocument -> XdmNode via the DocumentBuilder.Wrap method. The code in question is:
XdmNode inputXML = processor.NewDocumentBuilder().Wrap(input);
Examining the “input” (XmlDocument) shows an XML doc with the following top level element:
<PRRRevisionRequest DatePosted="2/4/2008 12:00:00 AM" Number="754" Title="Resource Settlement Due To Forced Transmission Outage" IsDirty="false" IsNew="false" Tombstone="false" xmlns="gptg:PMSA:gptg.net">
Examining the inputXML XdmNode after the call to Wrap shows an XdmNode with the following top level element:
<PRRRevisionRequest DatePosted="2/4/2008 12:00:00 AM" Number="754"
Title="Resource Settlement Due To Forced Transmission Outage"
So, the question is, WHAT THE HECK HAPPENED TO THE DEFAULT NAMESPACE SPEC? Obviously this is causing problems in the subsequent XSL transform processing…