1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

comments cleanups use xmllint for doing the RelaxNG tests preparing 2.5.2

* HTMLparser.c tree.c xmlIO.c: comments cleanups
* Makefile.am: use xmllint for doing the RelaxNG tests
* configure.in: preparing 2.5.2 made schemas support default to
  on instead of off
* relaxng.c: removed the verbosity
* xmllint.c: added --relaxng option
* python/generator.py python/libxml_wrap.h: prepared the integration
  of the new RelaxNG module and schemas
* result/relaxng/*: less verbose output
Daniel
This commit is contained in:
Daniel Veillard
2003-02-05 13:19:53 +00:00
parent ec498e1b33
commit 71531f3345
153 changed files with 654 additions and 4380 deletions

60
tree.c
View File

@ -5201,6 +5201,9 @@ xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
* This does the entity substitution.
* This function looks in DTD attribute declaration for #FIXED or
* default declaration values unless DTD use has been turned off.
* NOTE: this function acts independantly of namespaces associated
* to the attribute. Use xmlGetNsProp() or xmlGetNoNsProp()
* for namespace aware processing.
*
* Returns the attribute value or NULL if not found.
* It's up to the caller to free the memory with xmlFree().
@ -5245,6 +5248,61 @@ xmlGetProp(xmlNodePtr node, const xmlChar *name) {
return(NULL);
}
/**
* xmlGetNoNsProp:
* @node: the node
* @name: the attribute name
*
* Search and get the value of an attribute associated to a node
* This does the entity substitution.
* This function looks in DTD attribute declaration for #FIXED or
* default declaration values unless DTD use has been turned off.
* This function is similar to xmlGetProp except it will accept only
* an attribute in no namespace.
*
* Returns the attribute value or NULL if not found.
* It's up to the caller to free the memory with xmlFree().
*/
xmlChar *
xmlGetNoNsProp(xmlNodePtr node, const xmlChar *name) {
xmlAttrPtr prop;
xmlDocPtr doc;
if ((node == NULL) || (name == NULL)) return(NULL);
/*
* Check on the properties attached to the node
*/
prop = node->properties;
while (prop != NULL) {
if ((prop->ns == NULL) && (xmlStrEqual(prop->name, name))) {
xmlChar *ret;
ret = xmlNodeListGetString(node->doc, prop->children, 1);
if (ret == NULL) return(xmlStrdup((xmlChar *)""));
return(ret);
}
prop = prop->next;
}
if (!xmlCheckDTD) return(NULL);
/*
* Check if there is a default declaration in the internal
* or external subsets
*/
doc = node->doc;
if (doc != NULL) {
xmlAttributePtr attrDecl;
if (doc->intSubset != NULL) {
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
if (attrDecl != NULL)
return(xmlStrdup(attrDecl->defaultValue));
}
}
return(NULL);
}
/**
* xmlGetNsProp:
* @node: the node
@ -5271,7 +5329,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
prop = node->properties;
if (nameSpace == NULL)
return(xmlGetProp(node, name));
return(xmlGetNoNsProp(node, name));
while (prop != NULL) {
/*
* One need to have