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



>1. How do I go about creating XML document/file from a database/process.
>I understand I have two options, use DOM tree to build document and
>write it to the file at the end, or use brute force to write markup
>directly into the flat/IFS file (and then maybe, validate it through
>parser, just in case). Of course, DOM method is more sophisticated and
>less error prone, but my biggest concern would be size and memory
>requirements. It is a big project, and XML is likely to have 1 000 000s
>of  records with 10s of nodes each. So can that fit into the memory
>using DOM or I'll have to write smart program to write records
>sequentially and ensure some degree of tag/document validity and
>well-formedness. Or is there some third way I have no idea about?

You are correct about those two options, but there is a third option:
you can use SAX input to an XML writer.  However, if you are planning
to produce mega-record XML files, I would suggest you should reconsider
whether you should use XML at all.  You already have observed that you
may have problems storing such a DOM in memory; anybody you send it to
is going to have similar problems.  Also, extracting any data from it
requires loading the entire file.  It's like having a database without
indexes.

>2. What would be the pros/cons for doing it in Java vs. RPG. This can
>sound as a naive question, but we are very early in the project and XML
>part might be made rather independent. Application is written in
>RPG/COBOL/SQL, but that itself is not limiting factor. General team
>skill set is on the
>RPG side, but there is a will to take this opportunity and learn.
>Besides, after checking a few samples of RPG using IBM's C++ parser, ...
>that definitely doesn't look pretty, and I'm afraid that as project
>progresses and requirements become more complex, we are going to regret
>for not starting it in Java.

Yes, I wrote one RPG program to produce XML using that parser.  Ugly is
the word.  Java-based XML parsing, on the other hand, can almost be called
a mature technology.  The Java-based parsers automatically handle things
like file encodings that RPG programmers have never even heard of.  I
would produce XML in RPG only if you planned to never ever use Java.

>3. Give me some idea about general sizing. Obviously, lots of file
>storage and FTP- ing will be involved. How much bigger XML file gets
>compared to its DB2 counterpart? In average, assuming that we aren't
>going to be over creative when it comes to tag names.

Try a small example and see for yourself.

>4. Should we develop DTDs , or take simpler route? Receiving side is out
>of our organization (and control), so DTD might be a safe bet. What is
>used for creating DTD these days? Some designing  tool ?

DTDs (and the newer thing, Schemas) are used to validate that an XML file
conforms to a predefined structure.  If you are the one generating the file,
you could decide not to bother about that, especially if your file is just
an XML-ized version of a database table.  It's not mandatory.  But if you
are generating files that are supposed to conform to an industry standard,
then the DTD will already exist.

>5. If we decide to go Java, what parser is better, IBM's or independent.

It depends.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.