× 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 Larry, yes I saw in the Redbook info that the handler automatically disregards whitespace between elements, that the concern is within the element's data. The Hex value you are using here respresents anything other than whitespace? I will have to see what our vendor will be giving us for sample data, I would think I will have to deal with this but won't be sure until we get some sample data.

Thanks for the sample code, always good to have as much knowledge as possible.

Sharon> From: larry_ducie@xxxxxxxxxxx> To: rpg400-l@xxxxxxxxxxxx> Subject: RE: XML-SAX not quite right II> Date: Fri, 14 Nov 2008 10:12:13 +0000> > > Hi Sharon,> > <snip>> Hi Adam, yes I did read those articles, they are very good on the subject. I noticed the mention of the white space processing but did not realize it's importance until now. > > I will go back to the Redbook and incorporate that code, that should get me closer.> > Thanks for your interest in my problem.> </snip>> > How you deal with whitespace is pretty-much up to what you want to do with the data in the document you are parsing: It is an implementation-specific consideration.> > For example, we have a xml templating service program*. When I am parsing the xml template I am not interested in the whitespace within the xml template itself. So I throw away anything passed which is composed of whitespace only.> > I check to see if I have been passed just whitespace with a line similar to:> > if %len(%trim(%subst(data:1:len):X'0d254005')) > 0;> // I have something other than just whitespace...> endif;> > The trick is to trim the passed data, removing carriage return, line feed, space, and tab. If there is nothing left (length of trimmed data = 0) I just throw it away.> > The second parm to %trim() is a much under-used capability. Particularly the use of HEX values to specify what you should trim.> > Cheers> > Larry Ducie> > *This allows you to build a template of your xml document and include SQL statements and all your. The service program then builds your xml doc for you from the SQL result sets and your tag definitions**.> ** It uses SQL CLI to prepare and run the SQL statements and it runs unbelievably quickly.> > > > _________________________________________________________________> Take a summer road trip with Windows Live Hotmail. Multiple prizes and the ultimate dream beach house!> http://www.ninemsn.com.au/hotmailroadtrip> -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list> To post a message email: RPG400-L@xxxxxxxxxxxx> To subscribe, unsubscribe, or change list options,> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l> or email: RPG400-L-request@xxxxxxxxxxxx> Before posting, please take a moment to review the archives> at http://archive.midrange.com/rpg400-l.>
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live
http://clk.atdmt.com/MRT/go/119462413/direct/01/

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.