List Info

Thread: XPath child axis traversal is broken when docb is disabled (libxml2 2.6.27)




XPath child axis traversal is broken when docb is disabled (libxml2 2.6.27)
user name
2006-12-28 20:31:13
If you compile libxml2 with "--without-docb"
option then
XPath child axis traversal is broken due to the following
ifdef in the xmlXPathNextDescendantOrSelfElemParent()
function:

	while (cur != NULL) {
	    switch (cur->type) {
		case XML_ELEMENT_NODE:
		/* TODO: OK to have XInclude here? */
		case XML_XINCLUDE_START:
		case XML_DOCUMENT_FRAG_NODE:		
		    if (cur != start)
			return(cur);
		    if (cur->children != NULL) {
			cur = cur->children;
			continue;
		    }
		    break;
#ifdef LIBXML_DOCB_ENABLED
		/* Not sure if we need those here. */
		case XML_DOCUMENT_NODE:
		case XML_DOCB_DOCUMENT_NODE:
#endif
		case XML_HTML_DOCUMENT_NODE:
		    if (cur != start)
			return(cur);
		    return(xmlDocGetRootElement((xmlDocPtr) cur));
		default:
		    break;
	    }	

It seems that the right thing to do is to simply move the
"case XML_DOCUMENT_NODE:" out of this particular
ifdef but
I am not familiar enough with DOCB stuff to tell the
consequences
of this.

Best,
Aleksey



_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
XPath child axis traversal is broken when docb is disabled (libxml2 2.6.27)
user name
2006-12-29 03:54:42
Aleksey Sanin wrote:
> If you compile libxml2 with "--without-docb"
option then
> XPath child axis traversal is broken due to the
following
> ifdef in the xmlXPathNextDescendantOrSelfElemParent()
> function:
>
> 	while (cur != NULL) {
> 	    switch (cur->type) {
> 		case XML_ELEMENT_NODE:
> 		/* TODO: OK to have XInclude here? */
> 		case XML_XINCLUDE_START:
> 		case XML_DOCUMENT_FRAG_NODE:
> 		    if (cur != start)
> 			return(cur);
> 		    if (cur->children != NULL) {
> 			cur = cur->children;
> 			continue;
> 		    }
> 		    break;
> #ifdef LIBXML_DOCB_ENABLED
> 		/* Not sure if we need those here. */
> 		case XML_DOCUMENT_NODE:
> 		case XML_DOCB_DOCUMENT_NODE:
> #endif
> 		case XML_HTML_DOCUMENT_NODE:
> 		    if (cur != start)
> 			return(cur);
> 		    return(xmlDocGetRootElement((xmlDocPtr) cur));
> 		default:
> 		    break;
> 	    }
>
> It seems that the right thing to do is to simply move
the
> "case XML_DOCUMENT_NODE:" out of this
particular ifdef but
> I am not familiar enough with DOCB stuff to tell the
consequences
> of this.
>
> Best,
> Aleksey

I think this one was already reported:
   http://mail.gnome.org/archives/xml/2006-October/msg
00123.html
and fixed in CVS the day after 2.6.27 was released .

Bill

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
XPath child axis traversal is broken when docb is disabled (libxml2 2.6.27)
user name
2006-12-29 06:30:55
> I think this one was already reported:
>    http://mail.gnome.org/archives/xml/2006-October/msg
00123.html
> and fixed in CVS the day after 2.6.27 was released .

Oh, thanks! Sorry, I did not have time to look at the cvs
today.

Aleksey


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )