Re: [xml] Getting the element's attributes with SAX2

On Tue, Mar 14, 2006 at 11:15:26AM -0500, Daniel Veillard wrote:
On Tue, Mar 14, 2006 at 04:26:59PM +0100, Antonio Pozuelo wrote:


Is anything  wrong?

  How am I supposed to tell ? what is i ? And no I won't debug your code.

  Okay I think I realized what is confusing you. In the new callback
the attributes values are not copied in a new zero terminated string,
rather pointers to the beginning and the end of the attribute value are 
given, this potentally avoids an awful lot of allocations/deallocations,
most of the time those are direct pointer from the UTF8 document stream.
The pointer to the routine in SAX2 should be relatively clear about this.
It's also documented in
  attributes:   pointer to the array of (localname/prefix/URI/value/end) attribute values.

  so the array contains 5 pointer per attribute found


Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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