Well I'm having this weird problem (at least from a logical perspective).
I have the following XML which I have saved as "C:\MyResponse.xml":
Code:<PensioenaangifteResponse Versie="2010.1.0" xmlns="http://www.pensioenaangifte.nl/schemas/PensioenaangifteResponse/2010/1/0"> <BerichtId>MyBerichtId</BerichtId> <BerichtType>Bevestiging</BerichtType> <Identificatie> <UwKenmerk>MyUwKenmerk</UwKenmerk> <OnsKenmerk>MyOnsKenmerk</OnsKenmerk> <DatumTijdOntvangst>2011-01-19T10:31:06</DatumTijdOntvangst> </Identificatie> </PensioenaangifteResponse>
Now I read it back using the following code (for testing purposes, see further down):
the file get's read but nod is Nothing after the doc60.selectSingleNode, so it can't find the node PensioenaangifteResponse.Code:Dim doc60 As DOMDocument60 Dim nod As IXMLDOMNode Set doc60 = New DOMDocument60 If doc60.Load("C:\MyResponse.xml") Then Set nod = doc60.selectSingleNode("PensioenaangifteResponse") End If
Now I have the following code:
the file get's read and nod is loaded after the doc.selectSingleNode, so it has found the node PensioenaangifteResponse.Code:Dim doc As DOMDocument Dim nod As IXMLDOMNode Set doc = New DOMDocument If doc.Load("C:\MyResponse.xml") Then Set nod = doc.selectSingleNode("PensioenaangifteResponse") End If
What the hell is going on? DOMDocument60 for some reason can't find the node, but using DOMDocument the node is found..
This is all a test (with loading the xml from a file), as the original is not a file but a response returned by XMLHTTP60.responseXML which is a DOMDocument60 (a SoapEnvelop with the XML as a part of it)..
My original code just uses the node directly from the SoapEnvelope node, which first used to work perfectly up until the server started to send the namespace in this XML part as a default namespace xmlns="http://www.pensioenaangifte.nl/schemas/PensioenaangifteResponse/2010/1/0" instead of the previous namespace xmlns:ns1="http://www.pensioenaangifte.nl/schemas/PensioenaangifteResponse/2010/1/0".




Reply With Quote