aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-05-08 10:41:44 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-05-08 10:41:44 +0000
commit257d910769a947304f8f21cde466f5d2da42ee4c (patch)
tree0a31503d1b4ecb58cf77e7ffdb29f8908a2cd6cc
parent083c2660f4f5582f5cd8da1029b60a47177c31fb (diff)
downloadandroid_external_libxml2-257d910769a947304f8f21cde466f5d2da42ee4c.tar.gz
android_external_libxml2-257d910769a947304f8f21cde466f5d2da42ee4c.tar.bz2
android_external_libxml2-257d910769a947304f8f21cde466f5d2da42ee4c.zip
- parser.c: added xmlParseExternalEntityPrivate() to allow
propagation of ctxt->_private when parsing external entities Daniel
-rw-r--r--ChangeLog5
-rw-r--r--parser.c53
2 files changed, 47 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 7088a59a..b6507532 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 8 12:31:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * parser.c: added xmlParseExternalEntityPrivate() to allow
+ propagation of ctxt->_private when parsing external entities
+
Tue May 8 10:26:22 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* HTMLtree.c: fixed the bug reported by Bjorn in htmlNodeDump
diff --git a/parser.c b/parser.c
index faa28536..95e7c0a6 100644
--- a/parser.c
+++ b/parser.c
@@ -109,6 +109,10 @@ void xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
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 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
} 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 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
}
/**
- * 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 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
* @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 @@ xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
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(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
}
/**
+ * 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)