1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-12 16:58:16 +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:
Nick Wellnhofer 2024-01-05 15:40:23 +01:00
parent 02cc5c3609
commit f237e5b934
6 changed files with 18 additions and 0 deletions

View File

@ -9249,6 +9249,12 @@ next_attr:
nameHashValue = ctxt->attallocs[j] | 0x80000000;
if (nsIndex == NS_INDEX_EMPTY) {
/*
* Prefix with empty namespace means an undeclared
* prefix which was already reported above.
*/
if (aprefix != NULL)
continue;
nsuri = NULL;
uriHashValue = URI_HASH_EMPTY;
} else if (nsIndex == NS_INDEX_XML) {

View File

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<linearGradient id="gradient4" xLink:href="#gradient3" href="otherHref"/>

View 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'/>
^

View 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'/>
^

View 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'/>
^

View File

@ -0,0 +1 @@
<linearGradient id='gradient4' xLink:href='#gradient3' href='otherHref'/>