added a parser XML_PARSE_COMPACT option to allocate small text nodes (less
* HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c
xmllint.c include/libxml/HTMLparser.h include/libxml/parser.h:
added a parser XML_PARSE_COMPACT option to allocate small
text nodes (less than 8 bytes on 32bits, less than 16bytes on 64bits)
directly within the node, various changes to cope with this.
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: this
slightly change the output
Daniel
diff --git a/parser.c b/parser.c
index 44e6180..6a905a0 100644
--- a/parser.c
+++ b/parser.c
@@ -684,7 +684,7 @@
}
/*
- * plit the element name into prefix:localname , the string found
+ * Split the element name into prefix:localname , the string found
* are within the DTD and hen not associated to namespace names.
*/
name = xmlSplitQName3(fullattr, &len);
@@ -11319,8 +11319,9 @@
*lst = cur;
while (cur != NULL) {
#ifdef LIBXML_VALID_ENABLED
- if (oldctxt->validate && oldctxt->wellFormed &&
- oldctxt->myDoc && oldctxt->myDoc->intSubset) {
+ if ((oldctxt->validate) && (oldctxt->wellFormed) &&
+ (oldctxt->myDoc) && (oldctxt->myDoc->intSubset) &&
+ (cur->type == XML_ELEMENT_NODE)) {
oldctxt->valid &= xmlValidateElement(&oldctxt->vctxt,
oldctxt->myDoc, cur);
}
@@ -12843,6 +12844,10 @@
ctxt->options |= XML_PARSE_NONET;
options -= XML_PARSE_NONET;
}
+ if (options & XML_PARSE_COMPACT) {
+ ctxt->options |= XML_PARSE_COMPACT;
+ options -= XML_PARSE_COMPACT;
+ }
ctxt->linenumbers = 1;
return (options);
}