Crox,
I've written a Cobol prog that takes a long string of XML from a website and parses it. This allowed me to identify the XML fields passed and then obtain the values for those xml fields and assign them to corresponding Cobol variables.
I don't think this is what you're after, but let me know if it is of interest. Platform for this was a z/OS mainframe and the Cobol version was a reasonably up to date mainframe one - sorry can't give much more info as not at my desk.
I don't know how complex the XML document is that you wish to consume or create. If the document has much complexity at all, it may be preferable to use an XSLT translating stylesheet to handle the complexity, rather than try to create a COBOL record structure that mimics the document described by the XSD.
Obviously, I can be more helpful if I know the compiler you are using, and the operating system platform (which will help me advise on XML tooling).
Marc, if you like to share your program with us, perhaps you can show it? I am interested in your approach. In my case i want to create xml, but i have an example of the xml file that has to be created so analysing it, can be helpful.
k5tm: it is on the mainframe but i want to do some conversions on the pc to compare things...
Somebody tipped me that there is a free xml notepad to download. I saw the output on his pc, looks nice.
A long time ago, i wrote the dbfcob program to create a working-storage field from a dbase header and makes a sequential file. I would like to have a tool to create sequential files from xml input with a working storage description and the other way around, so a COBOL copybook and a file as input and xml as output...
@Crox, AFAIR there are tools that can do that readily available, but I've not seen free ones.
We have a framework/runtime combo that runs Cobol and Java side by side with full context passing, and I always advise our developers to not even consider Cobol for reading/writing xml, but use Java, as it's close to free for implementation, and waaaay easier. (though they sometimes choose to ignore that advise and spend 3 weeks on what could have been done in 2 days :-( )
If you can't use that complement, then you're out of luck I guess.
Anyone that consumes even 2 days may very well need to consider a different approach. Take one of the days and learn XSLT, then take an hour using XSLT and the absolutely most simple XML you can imagine to create any XML document you want. On the consumption side, you can use XSLT to convert an XML document to a sequential text file, if that is easier. As with most any job, using the right tools makes a difference.
(Of course, on a PC, I can recommend other things... )
Crox, Notepad++ has a very decent XML add-in. It is free. However, you can purchase Stylus Studio 'for personal use' very inexpensively; highly recommended.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.