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

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.