Release of libxml-1.1, Daniel.
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index 217edbc..3c5cee0 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -51,8 +51,8 @@
     XML_CHAR_ENCODING_EUC_JP=   21,/* EUC-JP */
 } xmlCharEncoding;
 
-extern xmlCharEncoding xmlDetectCharEncoding(unsigned char* in);
-extern xmlCharEncoding xmlParseCharEncoding(char* name);
+extern xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in);
+extern xmlCharEncoding xmlParseCharEncoding(const char* name);
 
 #ifdef __cplusplus
 }
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index 5d6506d..b653542 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -34,6 +34,7 @@
     const CHAR    *ExternalID;	/* External identifier for PUBLIC Entity */
     const CHAR    *SystemID;	/* URI for a SYSTEM or PUBLIC Entity */
     CHAR *content;		/* The entity content or ndata if unparsed */
+    CHAR *orig;			/* The entity cont without ref substitution */
 } xmlEntity;
 typedef xmlEntity *xmlEntityPtr;
 
@@ -70,8 +71,6 @@
 xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
 void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
 void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table);
-xmlParserInputPtr xmlNewEntityInputStream(xmlParserCtxtPtr ctxt,
-                                                 xmlEntityPtr entity);
 xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
 
 #ifdef __cplusplus
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 2075607..aaab58c 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -54,6 +54,7 @@
     void            *userData;        /* the document being built */
     xmlDocPtr           myDoc;        /* the document being built */
     int            wellFormed;        /* is the document well formed */
+    int       replaceEntities;        /* shall we replace entities ? */
     const CHAR     *version;	      /* the XML version string */
     const CHAR     *encoding;         /* encoding, if any */
     int             standalone;       /* standalone document */
@@ -194,6 +195,7 @@
 xmlDocPtr xmlParseDoc(CHAR *cur);
 xmlDocPtr xmlParseMemory(char *buffer, int size);
 xmlDocPtr xmlParseFile(const char *filename);
+int xmlSubstituteEntitiesDefault(int val);
 
 /*
  * Recovery mode 
@@ -211,6 +213,9 @@
                                    int size, int recovery);
 xmlDocPtr xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
                                  int recovery);
+xmlDtdPtr xmlParseDTD(const CHAR *ExternalID, const CHAR *SystemID);
+xmlDtdPtr xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
+                         const CHAR *SystemID);
 void xmlInitParserCtxt(xmlParserCtxtPtr ctxt);
 void xmlClearParserCtxt(xmlParserCtxtPtr ctxt);
 void xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const CHAR* buffer,
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index 75e9e13..6a31c51 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -495,6 +495,13 @@
 
 #define MOVETO_STARTTAG(p)						\
     while (IS_CHAR(*p) && (*(p) != '<')) (p)++
+
+/**
+ * entity substitution default behaviour.
+ */
+
+int xmlSubstituteEntitiesDefaultValue;
+
 /**
  * Parser context
  */
@@ -524,6 +531,8 @@
 xmlPopInput(xmlParserCtxtPtr ctxt);
 void
 xmlFreeInputStream(xmlParserInputPtr input);
+xmlParserInputPtr
+xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename);
 
 /**
  * Namespaces.
@@ -549,7 +558,7 @@
 CHAR *
 xmlParseNmtoken(xmlParserCtxtPtr ctxt);
 CHAR *
-xmlParseEntityValue(xmlParserCtxtPtr ctxt);
+xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig);
 CHAR *
 xmlParseAttValue(xmlParserCtxtPtr ctxt);
 CHAR *
@@ -593,13 +602,13 @@
 xmlParseElementDecl(xmlParserCtxtPtr ctxt);
 void
 xmlParseMarkupDecl(xmlParserCtxtPtr ctxt);
-CHAR *
+int
 xmlParseCharRef(xmlParserCtxtPtr ctxt);
-CHAR *
+xmlEntityPtr
 xmlParseEntityRef(xmlParserCtxtPtr ctxt);
-CHAR *
+void
 xmlParseReference(xmlParserCtxtPtr ctxt);
-CHAR *
+void
 xmlParsePEReference(xmlParserCtxtPtr ctxt);
 void
 xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt);
@@ -631,6 +640,18 @@
 xmlParseMisc(xmlParserCtxtPtr ctxt);
 
 /*
+ * Entities substitution
+ */
+#define XML_SUBSTITUTE_NONE	0
+#define XML_SUBSTITUTE_REF	1
+#define XML_SUBSTITUTE_PEREF	2
+#define XML_SUBSTITUTE_BOTH 	3
+
+CHAR *
+xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
+                  CHAR end, CHAR  end2, CHAR end3);
+
+/*
  * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP
  */
 extern int nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value);
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index ff6b55f..5907e24 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -362,6 +362,7 @@
  */
 void xmlBufferWriteCHAR(xmlBufferPtr buf, const CHAR *string);
 void xmlBufferWriteChar(xmlBufferPtr buf, const char *string);
+void xmlBufferWriteQuotedString(xmlBufferPtr buf, const CHAR *string);
 
 /*
  * Saving