mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-26 14:50:08 +03:00
SAX: Always validate xml:ids
The behavior shouldn't depend on mostly random configuration options.
This commit is contained in:
parent
f24ffddbb9
commit
b8961df65d
4
SAX2.c
4
SAX2.c
@ -2174,15 +2174,11 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
|
||||
*
|
||||
* Open issue: normalization of the value.
|
||||
*/
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
if (xmlValidateNCName(content, 1) != 0) {
|
||||
xmlErrValid(ctxt, XML_DTD_XMLID_VALUE,
|
||||
"xml:id : attribute value %s is not an NCName\n",
|
||||
(const char *) content, NULL);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
|
||||
} else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) {
|
||||
xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
|
||||
|
@ -657,15 +657,9 @@ struct _xmlDOMWrapCtxt {
|
||||
/*
|
||||
* Some helper functions
|
||||
*/
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
|
||||
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \
|
||||
defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \
|
||||
defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \
|
||||
defined(LIBXML_LEGACY_ENABLED)
|
||||
XMLPUBFUN int
|
||||
xmlValidateNCName (const xmlChar *value,
|
||||
int space);
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
XMLPUBFUN int
|
||||
|
2
tree.c
2
tree.c
@ -357,7 +357,6 @@ xmlSplitQName3(const xmlChar *name, int *len) {
|
||||
|
||||
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
/**
|
||||
* xmlValidateNCName:
|
||||
* @value: the value to check
|
||||
@ -429,7 +428,6 @@ try_complex:
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user