[xml] namespace decl attributes return false for HasValue



Hi Daniel,

I have been using the xmlTextReader API in libxml2-2.5.6 on Gentoo.  I
like it very much, but I have come across the following curious corner
case: namespace declarations have NodeType=2 (i.e. attribute), return
false for HasValue, and return the namespace URI for Value.  Is this
intended behavior?  It seems a bit inconsistent to actually have a
Value but return false for HasValue.

Here is code and data files to reproduce the problem:

Attachment: bug.cc
Description: C++ application

Attachment: bug1.xml
Description: data file 1

Attachment: bug2.xml
Description: data file 2


I suspect that this could be fixed simply by adding:

case XML_NAMESPACE_DECL:

to the switch statement in the implementation of function
xmlTextReaderHasValue in file xmlreader.c

Cheers,

-- 
Dr. Denys Duchier
Équipe Calligramme
LORIA, Nancy, FRANCE


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