Re: [xml] Undefined character entities and libxml



From the ruby wrapper....

  rxxpc->ctxt->node = node->node;
  if (node->node->type == XML_DOCUMENT_NODE) {
    rxxpc->ctxt->namespaces = xmlGetNsList(node->node->doc,
                                           xmlDocGetRootElement(node->node->doc));
  } else {
    rxxpc->ctxt->namespaces = xmlGetNsList(node->node->doc, node->node);
  }

  rxxpc->ctxt->nsNr = 0;
  if (rxxpc->ctxt->namespaces != NULL) {
    while (rxxpc->ctxt->namespaces[rxxpc->ctxt->nsNr] != NULL)
      rxxpc->ctxt->nsNr++;
  }

  comp = xmlXPathCompile(STR2CSTR(xpath_expr));

  if (comp == NULL) {
    xmlXPathFreeCompExpr(comp);
    rb_raise(eXMLXPathInvalidPath, "Invalid XPath expression");
  }
  rxxp->xpop = xmlXPathCompiledEval(comp, rxxpc->ctxt);
  xmlXPathFreeCompExpr(comp);

  if (rxxpc->ctxt->namespaces != NULL)
    xmlFree(rxxpc->ctxt->namespaces);

This seems to agree with another place you answered this question.

http://mail.gnome.org/archives/xml/2001-August/msg00025.html

The error handling in the code looks to be wrong but that's not
causing my problem.

--
Jon Smirl
jonsmirl gmail com



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