Ignore the stupid http://www.w3.org/1999/xhtml namespace some html have
I think this also fixes a memory leak with the xpath wide string.
This commit is contained in:
parent
6e35c880a4
commit
bdb858de5a
1 changed files with 4 additions and 1 deletions
|
@ -59,11 +59,14 @@ namespace duck {
|
|||
BatchResults retval;
|
||||
try {
|
||||
AutoDelete<DynamicContext> context(xqilla.createContext(XQilla::XQUERY_UPDATE, &xconfig));
|
||||
//see http://xqilla.sourceforge.net/docs/simple-api/classStaticContext.html#adc869a84712459fa49db67fe837c9b01
|
||||
context->setDefaultElementAndTypeNS(u"http://www.w3.org/1999/xhtml");
|
||||
Node::Ptr ptr = context->parseDocument(input_buf);
|
||||
context->setContextItem(ptr);
|
||||
|
||||
for (const auto& xpath : parQueries) {
|
||||
AutoDelete<XQQuery> query(xqilla.parse(X(xpath.c_str())));
|
||||
AutoDeleteArray<XMLCh> xpath_wide = xercesc::XMLString::transcode(xpath.c_str());
|
||||
AutoDelete<XQQuery> query(xqilla.parse(xpath_wide, context, nullptr, XQilla::NO_ADOPT_CONTEXT));
|
||||
context->setContextPosition(1);
|
||||
context->setContextSize(1);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue