mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
Fix the spurious ID already defined error
For https://bugzilla.gnome.org/show_bug.cgi?id=737840 the fix for 724903 introduced a regression on external entities carrying IDs, revert that patch in part and add a specific test to avoid readding it
This commit is contained in:
parent
3eaedba1b6
commit
ef709ce2f7
10
result/valid/737840.xml
Normal file
10
result/valid/737840.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE root [
|
||||||
|
<!ELEMENT root (elem)>
|
||||||
|
<!ELEMENT elem (#PCDATA)>
|
||||||
|
<!ATTLIST elem id ID #IMPLIED>
|
||||||
|
<!ENTITY target SYSTEM "dtds/737840.ent">
|
||||||
|
]>
|
||||||
|
<root>
|
||||||
|
⌖
|
||||||
|
</root>
|
0
result/valid/737840.xml.err
Normal file
0
result/valid/737840.xml.err
Normal file
0
result/valid/737840.xml.err.rdr
Normal file
0
result/valid/737840.xml.err.rdr
Normal file
10
test/valid/737840.xml
Normal file
10
test/valid/737840.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE root [
|
||||||
|
<!ELEMENT root (elem)>
|
||||||
|
<!ELEMENT elem (#PCDATA)>
|
||||||
|
<!ATTLIST elem id ID #IMPLIED>
|
||||||
|
<!ENTITY target SYSTEM "dtds/737840.ent">
|
||||||
|
]>
|
||||||
|
|
||||||
|
<root>
|
||||||
|
⌖
|
||||||
|
</root>
|
1
test/valid/dtds/737840.ent
Normal file
1
test/valid/dtds/737840.ent
Normal file
@ -0,0 +1 @@
|
|||||||
|
<elem id="id0"/>
|
2
valid.c
2
valid.c
@ -2634,8 +2634,10 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
|||||||
/*
|
/*
|
||||||
* The id is already defined in this DTD.
|
* The id is already defined in this DTD.
|
||||||
*/
|
*/
|
||||||
|
if (ctxt != NULL) {
|
||||||
xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
|
xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
|
||||||
"ID %s already defined\n", value, NULL, NULL);
|
"ID %s already defined\n", value, NULL, NULL);
|
||||||
|
}
|
||||||
#endif /* LIBXML_VALID_ENABLED */
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlFreeID(ret);
|
xmlFreeID(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user