Commit 8b5dd83f authored by Daniel Veillard's avatar Daniel Veillard

- configure.in: releasing 2.2.4

- parser.[ch]: added xmlStrEqual()
- HTMLparser.c HTMLtree.c SAX.c debugXML.c entities.c parser.c
  tree.c valid.c xlink.c xpath.c: converted all !xmlStrcmp to
  use xmlStrEqual instead
- TODO: updated
- added an XPath test
Daniel
parent bc765307
Sun Oct 1 22:16:33 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* configure.in: releasing 2.2.4
* parser.[ch]: added xmlStrEqual()
* HTMLparser.c HTMLtree.c SAX.c debugXML.c entities.c parser.c
tree.c valid.c xlink.c xpath.c: converted all !xmlStrcmp to
use xmlStrEqual instead
* TODO: updated
* added an XPath test
Sun Oct 1 20:19:39 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* HTMLparser.c: fixed htmlStartCloseIndexinitialized init
......
......@@ -612,7 +612,7 @@ htmlTagLookup(const xmlChar *tag) {
for (i = 0; i < (sizeof(html40ElementTable) /
sizeof(html40ElementTable[0]));i++) {
if (!xmlStrcmp(tag, BAD_CAST html40ElementTable[i].name))
if (xmlStrEqual(tag, BAD_CAST html40ElementTable[i].name))
return(&html40ElementTable[i]);
}
return(NULL);
......@@ -639,13 +639,13 @@ htmlCheckAutoClose(const xmlChar *newtag, const xmlChar *oldtag) {
for (index = 0; index < 100;index++) {
close = htmlStartCloseIndex[index];
if (close == NULL) return(0);
if (!xmlStrcmp(BAD_CAST *close, newtag)) break;
if (xmlStrEqual(BAD_CAST *close, newtag)) break;
}
i = close - htmlStartClose;
i++;
while (htmlStartClose[i] != NULL) {
if (!xmlStrcmp(BAD_CAST htmlStartClose[i], oldtag)) {
if (xmlStrEqual(BAD_CAST htmlStartClose[i], oldtag)) {
return(1);
}
i++;
......@@ -673,11 +673,11 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
#endif
for (i = (ctxt->nameNr - 1);i >= 0;i--) {
if (!xmlStrcmp(newtag, ctxt->nameTab[i])) break;
if (xmlStrEqual(newtag, ctxt->nameTab[i])) break;
}
if (i < 0) return;
while (xmlStrcmp(newtag, ctxt->name)) {
while (!xmlStrEqual(newtag, ctxt->name)) {
info = htmlTagLookup(ctxt->name);
if ((info == NULL) || (info->endTag == 1)) {
#ifdef DEBUG
......@@ -738,9 +738,9 @@ htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
htmlAutoCloseOnClose(ctxt, BAD_CAST"html");
}
while ((newtag == NULL) && (ctxt->name != NULL) &&
((!xmlStrcmp(ctxt->name, BAD_CAST"head")) ||
(!xmlStrcmp(ctxt->name, BAD_CAST"body")) ||
(!xmlStrcmp(ctxt->name, BAD_CAST"html")))) {
((xmlStrEqual(ctxt->name, BAD_CAST"head")) ||
(xmlStrEqual(ctxt->name, BAD_CAST"body")) ||
(xmlStrEqual(ctxt->name, BAD_CAST"html")))) {
#ifdef DEBUG
fprintf(stderr,"htmlAutoClose: EOF closes %s\n", ctxt->name);
#endif
......@@ -775,7 +775,7 @@ htmlAutoCloseTag(htmlDocPtr doc, const xmlChar *name, htmlNodePtr elem) {
htmlNodePtr child;
if (elem == NULL) return(1);
if (!xmlStrcmp(name, elem->name)) return(0);
if (xmlStrEqual(name, elem->name)) return(0);
if (htmlCheckAutoClose(elem->name, name)) return(1);
child = elem->children;
while (child != NULL) {
......@@ -820,7 +820,7 @@ htmlIsAutoClosed(htmlDocPtr doc, htmlNodePtr elem) {
*/
void
htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
if (!xmlStrcmp(newtag, BAD_CAST"html"))
if (xmlStrEqual(newtag, BAD_CAST"html"))
return;
if (ctxt->nameNr <= 0) {
#ifdef DEBUG
......@@ -830,15 +830,15 @@ htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
ctxt->sax->startElement(ctxt->userData, BAD_CAST"html", NULL);
}
if ((!xmlStrcmp(newtag, BAD_CAST"body")) || (!xmlStrcmp(newtag, BAD_CAST"head")))
if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head")))
return;
if (ctxt->nameNr <= 1) {
if ((!xmlStrcmp(newtag, BAD_CAST"script")) ||
(!xmlStrcmp(newtag, BAD_CAST"style")) ||
(!xmlStrcmp(newtag, BAD_CAST"meta")) ||
(!xmlStrcmp(newtag, BAD_CAST"link")) ||
(!xmlStrcmp(newtag, BAD_CAST"title")) ||
(!xmlStrcmp(newtag, BAD_CAST"base"))) {
if ((xmlStrEqual(newtag, BAD_CAST"script")) ||
(xmlStrEqual(newtag, BAD_CAST"style")) ||
(xmlStrEqual(newtag, BAD_CAST"meta")) ||
(xmlStrEqual(newtag, BAD_CAST"link")) ||
(xmlStrEqual(newtag, BAD_CAST"title")) ||
(xmlStrEqual(newtag, BAD_CAST"base"))) {
/*
* dropped OBJECT ... i you put it first BODY will be
* assumed !
......@@ -888,7 +888,7 @@ htmlCheckParagraph(htmlParserCtxtPtr ctxt) {
return(1);
}
for (i = 0; htmlNoContentElements[i] != NULL; i++) {
if (!xmlStrcmp(tag, BAD_CAST htmlNoContentElements[i])) {
if (xmlStrEqual(tag, BAD_CAST htmlNoContentElements[i])) {
#ifdef DEBUG
fprintf(stderr,"Implied element paragraph\n");
#endif
......@@ -1227,7 +1227,7 @@ htmlEntityLookup(const xmlChar *name) {
for (i = 0;i < (sizeof(html40EntitiesTable)/
sizeof(html40EntitiesTable[0]));i++) {
if (!xmlStrcmp(name, BAD_CAST html40EntitiesTable[i].name)) {
if (xmlStrEqual(name, BAD_CAST html40EntitiesTable[i].name)) {
#ifdef DEBUG
fprintf(stderr,"Found entity %s\n", name);
#endif
......@@ -1650,11 +1650,11 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
if (CUR != '<') return(0);
if (ctxt->name == NULL)
return(1);
if (!xmlStrcmp(ctxt->name, BAD_CAST"html"))
if (xmlStrEqual(ctxt->name, BAD_CAST"html"))
return(1);
if (!xmlStrcmp(ctxt->name, BAD_CAST"head"))
if (xmlStrEqual(ctxt->name, BAD_CAST"head"))
return(1);
if (!xmlStrcmp(ctxt->name, BAD_CAST"body"))
if (xmlStrEqual(ctxt->name, BAD_CAST"body"))
return(1);
if (ctxt->node == NULL) return(0);
lastChild = xmlGetLastChild(ctxt->node);
......@@ -2805,7 +2805,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
ctxt->wellFormed = 0;
return;
}
if (!xmlStrcmp(name, BAD_CAST"meta"))
if (xmlStrEqual(name, BAD_CAST"meta"))
meta = 1;
/*
......@@ -2837,7 +2837,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
* Well formedness requires at most one declaration of an attribute
*/
for (i = 0; i < nbatts;i += 2) {
if (!xmlStrcmp(atts[i], attname)) {
if (xmlStrEqual(atts[i], attname)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Attribute %s redefined\n",
......@@ -2962,7 +2962,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt) {
* then return, it's just an error.
*/
for (i = (ctxt->nameNr - 1);i >= 0;i--) {
if (!xmlStrcmp(name, ctxt->nameTab[i])) break;
if (xmlStrEqual(name, ctxt->nameTab[i])) break;
}
if (i < 0) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
......@@ -2985,12 +2985,12 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt) {
* With the exception that the autoclose may have popped stuff out
* of the stack.
*/
if (xmlStrcmp(name, ctxt->name)) {
if (!xmlStrEqual(name, ctxt->name)) {
#ifdef DEBUG
fprintf(stderr,"End of tag %s: expecting %s\n", name, ctxt->name);
#endif
if ((ctxt->name != NULL) &&
(xmlStrcmp(ctxt->name, name))) {
(!xmlStrEqual(ctxt->name, name))) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Opening and ending tag mismatch: %s and %s\n",
......@@ -3003,7 +3003,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt) {
* SAX: End of Tag
*/
oldname = ctxt->name;
if ((oldname != NULL) && (!xmlStrcmp(oldname, name))) {
if ((oldname != NULL) && (xmlStrEqual(oldname, name))) {
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, name);
oldname = htmlnamePop(ctxt);
......@@ -3134,7 +3134,7 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
* Has this node been popped out during parsing of
* the next element
*/
if ((xmlStrcmp(currentNode, ctxt->name)) &&
if ((!xmlStrEqual(currentNode, ctxt->name)) &&
(depth >= ctxt->nameNr)) {
if (currentNode != NULL) xmlFree(currentNode);
return;
......@@ -3245,7 +3245,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
else
fprintf(stderr, "Start of element %s, was %s\n", name, oldname);
#endif
if (((depth == ctxt->nameNr) && (!xmlStrcmp(oldname, ctxt->name))) ||
if (((depth == ctxt->nameNr) && (xmlStrEqual(oldname, ctxt->name))) ||
(name == NULL)) {
if (CUR == '>')
NEXT;
......@@ -3301,7 +3301,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
/*
* end of parsing of this node.
*/
if (!xmlStrcmp(name, ctxt->name)) {
if (xmlStrEqual(name, ctxt->name)) {
nodePop(ctxt);
oldname = htmlnamePop(ctxt);
#ifdef DEBUG
......@@ -3993,7 +3993,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
name, oldname);
#endif
if (((depth == ctxt->nameNr) &&
(!xmlStrcmp(oldname, ctxt->name))) ||
(xmlStrEqual(oldname, ctxt->name))) ||
(name == NULL)) {
if (CUR == '>')
NEXT;
......@@ -4055,7 +4055,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
/*
* end of parsing of this node.
*/
if (!xmlStrcmp(name, ctxt->name)) {
if (xmlStrEqual(name, ctxt->name)) {
nodePop(ctxt);
oldname = htmlnamePop(ctxt);
#ifdef DEBUG
......
......@@ -61,11 +61,11 @@ htmlGetMetaEncoding(htmlDocPtr doc) {
*/
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"html"))
if (xmlStrEqual(cur->name, BAD_CAST"html"))
break;
if (!xmlStrcmp(cur->name, BAD_CAST"head"))
if (xmlStrEqual(cur->name, BAD_CAST"head"))
goto found_head;
if (!xmlStrcmp(cur->name, BAD_CAST"meta"))
if (xmlStrEqual(cur->name, BAD_CAST"meta"))
goto found_meta;
}
cur = cur->next;
......@@ -79,9 +79,9 @@ htmlGetMetaEncoding(htmlDocPtr doc) {
*/
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"head"))
if (xmlStrEqual(cur->name, BAD_CAST"head"))
break;
if (!xmlStrcmp(cur->name, BAD_CAST"meta"))
if (xmlStrEqual(cur->name, BAD_CAST"meta"))
goto found_meta;
}
cur = cur->next;
......@@ -97,7 +97,7 @@ found_head:
found_meta:
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"meta")) {
if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
xmlAttrPtr attr = cur->properties;
int http;
const xmlChar *value;
......@@ -191,9 +191,9 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
*/
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"html"))
if (xmlStrEqual(cur->name, BAD_CAST"html"))
break;
if (!xmlStrcmp(cur->name, BAD_CAST"body")) {
if (xmlStrEqual(cur->name, BAD_CAST"body")) {
if (encoding == NULL)
return(0);
meta = xmlNewDocNode(doc, NULL, BAD_CAST"head", NULL);
......@@ -205,9 +205,9 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent);
return(0);
}
if (!xmlStrcmp(cur->name, BAD_CAST"head"))
if (xmlStrEqual(cur->name, BAD_CAST"head"))
goto found_head;
if (!xmlStrcmp(cur->name, BAD_CAST"meta"))
if (xmlStrEqual(cur->name, BAD_CAST"meta"))
goto found_meta;
}
cur = cur->next;
......@@ -221,9 +221,9 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
*/
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"head"))
if (xmlStrEqual(cur->name, BAD_CAST"head"))
break;
if (!xmlStrcmp(cur->name, BAD_CAST"body")) {
if (xmlStrEqual(cur->name, BAD_CAST"body")) {
if (encoding == NULL)
return(0);
meta = xmlNewDocNode(doc, NULL, BAD_CAST"head", NULL);
......@@ -235,7 +235,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent);
return(0);
}
if (!xmlStrcmp(cur->name, BAD_CAST"meta"))
if (xmlStrEqual(cur->name, BAD_CAST"meta"))
goto found_meta;
}
cur = cur->next;
......@@ -272,7 +272,7 @@ found_meta:
*/
while (cur != NULL) {
if (cur->name != NULL) {
if (!xmlStrcmp(cur->name, BAD_CAST"meta")) {
if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
xmlAttrPtr attr = cur->properties;
int http;
const xmlChar *value;
......
......@@ -1387,7 +1387,7 @@ checkNamespace(void *ctx, xmlChar *namespace)
"End tags %s holds a prefix %s not used by the open tag\n",
cur->name, namespace);
ctxt->wellFormed = 0;
} else if (xmlStrcmp(namespace, cur->ns->prefix)) {
} else if (!xmlStrEqual(namespace, cur->ns->prefix)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt,
"Start and End tags for %s don't use the same namespaces: %s and %s\n",
......
......@@ -6,19 +6,11 @@
TODO:
=====
- cleanup the mess with URI references when composing entities.
- performances: there is still improvements needed when parsing Docbook DTD
a single function to optimize/avoid.
- Moving all deprecated functions to a different module, allow to compile
it out.
- DOM needs
int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr);
- listing all attributes in a node.
- General checking of DTD validation in presence of namespaces ... hairy
mostly done
- Fix DTD + namespace validity problem
"Not valid: root and DtD name do not match 'ROOT' and 'prefix:ROOT'"
mostly done
- Correct standalone checking/emitting (hard)
2.9 Standalone Document Declaration
- Better checking of external parsed entities TAG 1234
......@@ -38,6 +30,9 @@ TODO:
- jamesh suggestion: SAX like functions to save a document ie. call a
function to open a new element with given attributes, write character
data, close last element, etc
- HTML: handling of Script data elements/attributes, need special code in
the parser and saving functions (handling of < > " ' ...):
http://www.w3.org/TR/html4/types.html#type-script
TODO:
=====
......
......@@ -6,7 +6,7 @@ AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=2
LIBXML_MICRO_VERSION=3
LIBXML_MICRO_VERSION=4
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
......
......@@ -1491,14 +1491,14 @@ xmlShellPwd(xmlShellCtxtPtr ctxt, char *buffer, xmlNodePtr node,
*/
tmp = cur->prev;
while (tmp != NULL) {
if (!xmlStrcmp(cur->name, tmp->name))
if (xmlStrEqual(cur->name, tmp->name))
occur++;
tmp = tmp->prev;
}
if (occur == 0) {
tmp = cur->next;
while (tmp != NULL) {
if (!xmlStrcmp(cur->name, tmp->name))
if (xmlStrEqual(cur->name, tmp->name))
occur++;
tmp = tmp->next;
}
......
......@@ -114,7 +114,7 @@ xmlAddEntity(xmlEntitiesTablePtr table, const xmlChar *name, int type,
hash = xmlEntityComputeHash(name);
ret = table->table[hash];
while (ret != NULL) {
if (!xmlStrcmp(ret->name, name)) {
if (xmlStrEqual(ret->name, name)) {
/*
* The entity is already defined in this Dtd, the spec says to NOT
* override it ... Is it worth a Warning ??? !!!
......@@ -137,7 +137,7 @@ xmlAddEntity(xmlEntitiesTablePtr table, const xmlChar *name, int type,
#else
for (i = 0;i < table->nb_entities;i++) {
ret = table->table[i];
if (!xmlStrcmp(ret->name, name)) {
if (xmlStrEqual(ret->name, name)) {
/*
* The entity is already defined in this Dtd, the spec says to NOT
* override it ... Is it worth a Warning ??? !!!
......@@ -268,14 +268,14 @@ xmlGetPredefinedEntity(const xmlChar *name) {
i = xmlEntityComputeHash(name);
cur = xmlPredefinedEntities->table[i];
while (cur != NULL) {
if (!xmlStrcmp(cur->name, name))
if (xmlStrEqual(cur->name, name))
return(cur);
cur = cur->nexte;
}
#else
for (i = 0;i < xmlPredefinedEntities->nb_entities;i++) {
cur = xmlPredefinedEntities->table[i];
if (!xmlStrcmp(cur->name, name)) return(cur);
if (xmlStrEqual(cur->name, name)) return(cur);
}
#endif
return(NULL);
......@@ -425,7 +425,7 @@ xmlEntityCheckReference(xmlEntityPtr ent, const xmlChar *to) {
for (i = 0;i < ent->entNr;i++) {
xmlEntityPtr indir = NULL;
if (!xmlStrcmp(to, ent->entTab[i]))
if (xmlStrEqual(to, ent->entTab[i]))
return(1);
switch (ent->etype) {
......@@ -485,7 +485,7 @@ xmlEntityAddReference(xmlEntityPtr ent, const xmlChar *to) {
}
for (i = 0;i < ent->entNr;i++) {
if (!xmlStrcmp(to, ent->entTab[i]))
if (xmlStrEqual(to, ent->entTab[i]))
return(0);
}
......@@ -552,10 +552,10 @@ xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name,
switch (cur->etype) {
case XML_INTERNAL_PARAMETER_ENTITY:
case XML_EXTERNAL_PARAMETER_ENTITY:
if ((parameter) && (!xmlStrcmp(cur->name, name)))
if ((parameter) && (xmlStrEqual(cur->name, name)))
return(cur);
default:
if ((!parameter) && (!xmlStrcmp(cur->name, name)))
if ((!parameter) && (xmlStrEqual(cur->name, name)))
return(cur);
}
cur = cur->nexte;
......@@ -568,10 +568,10 @@ xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name,
switch (cur->etype) {
case XML_INTERNAL_PARAMETER_ENTITY:
case XML_EXTERNAL_PARAMETER_ENTITY:
if ((parameter) && (!xmlStrcmp(cur->name, name)))
if ((parameter) && (xmlStrEqual(cur->name, name)))
return(cur);
default:
if ((!parameter) && (!xmlStrcmp(cur->name, name)))
if ((!parameter) && (xmlStrEqual(cur->name, name)))
return(cur);
}
}
......
......@@ -348,6 +348,8 @@ int xmlStrcasecmp (const xmlChar *str1,
int xmlStrncasecmp (const xmlChar *str1,
const xmlChar *str2,
int len);
int xmlStrEqual (const xmlChar *str1,
const xmlChar *str2);
int xmlStrlen (const xmlChar *str);
xmlChar * xmlStrcat (xmlChar *cur,
const xmlChar *add);
......
......@@ -1020,6 +1020,28 @@ xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
return 0;
}
/**
* xmlStrEqual:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
*
* Check if both string are equal of have same content
* Should be a bit more readable and faster than xmlStrEqual()
*
* Returns 1 if they are equal, 0 if they are different
*/
int
xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
if (str1 == str2) return(1);
if (str1 == NULL) return(0);
if (str2 == NULL) return(0);
do {
if (*str1++ != *str2) return(0);
} while (*str2++);
return(1);
}
/**
* xmlStrncmp:
* @str1: the first xmlChar *
......@@ -2649,7 +2671,7 @@ xmlParsePITarget(xmlParserCtxtPtr ctxt) {
}
for (i = 0;;i++) {
if (xmlW3CPIs[i] == NULL) break;
if (!xmlStrcmp(name, (const xmlChar *)xmlW3CPIs[i]))
if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
return(name);
}
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) {
......@@ -4696,7 +4718,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
*/
if ((value != NULL) &&
(value[1] == 0) && (value[0] == '<') &&
(!xmlStrcmp(ent->name, BAD_CAST "lt"))) {
(xmlStrEqual(ent->name, BAD_CAST "lt"))) {
/*
* DONE: get definite answer on this !!!
* Lots of entity decls are used to declare a single
......@@ -4991,7 +5013,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
*/
else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
(ent != NULL) &&
(xmlStrcmp(ent->name, BAD_CAST "lt")) &&
(!xmlStrEqual(ent->name, BAD_CAST "lt")) &&
(ent->content != NULL) &&
(xmlStrchr(ent->content, '<'))) {
ctxt->errNo = XML_ERR_LT_IN_ATTRIBUTE;
......@@ -5183,7 +5205,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
*/
else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
(ent != NULL) &&
(xmlStrcmp(ent->name, BAD_CAST "lt")) &&
(!xmlStrEqual(ent->name, BAD_CAST "lt")) &&
(ent->content != NULL) &&
(xmlStrchr(ent->content, '<'))) {
ctxt->errNo = XML_ERR_LT_IN_ATTRIBUTE;
......@@ -5710,7 +5732,7 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) {
* No more registered as an error, just generate a warning now
* since this was deprecated in XML second edition
*/
if ((ctxt->pedantic) && (!xmlStrcmp(name, BAD_CAST "xml:lang"))) {
if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
if (!xmlCheckLanguageID(val)) {
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt->userData,
......@@ -5721,10 +5743,10 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) {
/*
* Check that xml:space conforms to the specification
*/
if (!xmlStrcmp(name, BAD_CAST "xml:space")) {
if (!xmlStrcmp(val, BAD_CAST "default"))
if (xmlStrEqual(name, BAD_CAST "xml:space")) {
if (xmlStrEqual(val, BAD_CAST "default"))
*(ctxt->space) = 0;
else if (!xmlStrcmp(val, BAD_CAST "preserve"))
else if (xmlStrEqual(val, BAD_CAST "preserve"))
*(ctxt->space) = 1;
else {
ctxt->errNo = XML_ERR_ATTRIBUTE_WITHOUT_VALUE;
......@@ -5815,7 +5837,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
* start-tag or empty-element tag.
*/
for (i = 0; i < nbatts;i += 2) {
if (!xmlStrcmp(atts[i], attname)) {
if (xmlStrEqual(atts[i], attname)) {
ctxt->errNo = XML_ERR_ATTRIBUTE_REDEFINED;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
......@@ -5952,7 +5974,7 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt) {
*
*/
if ((name == NULL) || (ctxt->name == NULL) ||
(xmlStrcmp(name, ctxt->name))) {
(!xmlStrEqual(name, ctxt->name))) {
ctxt->errNo = XML_ERR_TAG_NAME_MISMATCH;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
if ((name != NULL) && (ctxt->name != NULL)) {
......
......@@ -348,6 +348,8 @@ int xmlStrcasecmp (const xmlChar *str1,
int xmlStrncasecmp (const xmlChar *str1,
const xmlChar *str2,
int len);
int xmlStrEqual (const xmlChar *str1,
const xmlChar *str2);
int xmlStrlen (const xmlChar *str);
xmlChar * xmlStrcat (xmlChar *cur,
const xmlChar *add);
......
Object is a Node Set :
Set contains 1 nodes:
1 ELEMENT ITEM
ATTRIBUTE monto
TEXT
content=50.12
ATTRIBUTE divisa
TEXT
content=DOL
<?xml version="1.0"?>
<BODY>
<DECLARACION importador="123456789" fecha="08/09/2000"
monto_factura="100.09">
<ITEM monto="50.12" divisa="DOL">
<SUFIJO codigo="NL34" valor="negro"/>
<SUFIJO codigo="AS34" valor="grande"/>
</ITEM>
</DECLARACION>
<FIRMA>N</FIRMA>
</BODY>
......@@ -164,14 +164,14 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) {
xmlNsPtr prev = node->nsDef;
if (((prev->prefix == NULL) && (cur->prefix == NULL)) ||
(!xmlStrcmp(prev->prefix, cur->prefix))) {
(xmlStrEqual(prev->prefix, cur->prefix))) {
xmlFreeNs(cur);
return(NULL);
}
while (prev->next != NULL) {
prev = prev->next;
if (((prev->prefix == NULL) && (cur->prefix == NULL)) ||
(!xmlStrcmp(prev->prefix, cur->prefix))) {
(xmlStrEqual(prev->prefix, cur->prefix))) {
xmlFreeNs(cur);
return(NULL);
}
......@@ -2687,11 +2687,11 @@ xmlNodeGetSpacePreserve(xmlNodePtr cur) {
while (cur != NULL) {
space = xmlGetProp(cur, BAD_CAST "xml:space");
if (space != NULL) {
if (!xmlStrcmp(space, BAD_CAST "preserve")) {
if (xmlStrEqual(space, BAD_CAST "preserve")) {
xmlFree(space);
return(1);
}
if (!xmlStrcmp(space, BAD_CAST "default")) {
if (xmlStrEqual(space, BAD_CAST "default")) {
xmlFree(space);
return(0);
}
......@@ -3194,7 +3194,7 @@ xmlGetNsList(xmlDocPtr doc, xmlNodePtr node) {
}
for (i = 0;i < nbns;i++) {
if ((cur->prefix == ret[i]->prefix) ||
(!xmlStrcmp(cur->prefix, ret[i]->prefix))) break;
(xmlStrEqual(cur->prefix, ret[i]->prefix))) break;
}
if (i >= nbns) {
if (nbns >= maxns) {
......@@ -3251,7 +3251,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
return(cur);
if ((cur->prefix != NULL) && (nameSpace != NULL) &&
(cur->href != NULL) &&
(!xmlStrcmp(cur->prefix, nameSpace)))
(xmlStrEqual(cur->prefix, nameSpace)))
return(cur);
cur = cur->next;
}
......@@ -3281,7 +3281,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar *href) {
cur = node->nsDef;
while (cur != NULL) {
if ((cur->href != NULL) && (href != NULL) &&
(!xmlStrcmp(cur->href, href))) {
(xmlStrEqual(cur->href, href))) {
/*
* Check that the prefix is not shadowed between orig and node
*/
......@@ -3294,7 +3294,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar *href) {
if ((tst->prefix == NULL) && (cur->prefix == NULL))
goto shadowed;
if ((tst->prefix != NULL) && (cur->prefix != NULL) &&
(!xmlStrcmp(tst->prefix, cur->prefix)))
(xmlStrEqual(tst->prefix, cur->prefix)))
goto shadowed;
tst = tst->next;
}
......@@ -3576,7 +3576,7 @@ xmlHasProp(xmlNodePtr node, const xmlChar *name) {
*/
prop = node->properties;
while (prop != NULL) {
if (!xmlStrcmp(prop->name, name)) {
if (xmlStrEqual(prop->name, name)) {
return(prop);
}
prop = prop->next;
......@@ -3625,7 +3625,7 @@ xmlGetProp(xmlNodePtr node, const xmlChar *name) {
*/