mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Avoid duplicate namespace errors
Don't report an extra attribute uniqueness error if a namespace is undeclared. This matches old behavior.
This commit is contained in:
6
parser.c
6
parser.c
@@ -9249,6 +9249,12 @@ next_attr:
|
|||||||
nameHashValue = ctxt->attallocs[j] | 0x80000000;
|
nameHashValue = ctxt->attallocs[j] | 0x80000000;
|
||||||
|
|
||||||
if (nsIndex == NS_INDEX_EMPTY) {
|
if (nsIndex == NS_INDEX_EMPTY) {
|
||||||
|
/*
|
||||||
|
* Prefix with empty namespace means an undeclared
|
||||||
|
* prefix which was already reported above.
|
||||||
|
*/
|
||||||
|
if (aprefix != NULL)
|
||||||
|
continue;
|
||||||
nsuri = NULL;
|
nsuri = NULL;
|
||||||
uriHashValue = URI_HASH_EMPTY;
|
uriHashValue = URI_HASH_EMPTY;
|
||||||
} else if (nsIndex == NS_INDEX_XML) {
|
} else if (nsIndex == NS_INDEX_XML) {
|
||||||
|
|||||||
2
result/errors/ns-undeclared.xml
Normal file
2
result/errors/ns-undeclared.xml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<linearGradient id="gradient4" xLink:href="#gradient3" href="otherHref"/>
|
||||||
3
result/errors/ns-undeclared.xml.ent
Normal file
3
result/errors/ns-undeclared.xml.ent
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
./test/errors/ns-undeclared.xml:1: namespace error : Namespace prefix xLink for href on linearGradient is not defined
|
||||||
|
<linearGradient id='gradient4' xLink:href='#gradient3' href='otherHref'/>
|
||||||
|
^
|
||||||
3
result/errors/ns-undeclared.xml.err
Normal file
3
result/errors/ns-undeclared.xml.err
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
./test/errors/ns-undeclared.xml:1: namespace error : Namespace prefix xLink for href on linearGradient is not defined
|
||||||
|
<linearGradient id='gradient4' xLink:href='#gradient3' href='otherHref'/>
|
||||||
|
^
|
||||||
3
result/errors/ns-undeclared.xml.str
Normal file
3
result/errors/ns-undeclared.xml.str
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
./test/errors/ns-undeclared.xml:1: namespace error : Namespace prefix xLink for href on linearGradient is not defined
|
||||||
|
<linearGradient id='gradient4' xLink:href='#gradient3' href='otherHref'/>
|
||||||
|
^
|
||||||
1
test/errors/ns-undeclared.xml
Normal file
1
test/errors/ns-undeclared.xml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<linearGradient id='gradient4' xLink:href='#gradient3' href='otherHref'/>
|
||||||
Reference in New Issue
Block a user