From 54f9a4f5089a974cd773ab285637ea21df01202c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sat, 3 Sep 2005 13:28:24 +0000 Subject: fixing a number of issues raised by xml:id but more generally related to * SAX2.c tree.c valid.c: fixing a number of issues raised by xml:id but more generally related to attributes and ID handling, fixes #314358 among other things Daniel --- valid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'valid.c') diff --git a/valid.c b/valid.c index c0141ff1..3ee5630c 100644 --- a/valid.c +++ b/valid.c @@ -2703,8 +2703,12 @@ xmlFreeIDTable(xmlIDTablePtr table) { */ int xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) { + if ((attr == NULL) || (attr->name == NULL)) return(0); + if ((attr->ns != NULL) && (attr->ns->prefix != NULL) && + (!strcmp((char *) attr->name, "id")) && + (!strcmp((char *) attr->ns->prefix, "xml"))) + return(1); if (doc == NULL) return(0); - if (attr == NULL) return(0); if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) { return(0); } else if (doc->type == XML_HTML_DOCUMENT_NODE) { -- cgit v1.2.1