PDA

View Full Version : XML Output Coming to RPG IV



matt.haas@thomson.com
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
Bob, I've run into other characters that also need to be escaped. We've had problems with the pipe character in our feeds. The pipe character is x'6A' and it needs to be replaced with ¦. Matt

Guest.Visitor
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
With V5R5 rumored to be released in 2008, that sounds like one heck of a long time between releases if we consider that two years is a lifetime in todays software world.

H.Boldt
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
Bob: I have a couple of comments on the procedure escapeXML: First, as you know, passing character strings by VALUE is an expensive operation. Passing strings by reference is a lot faster. Second, there seems to be no protection against overflowing the output parameter. Potentially, the output could be 6 times longer than the input. Perhaps you should pass in the length of the output parm and test to make sure the output never exceeds that length? (Optional parameter nOutLen seems to be left unused.) Third, what's the purpose of those integer variables bP1, bP2, and bP3? And why is szXMLOut a *OMIT *NOPASS parameter? Oh yeah, one more thing? Why use Hungarian notation (http://en.wikipedia.org/wiki/Hungarian_notation) in the naming of your variables? Are szXMLIn and szXMLOut really zero-terminated strings? Cheers! Hans

R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
Hans, Yes, I know that. The original version of EscapeXML modified the input parameter (used it as the work field) and then returned it. The updated version passed in a second parm along with the 3rd parm (its length). I never changed the first parm from VALUE to CONST. In my other code (in xTools and iSockets) I do have overflow protection. I suppose it was omitted, again due to the nature of the modification I made to remove the lengthy return value. As for hungarian notation, since I mostly program in C++, I tend to habbitually type character values with szXXXX prefixes. But there's not necessary. At least I don't use those @ # $ symbols I see so often! :) Here's a revised version of the routine. What do you think? <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b37e0d1/2')

R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
Not sure what this means. But you can add anything you want to the code. Just add something like: <pre> When %subst(xmlin:i:1) = X'6A' eval Symb = '|' </pre>

MCWebsite.Staff
12-31-1969, 06:33 PM
** This thread discusses the article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402) **
** This thread discusses the Content article: XML Output Coming to RPG IV (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=1402)0