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

Re: httpapi and expat question



Sorry, I didn't read your question closely enough.  For some reason I 
was thinking you were using Expat directly.

If you're using HTTPAPI's wrappers for Expat, you'll still do the same 
thing, but the attributes are passed in the 5th parameter (not the 3rd) 
to the start element handler and the 6th parameter to the end element 
handler. (Unlike direct Expat, the HTTPAPI wrapper passes it to both the 
start and end handler, making it easier, IMHO to use.)

EXAMPLE15 demonstrates using this technique to find the version of the 
RSS document it's parsing.

In version 1.24 of HTTPAPI (which, right now, only exists on my machine, 
it's not on the web site -- at least I don't think so?)  there's a 
helper routine called HTTP_nextXmlAttr() that simplifies handling 
attributes.


Scott Klement wrote:
> Hi Jon,
> 
> In the example you posted, "zimbraFeatureCalendarUpsellEnabled" is a 
> valid that has been assigned to the n attribute.  The n attribute is 
> part of the a XML tag.
> 
> Expat will pass all of the attributes of each start tag as an array of 
> pointers to your start element handler.  This array is the 3rd parameter 
> passed to your start handler...
> 
> Take a look at the CUSTLIST sample program in the QRPGLESRC included 
> with my distribution of Expat.  It has a sample of searching through the 
> attributes for an attribute named 'custno' on the /CustFile/CustRec tag.
> You would do the same thing, except that you have to search for an 'n' 
> attribute of the /account/a tag.
> 
> Good luck.
> 
> 
> Jon S wrote:
>>    Hi all,
>>
>>    If I am receiving xml back from a soap call like such:
>>
>>    <account name=[1]x@xxxxx id="3fb092a4-ace0-48f5-9068-921ab1870bfa">
>>            <a n="zimbraFeatureCalendarUpsellEnabled">FALSE</a>
>>            <a n="zimbraFeatureOptionsEnabled">TRUE</a>
>>
> 

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