added help for new set shell command added parser option to not generate
* debugXML.c: added help for new set shell command
* xinclude.c xmllint.c xmlreader.c include/libxml/parser.h:
added parser option to not generate XInclude start/end nodes,
added a specific option to xmllint to test it fixes #130769
* Makefile.am: regression test the new feature
* doc/xmllint.1 doc/xmllint.xml: updated man page to document option.
Daniel
diff --git a/xinclude.c b/xinclude.c
index aa14b2c..f43a2e8 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -2116,28 +2116,43 @@
}
}
- /*
- * Change the current node as an XInclude start one, and add an
- * entity end one
- */
- cur->type = XML_XINCLUDE_START;
- end = xmlNewNode(cur->ns, cur->name);
- if (end == NULL) {
- xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_BUILD_FAILED,
- "failed to build node\n", NULL);
- return(-1);
- }
- end->type = XML_XINCLUDE_END;
- xmlAddNextSibling(cur, end);
+ if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) {
+ /*
+ * Add the list of nodes
+ */
+ while (list != NULL) {
+ end = list;
+ list = list->next;
- /*
- * Add the list of nodes
- */
- while (list != NULL) {
- cur = list;
- list = list->next;
+ xmlAddPrevSibling(cur, end);
+ }
+ xmlUnlinkNode(cur);
+ xmlFreeNode(cur);
+ } else {
+ /*
+ * Change the current node as an XInclude start one, and add an
+ * XInclude end one
+ */
+ cur->type = XML_XINCLUDE_START;
+ end = xmlNewNode(cur->ns, cur->name);
+ if (end == NULL) {
+ xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
+ XML_XINCLUDE_BUILD_FAILED,
+ "failed to build node\n", NULL);
+ return(-1);
+ }
+ end->type = XML_XINCLUDE_END;
+ xmlAddNextSibling(cur, end);
- xmlAddPrevSibling(end, cur);
+ /*
+ * Add the list of nodes
+ */
+ while (list != NULL) {
+ cur = list;
+ list = list->next;
+
+ xmlAddPrevSibling(end, cur);
+ }
}