Quantcast
Channel: NAV/Navision Classic Client — mibuso.com
Viewing all articles
Browse latest Browse all 2239

Version 5 XML load using XML v6.0 DOMDocument for XML file with schema

$
0
0
Client is running version 5.0.33335

Apologies if this is an answered question, I'm not having a lot of luck trying to search for answers on this one.

In the past I've found and used code to read in XML documents for ancient NAV using the 'Microsoft XML, v6.0'.DOMDocument60 control without issue. I'm not actually particularly proficient with this as most of our clients use later versions of NAV that allow me to use XML ports, but for this particular client upgrading is unfortunately not likely to happen in the forseeable future.

So my past code would simply use the XMLDoc.load command and then parse through the child nodes in a fairly straightforward way. Now, however the customer wants to receive XML documents that have a schema. Specifically <ORDER version="2.1" type="standard" xmlns="http://www.opentrans.org/XMLSchema/2.1&quot; xmlns:bmecat="http://www.bmecat.org/bmecat/2005">. When I use the load command it returns false every time. As an experiment, I stripped out the schema specific stuff from a sample of it and the load proceeded just fine and my child nodes were where I expected them.

I could, in theory, write a routine to strip out the schema stuff before proceeding on to my processing however if possible I'd like to avoid that. Is there a way that I'm missing?

Past code was essentially this:
IF ISCLEAR(XmlDoc) THEN
  CREATE(XmlDoc);

XmlDoc.async(FALSE);
okay := XmlDoc.load(Param.FileName);
IF NOT okay THEN
  ERROR('That did not work');  // log an error

CLEAR(EDIOrderHeader);
InitNewOrder(EDIOrderHeader);
XmlNodeList := XmlDoc.childNodes;
FOR i := 0 TO XmlNodeList.length - 1 DO BEGIN
  XmlNode := XmlNodeList.item(i);
  ReadChildNodes(XmlNode,EDIOrderHeader);
END;

Viewing all articles
Browse latest Browse all 2239

Trending Articles