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

Re: Getting the Attribute in an XML doc Element



Scott,
You are the MAN!

I had looked at Example15, but must not have registered/noticed the 
attribute part of it.  It all makes perfect sense now.  Made changes to my 
program and it works like a charm now.

Thanks,
   ScottJ

Scott Klement wrote:
> HTTPAPI will pass the attributes to you as an array of pointers.  The 
> array will look something like this:
> 
> attrs(1) = pointer to 'Accuracy'
> attrs(2) = pointer to '8'
> attrs(3) = *NULL
> 
> The idea is that you loop through the array of pointers until you 
> encounter a *NULL pointer.  The *NULL signals the end.  The first 
> pointer points to the attribute name, the second to the attribute value, 
> the third to the 2nd attribute name, the fourth to the 2nd attribute 
> value, etc.
> 
> If you had more than one attribute, such as
> 
> <AddressDetails Accuracy="8" Source="U" Code="X">
> </AddressDetails>
> 
> Then the array would look more like this:
> 
> attrs(1) = pointer to 'Accuracy'
> attrs(2) = pointer to '8'
> attrs(3) = pointer to 'Source'
> attrs(4) = pointer to 'U'
> attrs(5) = pointer to 'Code'
> attrs(6) = pointer to 'X'
> attrs(7) = *NULL
> 
> hopefully you get the idea.   There's sample code of reading these 
> attributes (getting the "version" attribute from an <rss version="x"> 
> XML tag) in EXAMPLE15.

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