× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



hi Sharon,

RPG doesn't currently provide a way to write XML, but frankly, it's trivial to write it yourself, or to use CGIDEV2 to write it. This is very different from parsing it, which would be prohibitively difficult to do yourself.

I don't like the idea of IBM adding a tool to build XML from a DS because data structures simply lack enough information to be used to generate the structure of an XML document.

A trivial example:

D customer ds
D custno 10a inz('1234')
D name 20a inz('Scott Klement')

Should this be rendered as:

<customer custno="1234" name="Scott Klement" />

Or should it be:

<customer custno="1234">
<name>Scott Klement</name>
</customer>

Or should it be:

<customer>
<custno>1234</custno>
<name>Scott Klement</name>
</customer>

Should trailing blanks be stripped or not stripped from the values? What encoding should the data be stored in? Should it have to insert "CDATA" tags anywhere to protect the internal contents? Should it base64 encode data? There's just a lot of information that isn't available in a DS that would be needed

I could continue...

I guess in the end, it's just not that difficult to do this:

xml = '<customer>' +
'<custno>'+ %trim(custno) +'</custno>+
'<name>'+ %trim(name) +'</name>'
'</customer>';

It's easy enough to do that I don't find myself wanting an easier alternative. Though if I did, CGIDEV2 provides a really easy way to do it as well.


On 2/3/2010 2:25 PM, Wintermute, Sharon wrote:
I need some direction. I have used the xml-into to parse xml documents
all the time and I know how to get it to work. Now I have to create and
xml document to send out. I need to create the document in the IFS so I
can use MQ to send it out.



I like the data structure approach of xml-into, is there something
similar for creating xml?



FYI: It needs to be an RPG routine so that others can support it.



TIA,





Sharon Wintermute





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.