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

Re: parsing help



   I had to do this for parsing the XML coming back from VIN look ups we
   do and here is how I done it... I think this may be what your looking
   for at least???
   in the D specs:
    D   name                      1024A   varying const
    D   path                     24576A   varying const
    D   value                    65535A   varying const
    D a                        s             10i 0
    D attrName        s           1024a   varying
    D attrVal              s          65535a   varying
   In the code:
   individual tags:
       //*******************************************************
       //**** Bring Back the Values when <<VIN DATA>>passed in**
       //*******************************************************
      if path = '/PolkServiceResponse/VinData';
         select;
         when name='vin';
          eval SAVVIN = Value;
         when name='correctedVin';
          eval SUGVIN = Value;
    // HANDLE INDIVIDUAL ATTRIBUTES IN THE VDTA RETURN XML //
         when name='fields';
          A = 1;
           dow HTTP_nextXmlAttr( attrs: a: attrName: attrVal );
            select;
             when attrVal = 'ABS_BRK_CD';
               WK_VNDATA(1) = Value;

             when attrVal = 'BODY_STYLE_CD';
               WK_VNDATA(9) = Value;
   I do load this data to another array for other uses but this should
   give you an Idea of how to handle the tags in the XML being returned.
   Hope this helps you,
   George A. Baldwin
   CGI Consultant
   Cell: 614-284-5679
   From:        Donnie Barrow <ddbarrow@xxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
   Date:        11/26/2014 11:25 AM
   Subject:        parsing help
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   I have HTTPAPI and EXPAT loaded. I have attached a program I used from
   example 17. I call a web service and I am writing the return xml to the
   IFS /tmp folder. This all works YAiii!  But for some reason I am stuck
   trying to parse the daggone return XML to my array.[ or even a field]
   UGHHH!  Can someone help push me in the right direction? I looked at
   CHARDATA1 in the EXPAT examples and I kinda understand it
   but....hmmmmhow do I pull this in?  HeLP         Donnie BarrowiSeries
   Consultant 513.709.0370[attachment "pca001cnsm.txt" deleted by George
   Baldwin/ACIC]
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [1]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------

References

   1. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------