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



Hi Aaron,

I've _just_ started working with XML4PR myself.   I'm assume you have the
demo code that came with the library.  Look at the MEMPARSE example which
uses this function.  The memory buffer functions are used to pass raw XML
data into the parser.  Alternately, you could use the StdIn or LocalFile
functions to load XML data.

The first 2 parms are simply the XML data buffer (pointer and size in
bytes).  The buffer id is a handle name for this piece of memory. The
documentation says "a fake system Id", but it's used by the parser for error
references and I assume, external entity resolution.  The MEMPARSE example
calls it "prodinfo".  The string indicator and length relate to the buffer
id and not the XML data.   As with most string parameters to the parser,
they can be in various character encodings.   In this case, the StringInd
should be Qxml_CCSID37.  The length can be 0 (if null terminted) or the
actual length of the BufferId string.

Adopt buffer is a true or false (1 or 0) flag.   Apparently it relates to
whether the parser will make an internal copy of the buffer or not.
MEMPARSE uses false (0). Adopt=false means the buffer should not be freed
till you terminate the parser instance.


Keith


----- Original Message -----
From: "Bartell, Aaron L. (TC)" <ALBartell@xxxxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, March 12, 2003 1:31 PM
Subject: XML4PR400 API, QxmlMemBufInputSource_new, parameter help


> This is a question for anybody that is using the RPG Interface for XML
> parsing.
>
> I am trying to figure out what all of the parms are supposed to be doing
in
> the QxmlMemBufInputSource_new API.  Here is an example and my theory on
what
> each parm is.
>
> QxmlMemBufInputSource_new(a:b:c:d:e:f);
>
> a = Pointer to variable that has XML string.
> b = Length of string in XML variable.
> c = ??? I can't figure this one out. What is a String Indicator?
> d = CCSID, I use Qxml_CCSID37.
> e = String Length - why does it need this when I specified it on parm b?
> f = ADOPTBUF?  What is ADOPTBUF?
>
>
> Here is the prototype provided by IBM.
>       *
>
>       *  Create a new MemBufInputSource object
>
>       *  return              - pointer to MemBufInputSource
>
>       * corresponding XML C++ function - new MemBufInputSource()
>
>       *
>
>      D QxmlMemBufInputSource_new...
>
>      D                 PR              *
> EXTPROC('QxmlMemBufInputSource_new')
>      D*                                    MemBufFileInputSource
>
>      D  MEMBUF                         *   VALUE
>
>      D  MEMBUFLEN                    10I 0 VALUE
>
>      D  BUFID                          *   VALUE
>
>      D  STRINGIND                    10I 0 VALUE
>
>      D*                                    String indicator
>
>      D  STRLENGTH                    10I 0 VALUE
>
>      D*                                    String length or 0 if null-term
>
>      D  ADOPTBUF                     10I 0 VALUE
>
> Thanks for any assistance,
> Aaron Bartell
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>


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.