Re: [xml] libxml2 equivalents for expat's XML_GetCurrentByteIndex and XML_GetCurrentByteCount



On 18 Oct 2012, at 6:07 PM, Daniel Veillard <veillard redhat com> wrote:

 See xmlByteConsumed() but it's more complex for us than for expat
as we convert the initial byte stream to UTF-8 if it was in a different
encoding. See the xmlByteConsumed() code.

The docs say "This function provides the current index of the parser relative to the start of the current 
entity.", when it says "current index of the parser" what exactly does this point to? The start of the 
element? The character following the end of the element? Something else?

I don't understand what
"the length of the element" is supposed to mean.

The length of the element is the distance from the start of the element, to the end of the element. For 
example, if the element was '<body  id="foo">' the length would be 16 (note the extra space between body and 
id). The expat function that gives you this is XML_GetCurrentByteCount().

Regards,
Graham
--




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