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

Re: R: Reading XML with &Amp; as part of string

   Hi Scott
   No I am not using the HTTPAPI's XML parser. We installed the LIBEXPAT
   library from your web site and I am using the USERDATA.rpgle as an
   example for my program. (Sorry not the XPATH.rpgle as i mentioned in my
   previous mail)
   It seems like it is reading the text after the &. If i print the
   value to the spoolfile it prints an & and then on the next line the
   rest of the text.
   Here's the code to read the value from the tag:
                 WHEN  d.stack(d.depth) = '/soapenv:Envelope/soapenv:Body'

                 PrintMe =  %TRIM(%char(val));
                 Except Print;
                 DoW %Scan(' & ': %TRIM(%char(val))) > *Zeros;
                   val = %Replace('&' : %TRIM(%char(val))
                   : %Scan(' & ': %TRIM(%char(val))): 7);
                 PrintMe =  %TRIM(%char(val));
                 Except Print;
                 %OCCUR(PROCESSDATA) = d.procCnt;
                 PROCESSDATA.RTEPROCSTEP = %TRIM(%char(val));
   Here's my xml:
   <?xml version="1.0" encoding="UTF-8"?>
     <p1:CorticonResponse ccExeStart="1383656944646"
   ccExeStop="1383656944677" decisionServiceName="cascading"
         <p1:Process id="HBCB20130822002338316B20130822002338318"
           <p1:routeProcessStep>Num1 &amp; Num2</p1:routeProcessStep>
           <p1:inProduct href="#B20130628002168289"/>
           <p1:outProduct href="#Product_id_1"/>
       <p1:Messages version="1"/>
   Derick Venter
   Applications Developer IV


   Systems Integration
   Tel: +27 (13) 247 2816 Fax: +27 (0) 86 573 2274
   Cell: +27 (0) 83 458 6599
   Email: [5]derick.venter@xxxxxxxxxx
   From:        Scott Klement <sk@xxxxxxxxxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Date:        2013/11/06 05:09 PM
   Subject:        Re: R: Reading XML with &Amp; as part of string
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   So you are not using HTTPAPI's XML parser?!
   On 11/6/2013 8:12 AM, Venter.Derick@xxxxxxxxxxxxxx wrote:
   >     The replacement of &amp; with & works with plain RPG code using a
   >     string value.
   >     The problem is that the reader of the xml field seems to read
   >     correct but the rest of the string is thrown away.
   >     When I print the value to the spool file, I see the following:
   >     &
   >     the rest of my string.
   >     Seems that the reader is adding a next line character.
   >     I used Scott Klement's XPATH example to read through my XML
   >     and parse it.
   >     Any ideas?
   >     Derick Venter
   >     Applications Developer IV---
   This is the FTPAPI mailing list.  To unsubscribe, please go to:

   This e-mail is subject to the Columbus Stainless [Pty] Ltd Email Legal
   Notices available at:

   This e-mail message has been scanned for Viruses and Content and
   cleared by MailMarshal


   1. http://schemas.xmlsoap.org/soap/envelope/
   2. http://www.w3.org/2001/XMLSchema
   3. http://www.w3.org/2001/XMLSchema-instance
   4. http://www.w3.org/2001/XMLSchema-instance
   5. mailto:derick.venter@xxxxxxxxxx
   6. http://www.gijima.com/
   7. http://www.scottklement.com/mailman/listinfo/ftpapi
   8. http://www.columbus.co.za/EmailLegalNotice.htm

PNG image

This is the FTPAPI mailing list.  To unsubscribe, please go to: