- parser.c: added xmlParseExternalEntityPrivate() to allow
  propagation of ctxt->_private when parsing external entities
Daniel
diff --git a/parser.c b/parser.c
index faa2853..95e7c0a 100644
--- a/parser.c
+++ b/parser.c
@@ -109,6 +109,10 @@
 xmlEntityPtr xmlParseStringPEReference(xmlParserCtxtPtr ctxt,
                                        const xmlChar **str);
 
+static int
+xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax,
+		      void *user_data, int depth, const xmlChar *URL,
+		      const xmlChar *ID, xmlNodePtr *list, void *private);
 
 /************************************************************************
  *									*
@@ -4992,9 +4996,10 @@
 		    } else if (ent->etype ==
 			       XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
 			ctxt->depth++;
-			ret = xmlParseExternalEntity(ctxt->myDoc,
+			ret = xmlParseExternalEntityPrivate(ctxt->myDoc,
 				   ctxt->sax, NULL, ctxt->depth,
-				   ent->URI, ent->ExternalID, &list);
+				   ent->URI, ent->ExternalID, &list,
+				   ctxt->_private);
 			ctxt->depth--;
 		    } else {
 			ret = -1;
@@ -8912,7 +8917,7 @@
 }
 
 /**
- * xmlParseExternalEntity:
+ * xmlParseExternalEntityPrivate:
  * @doc:  the document the chunk pertains to
  * @sax:  the SAX handler bloc (possibly NULL)
  * @user_data:  The user data returned on SAX callbacks (possibly NULL)
@@ -8920,20 +8925,18 @@
  * @URL:  the URL for the entity to load
  * @ID:  the System ID for the entity to load
  * @list:  the return value for the set of parsed nodes
+ * @private:  extra field for the _private parser context
  *
- * Parse an external general entity
- * An external general parsed entity is well-formed if it matches the
- * production labeled extParsedEnt.
- *
- * [78] extParsedEnt ::= TextDecl? content
+ * Private version of xmlParseExternalEntity()
  *
  * Returns 0 if the entity is well formed, -1 in case of args problem and
  *    the parser error code otherwise
  */
 
-int
-xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
-	  int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list) {
+static int
+xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax,
+		      void *user_data, int depth, const xmlChar *URL,
+		      const xmlChar *ID, xmlNodePtr *list, void *private) {
     xmlParserCtxtPtr ctxt;
     xmlDocPtr newDoc;
     xmlSAXHandlerPtr oldsax = NULL;
@@ -8956,6 +8959,7 @@
     ctxt = xmlCreateEntityParserCtxt(URL, ID, NULL);
     if (ctxt == NULL) return(-1);
     ctxt->userData = ctxt;
+    ctxt->_private = private;
     if (sax != NULL) {
 	oldsax = ctxt->sax;
         ctxt->sax = sax;
@@ -9071,6 +9075,33 @@
 }
 
 /**
+ * xmlParseExternalEntity:
+ * @doc:  the document the chunk pertains to
+ * @sax:  the SAX handler bloc (possibly NULL)
+ * @user_data:  The user data returned on SAX callbacks (possibly NULL)
+ * @depth:  Used for loop detection, use 0
+ * @URL:  the URL for the entity to load
+ * @ID:  the System ID for the entity to load
+ * @list:  the return value for the set of parsed nodes
+ *
+ * Parse an external general entity
+ * An external general parsed entity is well-formed if it matches the
+ * production labeled extParsedEnt.
+ *
+ * [78] extParsedEnt ::= TextDecl? content
+ *
+ * Returns 0 if the entity is well formed, -1 in case of args problem and
+ *    the parser error code otherwise
+ */
+
+int
+xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
+	  int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list) {
+    return(xmlParseExternalEntityPrivate(doc, sax, user_data, depth, URL,
+		                       ID, list, NULL));
+}
+
+/**
  * xmlParseBalancedChunkMemory:
  * @doc:  the document the chunk pertains to
  * @sax:  the SAX handler bloc (possibly NULL)