diff options
-rw-r--r-- | result/XPath/xptr/issue289base | 7 | ||||
-rw-r--r-- | test/XPath/docs/issue289 | 3 | ||||
-rw-r--r-- | test/XPath/xptr/issue289base | 1 | ||||
-rw-r--r-- | xpointer.c | 26 |
4 files changed, 12 insertions, 25 deletions
diff --git a/result/XPath/xptr/issue289base b/result/XPath/xptr/issue289base new file mode 100644 index 00000000..ec56aef2 --- /dev/null +++ b/result/XPath/xptr/issue289base @@ -0,0 +1,7 @@ + +======================== +Expression: xmlns(b=abc://d/e:f) xpointer(/b:rootB) +Object is a Node Set : +Set contains 1 nodes: +1 ELEMENT rootB + default namespace href=abc://d/e:f diff --git a/test/XPath/docs/issue289 b/test/XPath/docs/issue289 new file mode 100644 index 00000000..67bb1140 --- /dev/null +++ b/test/XPath/docs/issue289 @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<rootB xmlns="abc://d/e:f"> +</rootB> diff --git a/test/XPath/xptr/issue289base b/test/XPath/xptr/issue289base new file mode 100644 index 00000000..716a92fd --- /dev/null +++ b/test/XPath/xptr/issue289base @@ -0,0 +1 @@ +xmlns(b=abc://d/e:f) xpointer(/b:rootB) @@ -1040,8 +1040,6 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { const xmlChar *oldBase = ctxt->base; const xmlChar *oldCur = ctxt->cur; xmlChar *prefix; - xmlChar *URI; - xmlURIPtr value; ctxt->cur = ctxt->base = buffer; prefix = xmlXPathParseNCName(ctxt); @@ -1063,32 +1061,10 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { } NEXT; SKIP_BLANKS; - /* @@ check escaping in the XPointer WD */ - value = xmlParseURI((const char *)ctxt->cur); - if (value == NULL) { - ctxt->base = oldBase; - ctxt->cur = oldCur; - xmlFree(prefix); - xmlFree(buffer); - xmlFree(name); - XP_ERROR(XPTR_SYNTAX_ERROR); - } - URI = xmlSaveUri(value); - xmlFreeURI(value); - if (URI == NULL) { - ctxt->base = oldBase; - ctxt->cur = oldCur; - xmlFree(prefix); - xmlFree(buffer); - xmlFree(name); - XP_ERROR(XPATH_MEMORY_ERROR); - } - - xmlXPathRegisterNs(ctxt->context, prefix, URI); + xmlXPathRegisterNs(ctxt->context, prefix, ctxt->cur); ctxt->base = oldBase; ctxt->cur = oldCur; - xmlFree(URI); xmlFree(prefix); #endif /* XPTR_XMLNS_SCHEME */ } else { |