Re: 15Meg PDF in XML files
- From: "jrock64" <jrock64as400@xxxxxxxxx>
- Date: Sun, 16 Jul 2006 05:01:11 GMT
Sorry I got ahead of myself after trying to research the program flow..
I think I may have it figured out.
Yes I am using Scott Klements procedures to handle the base64 encode/decode
issues.
My program will navigate to the correct node and then
1. call XMLdocument_getFirstChildNode which accepts and returns a pointer
(no problem here)
2. then call XMLdocument_getNodeValue which accepts a pointer but returns a
field *like(xmlnodevalue_t) 8192A Varying
digging deeper xmldocument_getnodevalue calls two functions
2.1 QXMLDOMNode_getNodeValue accepts and returns a pointer (no
problem here)
2.2 XMLString_toJOBCCSID accepts a pointer but returns a field
*like(xmlnodevalue_t) 8192A Varying
and
2.2.1 QXMLTranscode accepts and returns a pointer (no real
documentation other than the prototype)
so the problem appears to be in the XMLString_toJOBCCSID procedure.
1 what does this do and if my XML is already in unicode and I want to write
to the IFS in JOBCCSID 37 do I really need this procedure?
2. If #1 is yes I will make the following modifications.
2.1 A new version of XMLString_toJOBCCSID will use XMLstring_length to
determine length and use %alloc to create a new pointer of adequate length.
the pointer will be passed to QXMLTranscode and be ruturned on completion.
and leave out the ""rpgString = %trimR(%str(%addr(rpgStringFixLen))); ""
line.
2.2 a new version of XMLdocument_getNodeValue will return the new pointer.
2.3 My parser program will further manipulate the pointer contents or dump
the entire contents directly to the IFS with "writeIfsFile"
then dealloc the new pointer for cleanup.
I think I just answered my own question. Will the above plan work????
should be easy to modify.
a general questions that I cannot find in your programs or IBM
documentation.
3 All your fields seem to eventually be based on pDummy where is this field
ever created or declared. Is this a reserved field within QXML4PR500
service program or the C function library the parser tool is based on??
Thanks for your time and great program.
I compare your work to CGIDEV someone who took an IBM tool or program that
was incomprehensible/unusable and repackaged it into a very easy to use and
productive application.
Joel Rose
Solutions
"Thomas Raddatz" <thomas.DOTraddatz@xxxxxxxxxxxxxxxx> wrote in message
news:427E7D1E.9020208@xxxxxxxxxxxxxxxxxxx
Joel,
Honestly I have no idea of what exactly to do with base64 encoded data. I
assume that it has to be decoded somehow prior to write it to an IFS file.
But basically since QXMLDOMNODE_getNodeValue returns a pointer to a
Unicode string I assume that there is no limit of the string size. After
having called QXMLDOMNODE_getNodeValue it should be possible to use the
Unix write() function to write that buffer to an IFS file.
I never tried that yet, but I strongly believe that it should work.
Probably Scott Klement's "Base64 Encode/Decode" service program might be
helpful:
http://www.scottklement.com/base64/
Please keep me up to date. Most likely it is a good idea to enhance the
XMLRPG service program based on your experiences.
Thomas Raddatz.
jrock64 schrieb:
I am using the XML parsing service programs by Thomas Raddatz to
"unmarshall" an XML.
No problem retrieving the various Elements and Attributes due to Tom's
excellent programs.
The base XML is about 3K in size any nodes can easily be materialized to
a 64K variable before being reassigned to a final variable.
However one element contains a base64 encoded PDF that can be over 15meg
but on average 1 to 3 meg in size.
Can QXMLDOMNODE_getNodeValue materialize a value larger than 64K
perhaps to a pointer or dirrectly to the IFS.
Any help will be most appreciated.
Plan B will be to read the raw XML file from the IFS scanning tor the
desired ELEMENT tags and diverting the content to a new IFS file.
Joel Rose
Solutions
.
- Follow-Ups:
- Re: 15Meg PDF in XML files
- From: Thomas Raddatz
- Re: 15Meg PDF in XML files
- Prev by Date: Re: GO SAVE Problem
- Next by Date: Re: 15Meg PDF in XML files
- Previous by thread: Re: QSPRILSP
- Next by thread: Re: 15Meg PDF in XML files
- Index(es):
Relevant Pages
|