[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parser for a XML



Sender: Thomas Raddatz <thomas.raddatz@xxxxxxxxxxx>

Gregorio,

"QxmlXercesDOMParser_parse_SystemId" is not suitable for parsing XML data from memory. Use "QxmlXercesDOMParser_parse_InputSource" instead.

First you have to create an appropriate input source that you then can pass to QxmlXercesDOMParser_parse_InputSource:

Sample:

<snippet_1>
            //‚Create input source of type ...
 B02        select;

            //‚... file
            when   parser.inpSrcType = cPARSER_INPSRC_FILE;

               path    = %trimR(inpSrcFile.path) + x'00';
               pInpSrc = QxmlLocalFileInputSource_new(%addr(path):
                                                      Qxml_JOBCCSID: 0);


//‚... memory when parser.inpSrcType = cPARSER_INPSRC_MEMORY;

               pInpSrc = QxmlMemBufInputSource_new(inpSrcMem.pMemory       :
                                                   inpSrcMem.memSize       :
                                                   %addr(inpSrcMem.buffID) :
                                                   inpSrcMem.ccsid         :
                                                   inpSrcMem.buffIDLength  :
                                                   0                       );

endsl;

            QxmlXercesDOMParser_parse_InputSource(parser.pParser: pInpSrc);
</snippet_1>

Feel free to download the complete source code from http://www.tools400.de/English/Freeware/Service_Programs/XML/xml.html.

Hope this helps.

Thomas Raddatz.


Gregorio Alarcón B. schrieb:
Hi Scott, i have a basic problem with an rpgile program and xml parser.
The program must read a xml from a local variable, not from a file. We have been analyzing the "QxmlXercesDOMParser_parse_SystemId" function but this only read a XML document from a file. Do you know like doing this?


Our final objective is upload the values of xml's elements in a *FILE.

Best Regards,
Gregorio.




----------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubsribe from the list send mail to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr -----------------------------------------------------------------------