David

I believe that you are not processing any of this in RPG, is that correct?

Someone suggested having a schema for your XML - that seems an important step for you, since it will help ensure that your XML document is valid. Both of your samples tested valid, according to one post, so you have a choice of which to use. I believe a schema can be written for either one.

I know nothing about XSL-FO - just looked it up and found information and tutorial at w3schools.com - if you have not gone to that site, it is fantastic. Highly recommended.

I guess I would write XML that is valid - period. Well, you HAVE to, right? Don't get sidetracked by some need to process it in RPG. Having said that, the <children> container is useful, especially for human readability and possibly for XSL.

Now as to an example from IBM - IBM has an API (QCDRCMDD) for extracting command definition into XML - /qibm/xml/DTD/QcdCLCmd.dtd has the DTD for the output XML - no schema. This is what resulted from running that API over a command call GENDDL that I got from IT Jungle - I've deleted part of it for brevity. You will see that there is no <parms> collection but there are collections for <Values> and <SpcVal>. The indented "structure" is mine (your email client might also break it up more than I did) - IBM outputs the XML in one long stream, as I recall - the output can be either an IFS file or a variable, so it is not necessarily helpful for it to be "well-structured", in my opinion.

<?xml version="1.0"?>
<!DOCTYPE QcdCLCmd >
<QcdCLCmd DTDVersion="1.0">
<Cmd CmdName="GENDDL" CmdLib="__LIBL" CCSID="37" Prompt="Generate SQL DDL" MaxPos="99" MsgF="QCPFMSG" MsgFLib="__LIBL" ExecBatch="YES" ChgCmdExit="NO" RtvCmdExit="NO">
<Parm Kwd="OBJECT" PosNbr="1" KeyParm="NO" Type="CHAR" Min="1" Max="1" Prompt="Object name" Len="258" Rstd="NO" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="Character value"/>
<Parm Kwd="OBJECTTYPE" PosNbr="3" KeyParm="NO" Type="CHAR" Min="1" Max="1" Prompt="Object type" Len="10" Rstd="YES" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="TABLE, VIEW, ALIAS...">
<Values>
<Value Val="TABLE"/>
<Value Val="VIEW"/>
</Values>
</Parm>
<Parm Kwd="SRCLIB" PosNbr="5" KeyParm="NO" Type="NAME" Min="1" Max="1" Prompt="Source library" Len="10" Rstd="NO" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="Name, *CURLIB, *LIBL">
<SpcVal>
<Value Val="*CURLIB" MapTo="*CURLIB"/>
<Value Val="*LIBL" MapTo="*LIBL"/>
</SpcVal>
</Parm>
<Parm Kwd="CRTSRC" PosNbr="7" KeyParm="NO" Type="CHAR" Min="0" Max="1" Prompt="Create file and/or member?" Len="4" Rstd="YES" Dft="*NO" AlwUnprt="YES" AlwVar="YES" Expr="YES" Full="NO" DspInput="YES" Choice="*YES, *NO">
<SpcVal>
<Value Val="*YES" MapTo="1"/>
<Value Val="*NO" MapTo="0"/>
</SpcVal>
<Values>
<Value Val="*YES"/>
<Value Val="*NO"/>
</Values>
</Parm>
</Cmd>
</QcdCLCmd>

There was an article with an XLST file for this XML - http://www.itjungle.com/mgo/mgo100803-story01.html

HTH
Vern

David FOXWELL wrote:
Hi all,

Vern, am I relieved to read that YOU are confused!
Posted last night before leaving the office. Just arrived to find a rather long thread has developped. Sorry to say that I'm none the wiser, even I could see that the example with the <children> element was more human readable.

I'm going to be processing this XML with XSL-FO. As I'm new to that language as well and I haven't used it for a while, maybe I should think about how I'm going to write my XSL.

But, here's a question : should I be writing the XML so that it is easily read by XSL? Like I'd do in a simple chain of RPG programs : extraction by the first into a workfile, then read the workfile that is structured so that the 2nd RPG can do the report with the cycle and no C specs. Should I have to think about the technology used to process the XML?



-----Message d'origine-----
De : web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] De la part de Vern Hamberg
Envoyé : mercredi 10 mars 2010 00:35
À : Web Enabling the AS400 / iSeries
Objet : Re: [WEB400] Basic question on XML structure

