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



You can't really do this with a parameter at V5R4, because %XML will not read it's input from a pointer, it requires a character string, and it determines the length of the data from that character string

You could do it with a user space in QTEMP, though. %XML will work with a user space if you use doc=file and provide the user space name in IFS notation:
/qsys.lib/qtemp.lib/myspace.usrspc

One gotcha: It's important to use an "initial value" for the user space that equates to blanks in the CCSID of the data you're parsing. So if your XML document is EBCDIC, use x'40' as the initial value for bytes in the user space. If your XML document is ASCII or UTF-8, use x'20' as the initial value.

The other alternative (as you already know) is to write it to an IFS stream file and parse it from there. That eliminates the initial value issue of user spaces, and also gives you more control over CCSID translation. But, it might not be desirable to write to the IFS if the data is confidential -- when confidential data is being used, QTEMP might be safer.

If you want to discuss this further, the RPG400-L mailing list is probably a better place.


Eftimios Pantzopoulos wrote:
_______________________________________________________________________________________

Note: This e-mail is subject to the disclaimer contained at the bottom of this message.
_______________________________________________________________________________________


I've been developing some MQ/XML solutions have finally solved the problem of large XML messages by using ALLOC to allocate 2 meg and passing the associated pointer the mqget. This works fine and I'm really pleased at how easy it was.

The current application generates the message to an ifs file and another program runs the XML-INTO with the %XML referencing the file.

I want to avoid the reliance on the ifs file and to be able to use the XML as it exists in memory.

I thought I could just pass a pointer from the program which gets the message through a controlling CL and into the RPG which parses the XML. I've been able to do this via the CL *PTR type but I can't seem to use the pointer as the %XML reference. I also pass the length of the message returned by MQ. I'm testing a message which has a length of 161,000 bytes.

The manual states:

The first operand specifies the document to be parsed. It can be a constant or variable character or UCS-2 expression containing either an XML document or the name of a file containing an XML document.

Since I can't declare a character field to be greater than 65535 (v5r4) field, how do I get this to work? I've tried declaring a based field, but that also requires a length declaration.

Any advice is warmly appreciated.




_______________________________________________________________________________________

The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited.

If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender.

This message has been scanned for viruses with Symantec Scan Engine and cleared by MailMarshal.
_______________________________________________________________________________________


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.