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



Well, what I loose with ONLY using XML-INTO is the flexibility to add
parameters <tags> to my XML, and using the values.
Meaning, if I wanted to add a new parameter<tag> to my XML, then I would
have to add new RPG code to handle the new parameter,
Whether it's adding a new DS variable, and/or adding a new XML-INTO
statement for the new parm<tag>.

The way I have it defined allows me to never worry about changing the RPG.
The existing code will know how to handle
all params<tags> passed in and react on it.

My main purpose was to try and remove as much hard-coded code as possible
and allow the program to flow
and have as little changes as possible.

David




David L. Mosley, Jr.
Technical Solutions Architect
Dancik International, Ltd.
2000 CentreGreen Way, Suite 250
Cary, NC 27513

www.dancik.com



Barbara Morris <bmorris@xxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
12/29/2009 05:30 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Subject
Re: XML-SAX Event-Handler loop.






dmosley@xxxxxxxxxx wrote:
...
So, what I did instead was for every "*XML_START_ELEMENT" event, I would

take the <tag> name
and execute an XML-INTO to get the tag's value.

So, in that sense, avoiding all other events, just made sense.

It's doing what I want it to do, I was just hoping to make it a bit more

efficient.


David, it's not going to be at all efficient if you are using XML-INTO
to reparse the XML document every time your XML-SAX finds a new element.
Rather than having the one XML-SAX loop, you have your XML-SAX loop
plus a number of hidden XML-INTO loops.

XML-INTO has to parse the XML document starting at the beginning to find
the bit that it's interested in. XML-INTO does stop when it has found
what it's looking for but on average you will be parsing half the
document for each XML-INTO that looks for the value of a specific tag.

I have to repeat Scott's question: Why not just use XML-INTO for the
entire XML document? Then you will only parse the XML document once and
when XML-INTO is done, you will have all the information you need.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.