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




On Thu, 7 Mar 2013, at 00:46:47, Joep Beckeringh <joep.beckeringh@xxxxxxxxxx> wrote:

But I'm still not convinced: I don't see your point about a missing letter, what has that got to do with allow missing/allowextra? It would just be bad data; a customer ID of 'on Paris' would certainly be rejected by the check after the parsing. And a malformed numeric could cause an exception when the target field was numeric; if I had defined the field alpha, it would not pass the check either.

What I'm trying to point out is that your approach only deals with one scenario:

It deals with this: <quantity></quantity> but not with this <quantity>None</quantity> or <quantity>10CR</quantity>. So using numerics in the DS always runs the risk of the parser failing completely. That's all I'm trying to point out. If you are guaranteed that won't happen then fine.

But if I deal with quantity as alpha I can do the conversion with %Dec wrapped in a MONITOR. Not only can I then provide a default value but (perhaps more importantly) I can report easily on exactly which element was in error and what the value encountered was. Requires a bit more coding but no speed penalty because under the covers that is what RPG is doing anyway.

You're right that I'm assuming documents that will fit into memory. I admit I haven't really explored the nuances of using XML-INTO with a handler; if I needed a handler anyway, I would be inclined to use XML-SAX.

I don't understand why you would switch to -SAX for that. The logic is only marginally different to use -INTO with a handler and has the advantage that you can deal with the document in pieces if desirable. e.g. Trigger a process as each element group is processed as opposed to waiting until the end of the XML-INTO. -SAX requires a lot more work.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





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.