OmeLuuk
22nd December 2015, 18:11
Given the file<?xml version="1.0"?>
<Orders xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Order>
<Orno mlns="http://some.one.link.ed/this.1.0.xsd">1990</Orno>
<DateTimeOrdered
xmlns="http://some.one.link.ed/this.1.0.xsd">1990-01-01T10:10:59</DateTimeOrdered>
<DateTimeProcessed
xmlns="http://some.one.link.ed/this.1.0.xsd">1990-01-01T11:10:58</DateTimeProcessed>
<Paid xmlns="http://some.one.link.ed/this.1.0.xsd">true</Paid>
<Customer
xmlns="http://some.one.link.ed/this.1.0.xsd">
<ShipTo>
<Titl>02</Titl>
<Nama>I.</Nama>
<Namb>Wanna-Buy</Namb>
<Namc>Work Street</Namc>
<HoNo>1</HoNo>
<PoCo>2F5 200</PoCo>
<Town>KANDRAPOLIS</Town>
<Nation>GO</Nation>
<Contact>I.Wanna-Buy@to-sell.now</Contact>
<...?...>
</ShipTo>
<InvoiceTo>
<Titl>02</Titl>
<Nama>I.</Nama>
<Namb>Wanna-Buy</Namb>
<Namc>Cash Flow</Namc>
<HoNo>56 High</HoNo>
<PoCo>9G3 201</PoCo>
<Town>KANDRAPOLIS</Town>
<Nation>GO</Nation>
<Contact>I.Wanna-Buy@to-sell.now</Contact>
<...?...>
</InvoiceTo>
</Customer>
<Items xmlns="http://some.one.link.ed/this.1.0.xsd">
<Article>
<OrderItemId>1990-1</OrderItemId>
<UPC-A>011100000111</UPC-A>
<OwnCode>1990-0</OwnCode>
<Name>B4 A11 F0CA1.. .ED 2 F0015</Name>
<UOM>box</UOM>
<Count>1</Count>
<Price>19.90</Price>
<Descriptive>Before all focal points pointed to fools</Descriptive>
<...?...>
</Article>
</Items>
...n
</Order>
...m
</Orders>I suppose it should be possible to strip this XML file based on the file definition in the http://some.one.link.ed/this.1.0.xsd in which the used elements (and possibly even more <...?...>) are defined. It will not be possible to program it dynamically but all elements used should be able to be assigned to internal variables per block.
As you can tell from ...x several sections can be redundant.

When however http://some.one.link.ed/this.1.0.xsd is not used as an URL to the definition but as a URN (Universal Resource Name) one cannot be sure about what to expect in the XML file.

Q If the http://some.one.link.ed/this.1.0.xsd points to a URL (actual accessible file with the XML definition) I would expect the XML file could also be more or less be validated against the definition. Is that so?

But when I search the baanboard forum for the functions mentioned in the XML Object Synopsis (namespace support) section in the programmers manual (see file attached for a list of functions mentioned) I get no hits. (Nor will Google help me).

So who could explain the added value of the NS for parsing a file like I have to process? Which functions are to be used to walk the XML tree (redundant) to read all orders and all order lines until all of the data is processed?

OmeLuuk
23rd December 2015, 12:47
But when I search the baanboard forum for the functions mentioned in the XML Object Synopsis (namespace support) section in the programmers manual (see file attached for a list of functions mentioned) I get no hits. (Nor will Google help me).

Is there anyone who used any or some of the NameSpace Supported XML functions from the attachment in the previous post?

mark_h
24th December 2015, 18:49
You might have to wait longer - not everybody visits the forum on a daily basis. I have never used any xml functionality at all.

bhushanchanda
26th December 2015, 16:55
Hi,

Are you looking for a Baan/LN Tools based parser which will read and process your XML? If yes, you need to build it and yes, it will handle your XML. You just need to put the necessary functions in a proper sequence.

For a start, you can follow this thread (http://www.baanboard.com/baanboard/showthread.php?t=67526)

OmeLuuk
30th December 2015, 17:51
Then when debugging I run into an error. The logfile tells me:
F:0008727:::(00001):open(D:/Infor/bse/lib/textinf/EV_LIB02,"rt "), fd -1 errno 2
F:0008728:::(00001):_explode_fname: context 'sopen' (${BSE}/lib/textinf/EV_LIB02)
F:0008729:::(00001):sopen(D:/Infor/bse/lib/textinf/EV_LIB02, "rt ") 0x0000000000000000
and the bshell dies instantly

Does anyone here know how to get the EV_LIB02 file?
And also why the bshell tries to open a file which it could not find?
I dropped the same question at Infor Support.

@Bhushan, I saw the thread you refered, but there (and I have done that before too, to a great extend) plain XML files (not the NameSpace ones) are done.

I can read the tags using the normal functions (no NS) but I think it should also be possible to do it with the NS, but I find little info on that.

OmeLuuk
12th January 2016, 15:29
Infor Support is still working on this issue... on reproduction their Bshell also crashes but with a different error...

As for XML parsing into objects: Baan / LN has a XML parser / generator built in to serialize XML files into and from an XML object. I'd rather use the standard functioality. As of now it looks as if the xmlURI$() function is limited to specific applications (like soap) and not generic enough to handle xmlns="" name space tags.