mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +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"/>
|
6
valid.c
6
valid.c
@ -2634,8 +2634,10 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
||||
/*
|
||||
* The id is already defined in this DTD.
|
||||
*/
|
||||
xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
|
||||
"ID %s already defined\n", value, NULL, NULL);
|
||||
if (ctxt != NULL) {
|
||||
xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
|
||||
"ID %s already defined\n", value, NULL, NULL);
|
||||
}
|
||||
#endif /* LIBXML_VALID_ENABLED */
|
||||
xmlFreeID(ret);
|
||||
return(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user