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?
<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?