mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-23 02:50:08 +03:00
Make schema validation fail with multiple top-level elements
Closes #126.
This commit is contained in:
parent
106757e8c1
commit
4f2aee18f6
@ -27933,6 +27933,10 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
|
||||
VERROR(1, NULL, "The document has no document element");
|
||||
return (1);
|
||||
}
|
||||
for (node = valRoot->next; node != NULL; node = node->next) {
|
||||
if (node->type == XML_ELEMENT_NODE)
|
||||
VERROR(1, NULL, "The document has more than one top element");
|
||||
}
|
||||
vctxt->depth = -1;
|
||||
vctxt->validationRoot = valRoot;
|
||||
node = valRoot;
|
||||
|
Loading…
x
Reference in New Issue
Block a user