From: Paul Knudsen on
On Sat, 19 Jan 2008 20:06:44 -0800 (PST), Richard
<riplin(a)azonic.co.nz> wrote:

>
>
>Paul Knudsen wrote:
>> Post on Kasamba, in case you missed it: Can sign up and respond
>> directly if interested.
>>
>> Hi, Need the link to tutorial or the book name that helps me to
>> modify/code COBOL program to convert flat file into XML format. I know
>> COBOL but don't know XML. Thanks
>
>The way that I output XML (or HTML, CSV, etc), is to use a template
>and a templating routine.
>
>The template is just a text file. It could be in sections, or it could
>use counters to repeat blocks as required. The easiest way is to have
>sections (here indicated by ':'). Options are started by '*': Tags,
>where data is substituted, are <!%tagname%>.
>
>*XML
>*CRLF
>:header
><?XML ...
><order>
> <oderheader>
> <ordernumber><!%orederno%></ordernumber>
> <customer id="<!%customer%>">
> <customer_name><!%custname%></customername>
> <delivery_address>
> <street><!%cdadd1%></street>
> ....
> </delivery_address>
> </customer>
> </orederheader>
>:oderline
> <orderline>

Chuckle...I doubt anyone who doesn't know XML will get this. But on
the off-chance, have I your permission to forward it to the requestor?
From: Paul Knudsen on
On Sun, 20 Jan 2008 08:41:22 -0600, "Michael Mattias"
<mmattias(a)talsystems.com> wrote:

>Tutorials on XML (and much much more): http://www.w3schools.com/

Thanks. I'll give this to the requester gratis.
From: Richard on
On Jan 21, 4:08 pm, Paul Knudsen <pknud...(a)NOSPAMyahoo.com> wrote:
> On Sat, 19 Jan 2008 20:06:44 -0800 (PST), Richard
>
>
>
> <rip...(a)azonic.co.nz> wrote:
>
> >Paul Knudsen wrote:
> >> Post on Kasamba, in case you missed it: Can sign up and respond
> >> directly if interested.
>
> >> Hi, Need the link to tutorial or the book name that helps me to
> >> modify/code COBOL program to convert flat file into XML format. I know
> >> COBOL but don't know XML. Thanks
>
> >The way that I output XML (or HTML, CSV, etc), is to use a template
> >and a templating routine.
>
> >The template is just a text file. It could be in sections, or it could
> >use counters to repeat blocks as required. The easiest way is to have
> >sections (here indicated by ':'). Options are started by '*': Tags,
> >where data is substituted, are <!%tagname%>.
>
> >*XML
> >*CRLF
> >:header
> ><?XML ...
> ><order>
> > <oderheader>
> > <ordernumber><!%orederno%></ordernumber>
> > <customer id="<!%customer%>">
> > <customer_name><!%custname%></customername>
> > <delivery_address>
> > <street><!%cdadd1%></street>
> > ....
> > </delivery_address>
> > </customer>
> > </orederheader>
> >:oderline
> > <orderline>
>
> Chuckle...I doubt anyone who doesn't know XML will get this. But on
> the off-chance,

The whole point about templating is that you need neither know nor
care what XML, or HTML, or CSV, or whatever is.

Get someone to make up an example of what is required in the output
file then divide that up into the sections that are the header,
trailer and the bits that repeat for each 'line'. Use different
sections if the layout varies in the repeating bits and change the
data items into tagnames.

Write the program to deal with the data and the result should match
the example. No need to even know that it is XML.

I liked one comment that I saw about XML:

"They have a problem and so decide to use XML. They then have two
problems."


> have I your permission to forward it to the requestor?

Yes, of course.