Well, he DID say it was not well-structured - did he mean it is not well-formed? Am I mistaken there? I had no problem understanding David's "structure", even though indentation and white-space would have clarified it. It is obvious to me that <name> and <child> were siblings
- human readability is nice but not required for well-formed XML, as far as I know.

Still confused!
Vern

Neill Harper wrote:
Yeah sorry might be a little bit of confusion here.

I was questioning "You express the XML snippits wrong"

I can see now that what you were getting at is that for the
purposes
of readability (by a human) siblings should have the same
indentation level.
And you were not suggesting that the OP's original post would not parse or was not valid XML.

Cheers

Neill

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx
[mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of hr@xxxxxxxxxxxx
Sent: 09 March 2010 21:13
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Basic question on XML structure

I wrote my example with idents like you walk trough the memory structure in a hirachical data structure making who is who in a parent/child/sibling understandable

<client>
<name>
<child>

isn't true "child and name" are siblings and "name" is not
the parent
of "child", "client" are, and therefore they should be
expressed like this:
<client>
<name>
<child>






Jeff Crosby <jlcrosby@xxxxxxxxxxxxxxxx> Sent by: web400-bounces@xxxxxxxxxxxx 09-03-2010 21:36 Please respond to Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx> cc

Subject
Re: [WEB400] Basic question on XML structure






Yes, I saw it right away. I also saw it in the original
poster's example.
But it has nothing to do with my question.

Along with Neill I am asking what is different between
yours and the
original posters?


On Tue, Mar 9, 2010 at 3:34 PM, <hr@xxxxxxxxxxxx> wrote:

Can't you see where the array is and isn't in this structure:

Lets make is visiual:

<client>
<name>bill</name>
<children>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
<child>
<name>alex</name>
</child>
<child>
<name>peter</name>
</child>
</children>
<address>My home street</address>
</client>

<client>
<name>bill</name>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
<address>My home street</address>
<child>
<name>alex</name>
</child>
<child>
<name>peter</name>
</child>
</client>





Jeff Crosby <jlcrosby@xxxxxxxxxxxxxxxx> Sent by: web400-bounces@xxxxxxxxxxxx 09-03-2010 20:54 Please respond to Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx> cc

Subject
Re: [WEB400] Basic question on XML structure






I don't see it. I need another clue.

Or else save us all time and just tell us.


On Tue, Mar 9, 2010 at 2:52 PM, <hr@xxxxxxxxxxxx> wrote:

You should look at my second example, it explains it all




"Neill Harper" <neill.harper@xxxxxxxx> Sent by: web400-bounces@xxxxxxxxxxxx 09-03-2010 20:17 Please
respond to Web
Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"'Web Enabling the AS400 / iSeries'" <web400@xxxxxxxxxxxx> cc

Subject
Re: [WEB400] Basic question on XML structure






I can't spot the difference between your snippet and the
OP's apart
from
the
whitespace, which will of course be ignored by a
standards compliant
parser anyway.

Did I miss something else?

Neill

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On
Behalf Of hr@xxxxxxxxxxxx
Sent: 09 March 2010 18:55
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Basic question on XML structure

You express the XML snippits wrong, it should be

<client>
<name>bill</name>
<children>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
</children>
</client>

<client>
<name>bill</name>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
</client>

The first structure is weel structured, the second isn't.







David FOXWELL <David.FOXWELL@xxxxxxxxx> Sent by: web400-bounces@xxxxxxxxxxxx 09-03-2010 18:12 Please
respond to Web
Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx> cc

Subject
[WEB400] Basic question on XML structure






Hi all,

A little inexperienced in xml here.

Compare these 2 structures :

<client>
<name>bill</name>
<children>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
</children>
</client>

<client>
<name>bill</name>
<child>
<name>jon</name>
</child>
<child>
<name>joe</name>
</child>
</client>

Are there any advantages or disadvantages to using or not
using the
element <children>?

We do not use attributes.


Thanks.

--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list
To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list
To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list
To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list
To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com

The opinions expressed are my own and not necessarily the
opinion of
my company. Unless I say so.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe,
unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe,
unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.