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

Re: Expat XML complex document read.



Scott,

  No problem.  I was able to get into logged into the SystemiNetwork forum yesterday.  Would you suggest I just copy the information from here over to that forum or is there another way to get the replies in there?  My job requires that I be able to code in RPGII, RPG400 and RPGLE so sometimes I get confused on what is available where and all the capabilities each available in each version.

Rich.

---- Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote: 
> Hi Rich,
> 
> I'd be happy to help you with this, either using Expat or using XML-INTO 
> or XML-SAX.  (All of which should work just fine -- this looks like a 
> fairly simple XML document.)
> 
> However, I'd really appreciate it if we could take this off of this 
> mailing list.   This mailing list is exclusively for FTPAPI and 
> HTTPAPI.  I'd really like to keep it on-track for those projects rather 
> than turn it into a general-purpose mailing list.
> 
> Maybe I should start another mailing list that's for general 
> discussions?    But it seems silly, since I'm already on several 
> general-purpose lists that would work great for discussions like this.  
> The System iNetwork forums are my favorite discussion forums (IMHO web 
> forums work better than e-mail lists) but I'm also active on Midrange.com
> 
> The RPG forum on System iNetwork would be my first choice
> http://forums.systeminetwork.com/isnetforums/forumdisplay.php?f=5
> 
> 
> On 5/18/2010 5:22 PM, richbelcher@xxxxxxx wrote:
> > I thought  this would be the place to ask the question because of using the EXPAT library and example program that I used to access the XML.  Because of privacy information I will have to use a dummy example.
> >
> > <xml>
> >     <CustomerOrder>
> >         <TransactionDate>2010-05-14</TransactionDate>
> >         <TransactionEffectiveDate>2010-05-01</TransactionEffectiveDate>
> >         <ShippingAddress>
> >              <CompanyName>Some Company</CompanyName>
> >              <Addr1>123 any street</Addr1>
> >              <City>Town</City>
> >              <State>AZ</State>
> >              <Zip>85015</Zip>
> >          </ShippingAddress>
> >          <ShipTo>
> >               <Consignee>My Company</Consignee>
> >               <Addr1>456 another street</Addr1>
> >               <City>My Town</City>
> >               <State>CA</State>
> >               <Zip>99001</ZIp>
> >           </ShipTo>
> >           <OrderInfo>
> >                <OrderNumber>012345</OrderNumber>      (Primary Key of tables)
> >                <ShipDate>2010-05-30</ShipDate>
> >            </OrderInfo>
> >            <OrderItems>
> >                 <Part>1234</Part>
> >                 <Desc>One product</Desc>
> >                 <Quantity>1</Quantity>
> >                 <Price>10.00</Price>
> >                 <Part/>2345</Part>
> >                 <Desc>Another product</Desc>
> >                 <Quantity>5</Quantity>
> >                 <Price>20.00</Price>
> >             </OrderItems>
> >             <SpecialInstructions>
> >                  <ShipDirections>Ship during business hours</ShipDirections>
> >             </SpecialInstructions>
> >     </CustomerOrder>
> > </xml>
> >
> > The XML document I am working with has allot more detail but the above example is kind of what I am facing.  The primary key for the load to the tables is several elements down in the document and the prior information is also needed for one of the tables.  In using the CUSTDATA2 example the only way I can think of retaining the data is use data structures to load to in the subprocedure and then bring them back up into the mainline of the program to process the information.  The only problem with scenario is I am referencing one order where ther could be multiple orders within the same XML document.
> >
> > Hope that clears it up some.  I have also used to HTTPAPI to access to separate web services and would like to thank you for the example I was able to use in the library.  I did sign up in the iSystems forums but have not figured out where to post the question yet.
> >
> > Thanks
> > Richard.
> > ---- Scott Klement<sk@xxxxxxxxxxxxxxxx>  wrote:
> >    
> >> Hi Richard,
> >>
> >> I'm having a hard time visualizing the problem.  Would a simple example
> >> be possible?
> >>
> >> Also, can we move this to the System iNetwork forums?  It doesn't appear
> >> to be related to HTTPAPI or FTPAPI.
> >> http://forums.systeminetwork.com
> >>
> >> Thanks!
> >>
> >>
> >> On 5/18/2010 4:14 PM, richbelcher@xxxxxxx wrote:
> >>      
> >>> Hi Scott,
> >>>
> >>> I am attempting to use the CUSTDATA2 example in LIBEXPAT to read in
> >>> an XML document with whitespace that is complex and the data is not
> >>> in the order to attempt to write it out to keyed tables.  The primary
> >>> key is buried several columns past the beginning of the data.  I am
> >>> able to get the table copied to the IFS and the program is reading it
> >>> but I am having a problem trying to think of a logical way to extract
> >>> the data into elements.  I thought about data structures, but I am
> >>> dealing with populating about 15 different tables with information.
> >>> I also attempted to use the new XML-SAX and XML-INTO operations but
> >>> the complexity and length of the column names make that option not a
> >>> valid one.  Any suggestions on how to get the data out and into
> >>> tables?  This is going to be an ongoing experience for me and I'm a
> >>> little buffalo'ed on the correct way to handle this.
> >>>
> >>> Thanks
> >>> Richard
> >>>        
> >> -----------------------------------------------------------------------
> >> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> >> 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
> > -----------------------------------------------------------------------
> >
> >    
> 
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> 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
-----------------------------------------------------------------------