× 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.


  • Subject: RE: RPG to XML - XML - RPG +/-
  • From: "Alistair Rooney" <alistairr@xxxxxxxxxx>
  • Date: Mon, 14 Aug 2000 12:52:40 +0200
  • Importance: Normal

Cool! The first guy to write an RPG Parser, please let me know and we can
talk. Nudge nudge, wink wink, say no more!

Alistair

-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On
Behalf Of paul cunnane
Sent: 14 August 2000 11:03
To: RPG400-L@midrange.com
Subject: Re: RPG to XML - XML - RPG +/-


> 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
+---

+---
| 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 thread ...


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.