|
> To create a XML document, I'd just open a stream file in the IFS and write
> the <BLAH> </BLAH> stuff in, in between the actual field data read from
> the AS/400 file.
Yup, that's quite easy. In fact, it might be worthwhile to write a service
program (has anyone noticed that I'm a service program junkie??) with a
routine to wrap data in tags:
eval xmlData = makeTag('data' : 'BLAH')
would return
<BLAH>data</BLAH>
This would be easy to properly nest, etc. Of course, if you need tag
attributes, it gets a wee bit more complicated. You could have a routine
like:
eval xmlData = addAttr(xmlData : 'type' : 'natter')
giving
<BLAH type="natter">data</BLAH>
and so on.
> To parse, you'd probably want to use some kind of finite state machine.
> Probably make a library of utilities for doing this, then throw them into
> a service program.
>
> Of course, if you wanted your program to be able to handle this for an
> arbitrary file, and parse an arbitrary XML format, it'd be a lot more work
> But, again, possible...
I think I'd bite the bullet and rope in Java for that task -- why re-invent
the wheel? There are excellent Java classes to handle arbitrary XML
documents and DTDs.
--
Paul
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.