mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
fix the name() bug for elements in the default namespace reported by
* xpath.c: fix the name() bug for elements in the default namespace reported by Charlie Bozeman Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Sun Jul 8 16:26:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* xpath.c: fix the name() bug for elements in the default
|
||||||
|
namespace reported by Charlie Bozeman
|
||||||
|
|
||||||
Sun Jul 8 15:11:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
Sun Jul 8 15:11:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
* SAX.c parser.c testXPath.c xpath.c: trying to fix #56948, this
|
* SAX.c parser.c testXPath.c xpath.c: trying to fix #56948, this
|
||||||
|
15
xpath.c
15
xpath.c
@ -4815,7 +4815,8 @@ xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
|||||||
* returned.
|
* returned.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||||
|
{
|
||||||
xmlXPathObjectPtr cur;
|
xmlXPathObjectPtr cur;
|
||||||
|
|
||||||
if (nargs == 0) {
|
if (nargs == 0) {
|
||||||
@ -4838,14 +4839,18 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
|||||||
switch (cur->nodesetval->nodeTab[i]->type) {
|
switch (cur->nodesetval->nodeTab[i]->type) {
|
||||||
case XML_ELEMENT_NODE:
|
case XML_ELEMENT_NODE:
|
||||||
case XML_ATTRIBUTE_NODE:
|
case XML_ATTRIBUTE_NODE:
|
||||||
if (cur->nodesetval->nodeTab[i]->ns == NULL)
|
if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
|
||||||
valuePush(ctxt, xmlXPathNewString(
|
(cur->nodesetval->nodeTab[i]->ns->prefix == NULL))
|
||||||
cur->nodesetval->nodeTab[i]->name));
|
valuePush(ctxt,
|
||||||
|
xmlXPathNewString(cur->nodesetval->
|
||||||
|
nodeTab[i]->name));
|
||||||
|
|
||||||
else {
|
else {
|
||||||
char name[2000];
|
char name[2000];
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "%s:%s",
|
snprintf(name, sizeof(name), "%s:%s",
|
||||||
(char *) cur->nodesetval->nodeTab[i]->ns->prefix,
|
(char *) cur->nodesetval->nodeTab[i]->ns->
|
||||||
|
prefix,
|
||||||
(char *) cur->nodesetval->nodeTab[i]->name);
|
(char *) cur->nodesetval->nodeTab[i]->name);
|
||||||
name[sizeof(name) - 1] = 0;
|
name[sizeof(name) - 1] = 0;
|
||||||
valuePush(ctxt, xmlXPathNewCString(name));
|
valuePush(ctxt, xmlXPathNewCString(name));
|
||||||
|
Reference in New Issue
Block a user