Jon
Many thanks for taking the time out. I did not now that RPG's XML
support could handle attributes.
message: 6
date: Mon, 16 Feb 2009 10:34:49 -0500
from: Jon Paris <Jon.Paris@xxxxxxxxxxxxxx>
subject: Re: Creating XML data for posting
On 16-Feb-09, at 4:18 AM, rpg400-l-request@xxxxxxxxxxxx wrote:
Not being an XML expert I was curious to know what you mean by :-
For example you can only create elements - not attributes. SO the
vast majority of XML generated will require a transform to be useful.
The vast majority of XML documents will include things like this:
<Customers>
<Customer category='Retail' number='J01234'>
<Name>Jones and Co.</Name>
<Address type='mailing'>
<Street> .......
"category", "number" and "type" are attributes. "Customer" and "Name"
are both elements. The COBOL support can only generate elements -
there is no way to tell it that a data name represents an attribute.
From a hierarchical perspective, an attribute is at the same level as a
child element of the element to which it belongs. In other words
"category" is at the same hierarchical level as "Name" or "Address" -
and when processed by RPG's XML-INTO would be treated that way.
This is not even to mention things like namespaces and other joys.
We have used the COBOL technique to generate simple XML structures to
facilitate our testing of RPG programmes parsing XML document and for
this it has been an help.
It sounds as if your RPG is consuming in-house developed schemas - not
industry standard ones that you have received form the outside world.
If this is the case the COBOL stuff will work for you but it is only
these simple cases that it will work for.
My comment related to the fact that using tools like CGIDEV2 (or indeed
any templating system) is so easy to do and so flexible that I would
hate to see the RPG team waste scarce resources to implement something
with such limited capability.
Jon Paris
As an Amazon Associate we earn from qualifying purchases.