*
*/
+/* To avoid EBCDIC trouble when parsing on zOS */
+#if defined(__MVS__)
+#pragma convert("ISO8859-1")
+#endif
+
#define IN_LIBXML
#include "libxml.h"
#include <string.h> /* for memset() only ! */
+#include <stddef.h>
#include <limits.h>
#ifdef HAVE_CTYPE_H
#include <ctype.h>
*
* [NS 7] LocalPart ::= NCName
*
- * Returns NULL if not a QName, otherwise the local part, and prefix
- * is updated to get the Prefix if any.
+ * Returns NULL if the name doesn't have a prefix. Otherwise, returns the
+ * local part, and prefix is updated to get the Prefix. Both the return value
+ * and the prefix must be freed by the caller.
*/
-
xmlChar *
xmlSplitQName2(const xmlChar *name, xmlChar **prefix) {
int len = 0;
else if ((ent != NULL) && (ent->children == NULL)) {
xmlNodePtr temp;
+ /* Set to non-NULL value to avoid recursion. */
+ ent->children = (xmlNodePtr) -1;
ent->children = xmlStringGetNodeList(doc,
(const xmlChar*)node->content);
ent->owner = 1;
else if ((ent != NULL) && (ent->children == NULL)) {
xmlNodePtr temp;
+ /* Set to non-NULL value to avoid recursion. */
ent->children = (xmlNodePtr) -1;
ent->children = xmlStringGetNodeList(doc,
(const xmlChar*)node->content);
temp = ent->children;
while (temp) {
temp->parent = (xmlNodePtr)ent;
+ ent->last = temp;
temp = temp->next;
}
}
(node->type == XML_PI_NODE)) {
if (node->line == 65535) {
if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
- result = (long) node->psvi;
+ result = (long) (ptrdiff_t) node->psvi;
else if ((node->type == XML_ELEMENT_NODE) &&
(node->children != NULL))
result = xmlGetLineNoInternal(node->children, depth + 1);
if (occur == 0) {
tmp = cur->next;
while (tmp != NULL && occur == 0) {
- if (tmp->type == XML_COMMENT_NODE)
- occur++;
+ if (tmp->type == XML_COMMENT_NODE)
+ occur++;
tmp = tmp->next;
}
if (occur != 0)
ns = ns->next;
} while (ns != NULL);
}
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
if (node->ns != NULL) {
/*
}
if (! adoptns)
goto ns_end;
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
/* No ns, no fun. */
if (cur->ns == NULL)
goto internal_error;
}
}
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
/* No namespace, no fun. */
if (cur->ns == NULL)