Release of libxml-1.1, Daniel.
diff --git a/ChangeLog b/ChangeLog
index 2331fd7..e35c9e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Jun  2 19:40:58 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
+
+	* Release of libxml-1.1, nearly everything has been touched for
+	  this.
+	* Added more regression tests
+	* Updated the documentation
+
 Sat May 29 13:34:42 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
 
 	* tree.[ch]: unified the XML_NO_CORBA defines.
diff --git a/Makefile.am b/Makefile.am
index beae84e..75e7534 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,7 @@
 
 INCLUDES = -I@srcdir@ @CORBA_CFLAGS@
 
-noinst_PROGRAMS=tester
+noinst_PROGRAMS=tester testSAX
 
 bin_SCRIPTS=xml-config
 
@@ -39,29 +39,82 @@
 tester_DEPENDENCIES = $(DEPS)
 tester_LDADD= $(LDADDS)
 
+testSAX_SOURCES=testSAX.c
+testSAX_LDFLAGS = 
+testSAX_DEPENDENCIES = $(DEPS)
+testSAX_LDADD= $(LDADDS)
+
 check-local: tests
 
+testall : tests SVGtests SAXtests
+
 tests : tester
-	@(for i in $(srcdir)/test/* ; do \
+	@(DIR=`pwd`; cd $(srcdir) ;  \
+	  for i in test/* ; do \
 	  if [ ! -d $$i ] ; then \
-	  j=`echo $$i | sed -e 's,^.*/,,'`; \
-	  if [ ! -f $(srcdir)/result/$$j ] ; then \
-	      echo New test file $$j ; \
-	      ./tester $$i > $(srcdir)/result/$$j ; \
+	  if [ ! -f result/`basename $$i` ] ; then \
+	      echo New test file `basename $$i` ; \
+	      $$DIR/tester $$i > result/`basename $$i` ; \
 	  else \
-	      echo Testing $$j ; \
-	      ./tester $$i > result.$$j ; \
-	      diff $(srcdir)/result/$$j result.$$j ; \
-	      rm result.$$j ; \
+	      echo Testing `basename $$i` ; \
+	      $$DIR/tester $$i > result.`basename $$i` ; \
+	      diff result/`basename $$i` result.`basename $$i` ; \
+	      $$DIR/tester result.`basename $$i` > result2.`basename $$i` ; \
+	      diff result.`basename $$i` result2.`basename $$i` ; \
+	      rm result.`basename $$i` result2.`basename $$i` ; \
 	  fi ; fi ; done)
 
+SVGtests : tester
+	@(DIR=`pwd`; cd $(srcdir) ;  \
+	  for i in test/SVG/* ; do \
+	  if [ ! -d $$i ] ; then \
+	  if [ ! -f result/SVG/`basename $$i` ] ; then \
+	      echo New test file `basename $$i` ; \
+	      $$DIR/tester $$i > result/SVG/`basename $$i` ; \
+	  else \
+	      echo Testing `basename $$i` ; \
+	      $$DIR/tester $$i > result.`basename $$i` ; \
+	      diff result/SVG/`basename $$i` result.`basename $$i` ; \
+	      $$DIR/tester result.`basename $$i` > result2.`basename $$i` ; \
+	      diff result.`basename $$i` result2.`basename $$i` ; \
+	      rm result.`basename $$i` result2.`basename $$i` ; \
+	  fi ; fi ; done)
+
+SAXtests : testSAX
+	@(DIR=`pwd`; cd $(srcdir) ;  \
+	  for i in test/* ; do \
+	  if [ ! -d $$i ] ; then \
+	  if [ ! -f SAXresult/`basename $$i` ] ; then \
+	      echo New test file `basename $$i` ; \
+	      $$DIR/testSAX $$i > SAXresult/`basename $$i` ; \
+	  else \
+	      echo Testing `basename $$i` ; \
+	      $$DIR/testSAX $$i > result.`basename $$i` ; \
+	      diff SAXresult/`basename $$i` result.`basename $$i` ; \
+	      rm result.`basename $$i` ; \
+	  fi ; fi ; done)
+
+#tests : tester
+#	@(for i in $(srcdir)/test/* ; do \
+#	  if [ ! -d $$i ] ; then \
+#	  j=`echo $$i | sed -e 's,^.*/,,'`; \
+#	  if [ ! -f $(srcdir)/result/$$j ] ; then \
+#	      echo New test file $$j ; \
+#	      ./tester $$i > $(srcdir)/result/$$j ; \
+#	  else \
+#	      echo Testing $$j ; \
+#	      ./tester $$i > result.$$j ; \
+#	      diff $(srcdir)/result/$$j result.$$j ; \
+#	      rm result.$$j ; \
+#	  fi ; fi ; done)
+
 ## Put `exec' in the name because this should be installed by
 ## `install-exec', not `install-data'.
 
 confexecdir=$(libdir)
 confexec_DATA = xmlConf.sh
 
-EXTRA_DIST = xmlConf.sh.in libxml.spec.in test result
+EXTRA_DIST = xmlConf.sh.in libxml.spec.in test result SAXresult
 
 dist-hook:
 	cp libxml.spec $(distdir)
diff --git a/README b/README
index 39c315c..48aa403 100644
--- a/README
+++ b/README
@@ -10,5 +10,12 @@
 The list archive is at:
     http://rufus.w3.org/veillard/XML/messages/
 
+NOTE: I use a second CVS server for experimental version of the XML code,
+      this mean that if you commit without a Changelog or without sending
+      the patch to me or the list, it may well get lost. I usually check
+      before copying over the Gnome directory, but it may happen.
+
+    People interested in the bleeding edge or what I'm up to can check
+    at http://dev.w3.org/cgi-bin/cvsweb/XML/
 
 Daniel.Veillard@w3.org
diff --git a/SAX.c b/SAX.c
index 596f668..bd0caf5 100644
--- a/SAX.c
+++ b/SAX.c
@@ -19,7 +19,7 @@
 
 /**
  * getPublicId:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Return the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
  *
@@ -34,9 +34,9 @@
 
 /**
  * getSystemId:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
- * Return the system ID, basically URI or filename e.g.
+ * Return the system ID, basically URL or filename e.g.
  * http://www.sgmlsource.com/dtds/memo.dtd
  *
  * Returns a CHAR *
@@ -50,7 +50,7 @@
 
 /**
  * getLineNumber:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Return the line number of the current parsing point.
  *
@@ -65,7 +65,7 @@
 
 /**
  * getColumnNumber:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Return the column number of the current parsing point.
  *
@@ -88,7 +88,7 @@
 
 /**
  * isStandalone:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Is this document tagged standalone ?
  *
@@ -103,7 +103,7 @@
 
 /**
  * hasInternalSubset:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Does this document has an internal subset
  *
@@ -118,7 +118,7 @@
 
 /**
  * hasExternalSubset:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Does this document has an external subset
  *
@@ -133,7 +133,7 @@
 
 /**
  * hasInternalSubset:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Does this document has an internal subset
  */
@@ -141,17 +141,21 @@
 internalSubset(void *ctx, const CHAR *name,
 	       const CHAR *ExternalID, const CHAR *SystemID)
 {
+    xmlDtdPtr externalSubset;
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 #ifdef DEBUG_SAX
     fprintf(stderr, "SAX.internalSubset(%s, %s, %s)\n",
             name, ExternalID, SystemID);
 #endif
     xmlCreateIntSubset(ctxt->myDoc, name, ExternalID, SystemID);
+    if ((ExternalID != NULL) || (SystemID != NULL)) {
+        externalSubset = xmlParseDTD(ExternalID, SystemID);
+    }
 }
 
 /**
  * resolveEntity:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @publicId: The public ID of the entity
  * @systemId: The system ID of the entity
  *
@@ -166,7 +170,7 @@
 xmlParserInputPtr
 resolveEntity(void *ctx, const CHAR *publicId, const CHAR *systemId)
 {
-    /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
+    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 
 #ifdef DEBUG_SAX
     fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId);
@@ -175,17 +179,20 @@
     /*
      * TODO : not 100% sure that the appropriate handling in that case.
      */
+    if (systemId != NULL) {
+        return(xmlNewInputFromFile(ctxt, systemId));
+    }
     return(NULL);
 }
 
 /**
  * getEntity:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name: The entity name
  *
  * Get an entity by name
  *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
+ * Returns the xmlEntityPtr if found.
  */
 xmlEntityPtr
 getEntity(void *ctx, const CHAR *name)
@@ -204,7 +211,7 @@
 
 /**
  * entityDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  the entity name 
  * @type:  the entity type 
  * @publicId: The public ID of the entity
@@ -228,7 +235,7 @@
 
 /**
  * attributeDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  the attribute name 
  * @type:  the attribute type 
  * @publicId: The public ID of the attribute
@@ -254,7 +261,7 @@
 
 /**
  * elementDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  the element name 
  * @type:  the element type 
  * @publicId: The public ID of the element
@@ -278,7 +285,7 @@
 
 /**
  * notationDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name: The name of the notation
  * @publicId: The public ID of the entity
  * @systemId: The system ID of the entity
@@ -299,7 +306,7 @@
 
 /**
  * unparsedEntityDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name: The name of the entity
  * @publicId: The public ID of the entity
  * @systemId: The system ID of the entity
@@ -322,7 +329,7 @@
 
 /**
  * setDocumentLocator:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @loc: A SAX Locator
  *
  * Receive the document locator at startup, actually xmlDefaultSAXLocator
@@ -339,7 +346,7 @@
 
 /**
  * startDocument:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * called when the document start being processed.
  */
@@ -364,7 +371,7 @@
 
 /**
  * endDocument:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * called when the document end has been detected.
  */
@@ -379,7 +386,7 @@
 
 /**
  * attribute:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  The attribute name
  * @value:  The attribute value
  *
@@ -429,7 +436,7 @@
     }
 
     ret = xmlNewProp(ctxt->node, name, NULL);
-    if (ret != NULL)
+    if ((ret != NULL) && (ctxt->replaceEntities == 0))
 	ret->val = xmlStringGetNodeList(ctxt->myDoc, value);
     if (name != NULL) 
 	free(name);
@@ -439,7 +446,7 @@
 
 /**
  * startElement:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  The element name
  * @atts:  An array of name/value attributes pairs, NULL terminated
  *
@@ -529,7 +536,7 @@
 
 /**
  * endElement:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  The element name
  *
  * called when the end of an element has been detected.
@@ -564,7 +571,7 @@
 
 /**
  * reference:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  The entity name
  *
  * called when an entity reference is detected. 
@@ -584,7 +591,7 @@
 
 /**
  * characters:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @ch:  a CHAR string
  * @len: the number of CHAR
  *
@@ -621,7 +628,7 @@
 
 /**
  * ignorableWhitespace:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @ch:  a CHAR string
  * @len: the number of CHAR
  *
@@ -639,7 +646,7 @@
 
 /**
  * processingInstruction:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @target:  the target name
  * @data: the PI data's
  * @len: the number of CHAR
@@ -658,7 +665,7 @@
 
 /**
  * globalNamespace:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @href:  the namespace associated URN
  * @prefix: the namespace prefix
  *
@@ -676,7 +683,7 @@
 
 /**
  * setNamespace:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @name:  the namespace prefix
  *
  * Set the current element namespace.
@@ -704,7 +711,7 @@
 
 /**
  * getNamespace:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  *
  * Get the current element namespace.
  */
@@ -723,7 +730,7 @@
 
 /**
  * checkNamespace:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @namespace: the namespace to check against
  *
  * Check that the current element namespace is the same as the
@@ -771,7 +778,7 @@
 
 /**
  * namespaceDecl:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @href:  the namespace associated URN
  * @prefix: the namespace prefix
  *
@@ -792,7 +799,7 @@
 
 /**
  * comment:
- * @ctxt:  An XML parser context
+ * @ctx: the user data (XML parser context)
  * @value:  the comment content
  *
  * A comment has been parsed.
diff --git a/SAXresult/dav1 b/SAXresult/dav1
new file mode 100644
index 0000000..0d6b77d
--- /dev/null
+++ b/SAXresult/dav1
@@ -0,0 +1,100 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/', xmlns:R='http://www.foo.bar/boxschema')
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <R:bigbox>, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <R:bigbox>
+        <R:B, 7)
+SAX.startElement(R:bigbox)
+SAX.characters(
+        <R:BoxType>Box type A, 9)
+SAX.startElement(R:BoxType)
+SAX.characters(Box type A</R:BoxType>
+      <, 10)
+SAX.endElement(R:BoxType)
+SAX.characters(
+      </R:bigbox>
+      <R:au, 7)
+SAX.endElement(R:bigbox)
+SAX.characters(
+      <R:author>
+        <R:N, 7)
+SAX.startElement(R:author)
+SAX.characters(
+        <R:Name>J.J. Dinglehe, 9)
+SAX.startElement(R:Name)
+SAX.characters(J.J. Dingleheimerschmidt</R:Na, 24)
+SAX.endElement(R:Name)
+SAX.characters(
+      </R:author>
+    </D:pro, 7)
+SAX.endElement(R:author)
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <R:DingALi, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <R:DingALing/>
+      <R, 7)
+SAX.startElement(R:DingALing)
+SAX.endElement((null))
+SAX.characters(
+      <R:Random/>
+    </D:pro, 7)
+SAX.startElement(R:Random)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 403 Fo, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 403 Forbidden</D:stat, 22)
+SAX.endElement(D:status)
+SAX.characters(
+    <D:responsedescription> T, 5)
+SAX.startElement(D:responsedescription)
+SAX.characters( The user does not have access, 64)
+SAX.endElement(D:responsedescription)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:responsedescription> The, 3)
+SAX.startElement(D:responsedescription)
+SAX.characters( There has been an access viol, 44)
+SAX.endElement(D:responsedescription)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav10 b/SAXresult/dav10
new file mode 100644
index 0000000..e8a0e1e
--- /dev/null
+++ b/SAXresult/dav10
@@ -0,0 +1,13 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:owner, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:href>http://www.ics.uci., 3)
+SAX.startElement(D:href)
+SAX.characters(http://www.ics.uci.edu/~ejw/co, 40)
+SAX.endElement(D:href)
+SAX.characters(
+</D:owner>
+, 1)
+SAX.endElement(D:owner)
+SAX.endDocument()
diff --git a/SAXresult/dav11 b/SAXresult/dav11
new file mode 100644
index 0000000..e7a6c66
--- /dev/null
+++ b/SAXresult/dav11
@@ -0,0 +1,77 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:prop, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:lockdiscovery>
+    <D:ac, 3)
+SAX.startElement(D:lockdiscovery)
+SAX.characters(
+    <D:activelock>
+      <D:l, 5)
+SAX.startElement(D:activelock)
+SAX.characters(
+      <D:locktype>write</D:lo, 7)
+SAX.startElement(D:locktype)
+SAX.characters(write</D:locktype>
+      <D:lo, 5)
+SAX.endElement(D:locktype)
+SAX.characters(
+      <D:lockscope>exclusive<, 7)
+SAX.startElement(D:lockscope)
+SAX.characters(exclusive</D:lockscope>
+      , 9)
+SAX.endElement(D:lockscope)
+SAX.characters(
+      <D:addlocks/>
+      <D:, 7)
+SAX.startElement(D:addlocks)
+SAX.endElement((null))
+SAX.characters(
+      <D:owner>
+        <D:hr, 7)
+SAX.startElement(D:owner)
+SAX.characters(
+        <D:href>
+		http://www, 9)
+SAX.startElement(D:href)
+SAX.characters(
+		http://www.ics.uci.edu/~ejw, 46)
+SAX.endElement(D:href)
+SAX.characters(
+      </D:owner>
+      <D:tim, 7)
+SAX.endElement(D:owner)
+SAX.characters(
+      <D:timeout>Second-60480, 7)
+SAX.startElement(D:timeout)
+SAX.characters(Second-604800</D:timeout>
+    , 13)
+SAX.endElement(D:timeout)
+SAX.characters(
+      <D:locktoken>
+        <, 7)
+SAX.startElement(D:locktoken)
+SAX.characters(
+        <D:href>
+	   opaquelo, 9)
+SAX.startElement(D:href)
+SAX.characters(
+	   opaquelocktoken:xyz122393, 59)
+SAX.endElement(D:href)
+SAX.characters(
+      </D:locktoken>
+    </D:, 7)
+SAX.endElement(D:locktoken)
+SAX.characters(
+    </D:activelock>
+  </D:loc, 5)
+SAX.endElement(D:activelock)
+SAX.characters(
+  </D:lockdiscovery>
+</D:prop, 3)
+SAX.endElement(D:lockdiscovery)
+SAX.characters(
+</D:prop>
+, 1)
+SAX.endElement(D:prop)
+SAX.endDocument()
diff --git a/SAXresult/dav12 b/SAXresult/dav12
new file mode 100644
index 0000000..67b9f64
--- /dev/null
+++ b/SAXresult/dav12
@@ -0,0 +1,6 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:href, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(http://www.ics.uci.edu/~ejw/co, 40)
+SAX.endElement(D:href)
+SAX.endDocument()
diff --git a/SAXresult/dav13 b/SAXresult/dav13
new file mode 100644
index 0000000..e7f104d
--- /dev/null
+++ b/SAXresult/dav13
@@ -0,0 +1,55 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:response>
+    <D:href>
+	, 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>
+	   http://webda, 5)
+SAX.startElement(D:href)
+SAX.characters(
+	   http://webdav.sb.aol.com/, 66)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:href>
+	   http://webda, 5)
+SAX.startElement(D:href)
+SAX.characters(
+	   http://webdav.sb.aol.com/, 54)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:status>HTTP/1.1 202 Ac, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 202 Accepted</D:statu, 21)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:response>
+    <D:href>ht, 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>http://foo.bar/bl, 5)
+SAX.startElement(D:href)
+SAX.characters(http://foo.bar/blah</D:href>
+ , 19)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:status>HTTP/1.1 403 Fo, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 403 Forbidden</D:stat, 22)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+</D:multistat, 3)
+SAX.endElement(D:response)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav15 b/SAXresult/dav15
new file mode 100644
index 0000000..b3c545f
--- /dev/null
+++ b/SAXresult/dav15
@@ -0,0 +1,93 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:prop, xmlns:D='http://www.ietf.org/standards/dav/', xmlns:F='http://www.foocorp.com/Project/')
+SAX.characters(
+  <D:Source>
+    <D:link>
+   , 3)
+SAX.startElement(D:Source)
+SAX.characters(
+    <D:link>
+      <F:projfil, 5)
+SAX.startElement(D:link)
+SAX.characters(
+      <F:projfiles>Source</F:, 7)
+SAX.startElement(F:projfiles)
+SAX.characters(Source</F:projfiles>
+      <D:, 6)
+SAX.endElement(F:projfiles)
+SAX.characters(
+      <D:src>http://foo.bar/p, 7)
+SAX.startElement(D:src)
+SAX.characters(http://foo.bar/program</D:src>, 22)
+SAX.endElement(D:src)
+SAX.characters(
+      <D:dst>http://foo.bar/s, 7)
+SAX.startElement(D:dst)
+SAX.characters(http://foo.bar/src/main.c</D:d, 25)
+SAX.endElement(D:dst)
+SAX.characters(
+    </D:link>
+    <D:link>
+  , 5)
+SAX.endElement(D:link)
+SAX.characters(
+    <D:link>
+      <F:projfil, 5)
+SAX.startElement(D:link)
+SAX.characters(
+      <F:projfiles>Library</F, 7)
+SAX.startElement(F:projfiles)
+SAX.characters(Library</F:projfiles>
+      <D, 7)
+SAX.endElement(F:projfiles)
+SAX.characters(
+      <D:src>http://foo.bar/p, 7)
+SAX.startElement(D:src)
+SAX.characters(http://foo.bar/program</D:src>, 22)
+SAX.endElement(D:src)
+SAX.characters(
+      <D:dst>http://foo.bar/s, 7)
+SAX.startElement(D:dst)
+SAX.characters(http://foo.bar/src/main.lib</D, 27)
+SAX.endElement(D:dst)
+SAX.characters(
+    </D:link>
+    <D:link>
+  , 5)
+SAX.endElement(D:link)
+SAX.characters(
+    <D:link>
+      <F:projfil, 5)
+SAX.startElement(D:link)
+SAX.characters(
+      <F:projfiles>Makefile</, 7)
+SAX.startElement(F:projfiles)
+SAX.characters(Makefile</F:projfiles>
+      <, 8)
+SAX.endElement(F:projfiles)
+SAX.characters(
+      <D:src>http://foo.bar/p, 7)
+SAX.startElement(D:src)
+SAX.characters(http://foo.bar/program</D:src>, 22)
+SAX.endElement(D:src)
+SAX.characters(
+      <D:dst>http://foo.bar/s, 7)
+SAX.startElement(D:dst)
+SAX.characters(http://foo.bar/src/makefile</D, 27)
+SAX.endElement(D:dst)
+SAX.characters(
+    </D:link>
+  </D:Source>
+<, 5)
+SAX.endElement(D:link)
+SAX.characters(
+  </D:Source>
+</D:prop>
+, 3)
+SAX.endElement(D:Source)
+SAX.characters(
+</D:prop>
+, 1)
+SAX.endElement(D:prop)
+SAX.endDocument()
diff --git a/SAXresult/dav16 b/SAXresult/dav16
new file mode 100644
index 0000000..0c26b96
--- /dev/null
+++ b/SAXresult/dav16
@@ -0,0 +1,22 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:propfind, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:prop>
+    <lockdiscovery, 3)
+SAX.startElement(D:prop)
+SAX.characters(
+    <lockdiscovery/>
+  </D:pr, 5)
+SAX.startElement(lockdiscovery)
+SAX.endElement((null))
+SAX.characters(
+  </D:prop>
+</D:propfind>
+, 3)
+SAX.endElement(D:prop)
+SAX.characters(
+</D:propfind>
+, 1)
+SAX.endElement(D:propfind)
+SAX.endDocument()
diff --git a/SAXresult/dav17 b/SAXresult/dav17
new file mode 100644
index 0000000..6cbf882
--- /dev/null
+++ b/SAXresult/dav17
@@ -0,0 +1,99 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <D:lockdis, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <D:lockdiscovery>
+     , 7)
+SAX.startElement(D:lockdiscovery)
+SAX.characters(
+        <D:activelock>
+      , 9)
+SAX.startElement(D:activelock)
+SAX.characters(
+          <D:locktype>write</, 11)
+SAX.startElement(D:locktype)
+SAX.characters(write</D:locktype>
+          <, 5)
+SAX.endElement(D:locktype)
+SAX.characters(
+          <D:lockscope>exclus, 11)
+SAX.startElement(D:lockscope)
+SAX.characters(exclusive</D:lockscope>
+      , 9)
+SAX.endElement(D:lockscope)
+SAX.characters(
+          <D:addlocks>
+      , 11)
+SAX.startElement(D:addlocks)
+SAX.characters(
+            <D:href>http://fo, 13)
+SAX.startElement(D:href)
+SAX.characters(http://foo.com/doc/</D:href>
+ , 19)
+SAX.endElement(D:href)
+SAX.characters(
+          </D:addlocks>
+     , 11)
+SAX.endElement(D:addlocks)
+SAX.characters(
+          <D:owner>Jane Smith, 11)
+SAX.startElement(D:owner)
+SAX.characters(Jane Smith</D:owner>
+         , 10)
+SAX.endElement(D:owner)
+SAX.characters(
+          <D:timeout>Infinite, 11)
+SAX.startElement(D:timeout)
+SAX.characters(Infinite</D:timeout>
+         , 8)
+SAX.endElement(D:timeout)
+SAX.characters(
+          <D:locktoken>
+     , 11)
+SAX.startElement(D:locktoken)
+SAX.characters(
+            <D:href>iamuri:un, 13)
+SAX.startElement(D:href)
+SAX.characters(iamuri:unique!!!!!</D:href>
+  , 18)
+SAX.endElement(D:href)
+SAX.characters(
+          </D:locktoken>
+    , 11)
+SAX.endElement(D:locktoken)
+SAX.characters(
+        </D:activelock>
+     , 9)
+SAX.endElement(D:activelock)
+SAX.characters(
+      </D:lockdiscovery>
+    , 7)
+SAX.endElement(D:lockdiscovery)
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+</D:multistat, 3)
+SAX.endElement(D:response)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav18 b/SAXresult/dav18
new file mode 100644
index 0000000..6412a30
--- /dev/null
+++ b/SAXresult/dav18
@@ -0,0 +1,22 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:propfind, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:prop>
+    <supportedlock, 3)
+SAX.startElement(D:prop)
+SAX.characters(
+    <supportedlock/>
+  </D:pr, 5)
+SAX.startElement(supportedlock)
+SAX.endElement((null))
+SAX.characters(
+  </D:prop>
+</D:propfind>
+, 3)
+SAX.endElement(D:prop)
+SAX.characters(
+</D:propfind>
+, 1)
+SAX.endElement(D:propfind)
+SAX.endDocument()
diff --git a/SAXresult/dav19 b/SAXresult/dav19
new file mode 100644
index 0000000..d19bb10
--- /dev/null
+++ b/SAXresult/dav19
@@ -0,0 +1,79 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <D:support, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <D:supportedlock>
+     , 7)
+SAX.startElement(D:supportedlock)
+SAX.characters(
+        <D:LockEntry>
+       , 9)
+SAX.startElement(D:LockEntry)
+SAX.characters(
+          <D:locktype>Write</, 11)
+SAX.startElement(D:locktype)
+SAX.characters(Write</D:locktype>
+          <, 5)
+SAX.endElement(D:locktype)
+SAX.characters(
+          <D:lockscope>Exclus, 11)
+SAX.startElement(D:lockscope)
+SAX.characters(Exclusive</D:lockscope>
+      , 9)
+SAX.endElement(D:lockscope)
+SAX.characters(
+        </D:LockEntry>
+      , 9)
+SAX.endElement(D:LockEntry)
+SAX.characters(
+        <D:LockEntry>
+       , 9)
+SAX.startElement(D:LockEntry)
+SAX.characters(
+          <D:locktype>Write</, 11)
+SAX.startElement(D:locktype)
+SAX.characters(Write</D:locktype>
+          <, 5)
+SAX.endElement(D:locktype)
+SAX.characters(
+          <D:lockscope>Shared, 11)
+SAX.startElement(D:lockscope)
+SAX.characters(Shared</D:lockscope>
+        <, 6)
+SAX.endElement(D:lockscope)
+SAX.characters(
+        </D:LockEntry>
+      , 9)
+SAX.endElement(D:LockEntry)
+SAX.characters(
+      </D:supportedlock>
+    , 7)
+SAX.endElement(D:supportedlock)
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+</D:multistat, 3)
+SAX.endElement(D:response)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav2 b/SAXresult/dav2
new file mode 100644
index 0000000..28a069b
--- /dev/null
+++ b/SAXresult/dav2
@@ -0,0 +1,104 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(S:multistatus, xmlns:S='http://www.ietf.org/standards/dav/', xmlns:R='http://www.foo.bar/boxschema/')
+SAX.characters(
+  <S:response>
+    <S:href>ht, 3)
+SAX.startElement(S:response)
+SAX.characters(
+    <S:href>http://www.foo.ba, 5)
+SAX.startElement(S:href)
+SAX.characters(http://www.foo.bar/container/<, 29)
+SAX.endElement(S:href)
+SAX.characters(
+    <S:prop>
+      <R:bigbox>, 5)
+SAX.startElement(S:prop)
+SAX.characters(
+      <R:bigbox>
+        <R:B, 7)
+SAX.startElement(R:bigbox)
+SAX.characters(
+        <R:BoxType>Box type A, 9)
+SAX.startElement(R:BoxType)
+SAX.characters(Box type A</R:BoxType>
+      <, 10)
+SAX.endElement(R:BoxType)
+SAX.characters(
+      </R:bigbox>
+      <R:au, 7)
+SAX.endElement(R:bigbox)
+SAX.characters(
+      <R:author>
+        <R:N, 7)
+SAX.startElement(R:author)
+SAX.characters(
+        <R:Name>Hadrian</R:Na, 9)
+SAX.startElement(R:Name)
+SAX.characters(Hadrian</R:Name>
+      </R:aut, 7)
+SAX.endElement(R:Name)
+SAX.characters(
+      </R:author>
+    </S:pro, 7)
+SAX.endElement(R:author)
+SAX.characters(
+    </S:prop>
+    <S:status>H, 5)
+SAX.endElement(S:prop)
+SAX.characters(
+    <S:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(S:status)
+SAX.characters(HTTP 1.1 200 OK</S:status>
+  <, 15)
+SAX.endElement(S:status)
+SAX.characters(
+  </S:response>
+  <S:response, 3)
+SAX.endElement(S:response)
+SAX.characters(
+  <S:response>
+    <S:href>ht, 3)
+SAX.startElement(S:response)
+SAX.characters(
+    <S:href>http://www.foo.ba, 5)
+SAX.startElement(S:href)
+SAX.characters(http://www.foo.bar/container/i, 39)
+SAX.endElement(S:href)
+SAX.characters(
+    <S:prop>
+      <R:bigbox>, 5)
+SAX.startElement(S:prop)
+SAX.characters(
+      <R:bigbox>
+        <R:B, 7)
+SAX.startElement(R:bigbox)
+SAX.characters(
+        <R:BoxType>Box type B, 9)
+SAX.startElement(R:BoxType)
+SAX.characters(Box type B</R:BoxType>
+      <, 10)
+SAX.endElement(R:BoxType)
+SAX.characters(
+      </R:bigbox>
+    </S:pro, 7)
+SAX.endElement(R:bigbox)
+SAX.characters(
+    </S:prop>
+    <S:status>H, 5)
+SAX.endElement(S:prop)
+SAX.characters(
+    <S:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(S:status)
+SAX.characters(HTTP 1.1 200 OK</S:status>
+  <, 15)
+SAX.endElement(S:status)
+SAX.characters(
+  </S:response>
+</S:multistat, 3)
+SAX.endElement(S:response)
+SAX.characters(
+</S:multistatus>
+, 1)
+SAX.endElement(S:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav3 b/SAXresult/dav3
new file mode 100644
index 0000000..6c600b9
--- /dev/null
+++ b/SAXresult/dav3
@@ -0,0 +1,77 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/', xmlns:R='http://www.foo.bar/boxschema/')
+SAX.characters(
+  <D:response>
+    <D:href>ht, 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>http://www.foo.ba, 5)
+SAX.startElement(D:href)
+SAX.characters(http://www.foo.bar/container/<, 29)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:prop>
+      <R:bigbox/, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <R:bigbox/>
+      <R:au, 7)
+SAX.startElement(R:bigbox)
+SAX.endElement((null))
+SAX.characters(
+      <R:author/>
+    </D:pro, 7)
+SAX.startElement(R:author)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP 1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:response>
+    <D:href>ht, 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>http://www.foo.ba, 5)
+SAX.startElement(D:href)
+SAX.characters(http://www.foo.bar/container/i, 39)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:prop>
+      <R:bigbox/, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <R:bigbox/>
+    </D:pro, 7)
+SAX.startElement(R:bigbox)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP 1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+</D:multistat, 3)
+SAX.endElement(D:response)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav4 b/SAXresult/dav4
new file mode 100644
index 0000000..3f4196a
--- /dev/null
+++ b/SAXresult/dav4
@@ -0,0 +1,70 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:propertyupdate, xmlns:D='http://www.ietf.org/standards/dav/', xmlns:Z='http://www.w3.com/standards/z39.50/')
+SAX.characters(
+  <D:set>
+    <D:prop>
+      , 3)
+SAX.startElement(D:set)
+SAX.characters(
+    <D:prop>
+      <Z:authors, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <Z:authors>
+        <Z:, 7)
+SAX.startElement(Z:authors)
+SAX.characters(
+        <Z:Author>Jim Whitehe, 9)
+SAX.startElement(Z:Author)
+SAX.characters(Jim Whitehead</Z:Author>
+     , 13)
+SAX.endElement(Z:Author)
+SAX.characters(
+        <Z:Author>Roy Fieldin, 9)
+SAX.startElement(Z:Author)
+SAX.characters(Roy Fielding</Z:Author>
+      , 12)
+SAX.endElement(Z:Author)
+SAX.characters(
+      </Z:authors>
+    </D:pr, 7)
+SAX.endElement(Z:authors)
+SAX.characters(
+    </D:prop>
+  </D:set>
+  <D, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+  </D:set>
+  <D:remove>
+    <, 3)
+SAX.endElement(D:set)
+SAX.characters(
+  <D:remove>
+    <D:prop>
+   , 3)
+SAX.startElement(D:remove)
+SAX.characters(
+    <D:prop>
+      <Z:Copyrig, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <Z:Copyright-Owner/>
+  , 7)
+SAX.startElement(Z:Copyright-Owner)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+  </D:remove>
+<, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+  </D:remove>
+</D:propertyupd, 3)
+SAX.endElement(D:remove)
+SAX.characters(
+</D:propertyupdate>
+, 1)
+SAX.endElement(D:propertyupdate)
+SAX.endDocument()
diff --git a/SAXresult/dav5 b/SAXresult/dav5
new file mode 100644
index 0000000..e8693b2
--- /dev/null
+++ b/SAXresult/dav5
@@ -0,0 +1,67 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/', xmlns:Z='http://www.w3.com/standards/z39.50/')
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <Z:Authors, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <Z:Authors/>
+    </D:pr, 7)
+SAX.startElement(Z:Authors)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 420 Me, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 420 Method Failure</D, 27)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:response>
+    <D:prop>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:prop>
+      <Z:Copyrig, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <Z:Copyright-Owner/>
+  , 7)
+SAX.startElement(Z:Copyright-Owner)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP/1.1 409 Co, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP/1.1 409 Conflict</D:statu, 21)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:responsedescription> Cop, 3)
+SAX.startElement(D:responsedescription)
+SAX.characters( Copyright Owner can not be de, 47)
+SAX.endElement(D:responsedescription)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav6 b/SAXresult/dav6
new file mode 100644
index 0000000..33e20eb
--- /dev/null
+++ b/SAXresult/dav6
@@ -0,0 +1,83 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <D:response>
+    <D:href>ht, 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>http://www.micros, 5)
+SAX.startElement(D:href)
+SAX.characters(http://www.microsoft.com/user/, 55)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:prop>
+      <D:resourc, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <D:resourcetype>
+      , 7)
+SAX.startElement(D:resourcetype)
+SAX.characters(
+        <D:collection/>
+     , 9)
+SAX.startElement(D:collection)
+SAX.endElement((null))
+SAX.characters(
+      </D:resourcetype>
+    <, 7)
+SAX.endElement(D:resourcetype)
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP 1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+  <D:response, 3)
+SAX.endElement(D:response)
+SAX.characters(
+  <D:response>
+    <D:href>
+ , 3)
+SAX.startElement(D:response)
+SAX.characters(
+    <D:href>
+      http://www, 5)
+SAX.startElement(D:href)
+SAX.characters(
+      http://www.microsoft.co, 66)
+SAX.endElement(D:href)
+SAX.characters(
+    <D:prop>
+      <D:resourc, 5)
+SAX.startElement(D:prop)
+SAX.characters(
+      <D:resourcetype/>
+    <, 7)
+SAX.startElement(D:resourcetype)
+SAX.endElement((null))
+SAX.characters(
+    </D:prop>
+    <D:status>H, 5)
+SAX.endElement(D:prop)
+SAX.characters(
+    <D:status>HTTP 1.1 200 OK, 5)
+SAX.startElement(D:status)
+SAX.characters(HTTP 1.1 200 OK</D:status>
+  <, 15)
+SAX.endElement(D:status)
+SAX.characters(
+  </D:response>
+</D:multistat, 3)
+SAX.endElement(D:response)
+SAX.characters(
+</D:multistatus>
+, 1)
+SAX.endElement(D:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav7 b/SAXresult/dav7
new file mode 100644
index 0000000..c251d93
--- /dev/null
+++ b/SAXresult/dav7
@@ -0,0 +1,68 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(d:multistatus, xmlns:d='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/r, 38)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/r, 38)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 200 OK, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 200 OK</d:status>
+  <, 15)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+  <d:response, 3)
+SAX.endElement(d:response)
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/<, 29)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 420 Me, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 420 Method Failure</d, 27)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+  <d:response, 3)
+SAX.endElement(d:response)
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/r, 38)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 412 Pr, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 412 Precondition Fail, 32)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+</d:multistat, 3)
+SAX.endElement(d:response)
+SAX.characters(
+</d:multistatus>
+, 1)
+SAX.endElement(d:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav8 b/SAXresult/dav8
new file mode 100644
index 0000000..225c8d6
--- /dev/null
+++ b/SAXresult/dav8
@@ -0,0 +1,59 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(d:multistatus, xmlns:d='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 43)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 43)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 34)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 39)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 201 Cr, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 201 Created</d:status, 20)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+  <d:response, 3)
+SAX.endElement(d:response)
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 37)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 412 Pr, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 412 Precondition Fail, 32)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+</d:multistat, 3)
+SAX.endElement(d:response)
+SAX.characters(
+</d:multistatus>
+, 1)
+SAX.endElement(d:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dav9 b/SAXresult/dav9
new file mode 100644
index 0000000..65421a8
--- /dev/null
+++ b/SAXresult/dav9
@@ -0,0 +1,77 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(d:multistatus, xmlns:d='http://www.ietf.org/standards/dav/')
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/r, 38)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/r, 38)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/<, 29)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/C, 34)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 201 Cr, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 201 Created</d:status, 20)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+  <d:response, 3)
+SAX.endElement(d:response)
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/container/C, 31)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 420 Me, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 420 Method Failure</d, 27)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+  <d:response, 3)
+SAX.endElement(d:response)
+SAX.characters(
+  <d:response>
+    <d:href>ht, 3)
+SAX.startElement(d:response)
+SAX.characters(
+    <d:href>http://www.foo.ba, 5)
+SAX.startElement(d:href)
+SAX.characters(http://www.foo.bar/othercontai, 36)
+SAX.endElement(d:href)
+SAX.characters(
+    <d:status>HTTP/1.1 409 Co, 5)
+SAX.startElement(d:status)
+SAX.characters(HTTP/1.1 409 Conflict</d:statu, 21)
+SAX.endElement(d:status)
+SAX.characters(
+  </d:response>
+</d:multistat, 3)
+SAX.endElement(d:response)
+SAX.characters(
+</d:multistatus>
+, 1)
+SAX.endElement(d:multistatus)
+SAX.endDocument()
diff --git a/SAXresult/dia1 b/SAXresult/dia1
new file mode 100644
index 0000000..c61703f
--- /dev/null
+++ b/SAXresult/dia1
@@ -0,0 +1,365 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(dia:diagram, xmlns:dia='http://www.lysator.liu.se/~alla/dia/')
+SAX.characters(
+  <dia:diagramdata>
+    <dia:, 3)
+SAX.startElement(dia:diagramdata)
+SAX.characters(
+    <dia:attribute name="back, 5)
+SAX.startElement(dia:attribute, name='background')
+SAX.characters(
+      <dia:color val="#ffffff, 7)
+SAX.startElement(dia:color, val='#ffffff')
+SAX.endElement((null))
+SAX.characters(
+    </dia:attribute>
+  </dia:, 5)
+SAX.endElement(dia:attribute)
+SAX.characters(
+  </dia:diagramdata>
+  <dia:l, 3)
+SAX.endElement(dia:diagramdata)
+SAX.characters(
+  <dia:layer name="Background, 3)
+SAX.startElement(dia:layer, name='Background', visible='true')
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Line', version='0', id='O0')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="1.95,, 9)
+SAX.startElement(dia:point, val='1.95,6.85')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="1, 9)
+SAX.startElement(dia:rectangle, val='1.9,6.8;11,8.55')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="co, 7)
+SAX.startElement(dia:attribute, name='conn_endpoints')
+SAX.characters(
+        <dia:point val="1.95,, 9)
+SAX.startElement(dia:point, val='1.95,6.85')
+SAX.endElement((null))
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,8.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_color')
+SAX.characters(
+        <dia:color val="#0000, 9)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_width')
+SAX.characters(
+        <dia:real val="0.1"/>, 9)
+SAX.startElement(dia:real, val='0.1')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_style')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="st, 7)
+SAX.startElement(dia:attribute, name='start_arrow')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="en, 7)
+SAX.startElement(dia:attribute, name='end_arrow')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:connections>
+     , 7)
+SAX.startElement(dia:connections)
+SAX.characters(
+        <dia:connection handl, 9)
+SAX.startElement(dia:connection, handle='1', to='O2', connection='3')
+SAX.endElement((null))
+SAX.characters(
+      </dia:connections>
+    , 7)
+SAX.endElement(dia:connections)
+SAX.characters(
+    </dia:object>
+    <dia:ob, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Text', version='0', id='O1')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="4.8,4, 9)
+SAX.startElement(dia:point, val='4.8,4.75')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="2, 9)
+SAX.startElement(dia:rectangle, val='2.579,3.96359;7.021,4.96359')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="te, 7)
+SAX.startElement(dia:attribute, name='text')
+SAX.characters(
+        <dia:composite type=", 9)
+SAX.startElement(dia:composite, type='text')
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='string')
+SAX.characters(
+            <dia:string val=", 13)
+SAX.startElement(dia:string, val='sdfsdfg')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='font')
+SAX.characters(
+            <dia:font name="C, 13)
+SAX.startElement(dia:font, name='Courier')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='height')
+SAX.characters(
+            <dia:real val="1", 13)
+SAX.startElement(dia:real, val='1')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='pos')
+SAX.characters(
+            <dia:point val="4, 13)
+SAX.startElement(dia:point, val='4.8,4.75')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='color')
+SAX.characters(
+            <dia:color val="#, 13)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='alignment')
+SAX.characters(
+            <dia:enum val="1", 13)
+SAX.startElement(dia:enum, val='1')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+        </dia:composite>
+    , 9)
+SAX.endElement(dia:composite)
+SAX.characters(
+      </dia:attribute>
+    </, 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+    </dia:object>
+    <dia:ob, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Box', version='0', id='O2')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,7.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="1, 9)
+SAX.startElement(dia:rectangle, val='10.9,7.45;13.05,9.55')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_corner')
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,7.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_width')
+SAX.characters(
+        <dia:real val="2.05"/, 9)
+SAX.startElement(dia:real, val='2.05')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_height')
+SAX.characters(
+        <dia:real val="2"/>
+ , 9)
+SAX.startElement(dia:real, val='2')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="bo, 7)
+SAX.startElement(dia:attribute, name='border_width')
+SAX.characters(
+        <dia:real val="0.1"/>, 9)
+SAX.startElement(dia:real, val='0.1')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="bo, 7)
+SAX.startElement(dia:attribute, name='border_color')
+SAX.characters(
+        <dia:color val="#0000, 9)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="in, 7)
+SAX.startElement(dia:attribute, name='inner_color')
+SAX.characters(
+        <dia:color val="#ffff, 9)
+SAX.startElement(dia:color, val='#ffffff')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_style')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+    </, 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+    </dia:object>
+  </dia:lay, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+  </dia:layer>
+</dia:diagram>, 3)
+SAX.endElement(dia:layer)
+SAX.characters(
+</dia:diagram>
+, 1)
+SAX.endElement(dia:diagram)
+SAX.endDocument()
diff --git a/SAXresult/dia2 b/SAXresult/dia2
new file mode 100644
index 0000000..c61703f
--- /dev/null
+++ b/SAXresult/dia2
@@ -0,0 +1,365 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(dia:diagram, xmlns:dia='http://www.lysator.liu.se/~alla/dia/')
+SAX.characters(
+  <dia:diagramdata>
+    <dia:, 3)
+SAX.startElement(dia:diagramdata)
+SAX.characters(
+    <dia:attribute name="back, 5)
+SAX.startElement(dia:attribute, name='background')
+SAX.characters(
+      <dia:color val="#ffffff, 7)
+SAX.startElement(dia:color, val='#ffffff')
+SAX.endElement((null))
+SAX.characters(
+    </dia:attribute>
+  </dia:, 5)
+SAX.endElement(dia:attribute)
+SAX.characters(
+  </dia:diagramdata>
+  <dia:l, 3)
+SAX.endElement(dia:diagramdata)
+SAX.characters(
+  <dia:layer name="Background, 3)
+SAX.startElement(dia:layer, name='Background', visible='true')
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Line', version='0', id='O0')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="1.95,, 9)
+SAX.startElement(dia:point, val='1.95,6.85')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="1, 9)
+SAX.startElement(dia:rectangle, val='1.9,6.8;11,8.55')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="co, 7)
+SAX.startElement(dia:attribute, name='conn_endpoints')
+SAX.characters(
+        <dia:point val="1.95,, 9)
+SAX.startElement(dia:point, val='1.95,6.85')
+SAX.endElement((null))
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,8.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_color')
+SAX.characters(
+        <dia:color val="#0000, 9)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_width')
+SAX.characters(
+        <dia:real val="0.1"/>, 9)
+SAX.startElement(dia:real, val='0.1')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_style')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="st, 7)
+SAX.startElement(dia:attribute, name='start_arrow')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="en, 7)
+SAX.startElement(dia:attribute, name='end_arrow')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:connections>
+     , 7)
+SAX.startElement(dia:connections)
+SAX.characters(
+        <dia:connection handl, 9)
+SAX.startElement(dia:connection, handle='1', to='O2', connection='3')
+SAX.endElement((null))
+SAX.characters(
+      </dia:connections>
+    , 7)
+SAX.endElement(dia:connections)
+SAX.characters(
+    </dia:object>
+    <dia:ob, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Text', version='0', id='O1')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="4.8,4, 9)
+SAX.startElement(dia:point, val='4.8,4.75')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="2, 9)
+SAX.startElement(dia:rectangle, val='2.579,3.96359;7.021,4.96359')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="te, 7)
+SAX.startElement(dia:attribute, name='text')
+SAX.characters(
+        <dia:composite type=", 9)
+SAX.startElement(dia:composite, type='text')
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='string')
+SAX.characters(
+            <dia:string val=", 13)
+SAX.startElement(dia:string, val='sdfsdfg')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='font')
+SAX.characters(
+            <dia:font name="C, 13)
+SAX.startElement(dia:font, name='Courier')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='height')
+SAX.characters(
+            <dia:real val="1", 13)
+SAX.startElement(dia:real, val='1')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='pos')
+SAX.characters(
+            <dia:point val="4, 13)
+SAX.startElement(dia:point, val='4.8,4.75')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='color')
+SAX.characters(
+            <dia:color val="#, 13)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+          <dia:attribute name, 11)
+SAX.startElement(dia:attribute, name='alignment')
+SAX.characters(
+            <dia:enum val="1", 13)
+SAX.startElement(dia:enum, val='1')
+SAX.endElement((null))
+SAX.characters(
+          </dia:attribute>
+  , 11)
+SAX.endElement(dia:attribute)
+SAX.characters(
+        </dia:composite>
+    , 9)
+SAX.endElement(dia:composite)
+SAX.characters(
+      </dia:attribute>
+    </, 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+    </dia:object>
+    <dia:ob, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+    <dia:object type="Standar, 5)
+SAX.startElement(dia:object, type='Standard - Box', version='0', id='O2')
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_pos')
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,7.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="ob, 7)
+SAX.startElement(dia:attribute, name='obj_bb')
+SAX.characters(
+        <dia:rectangle val="1, 9)
+SAX.startElement(dia:rectangle, val='10.9,7.45;13.05,9.55')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_corner')
+SAX.characters(
+        <dia:point val="10.95, 9)
+SAX.startElement(dia:point, val='10.95,7.5')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_width')
+SAX.characters(
+        <dia:real val="2.05"/, 9)
+SAX.startElement(dia:real, val='2.05')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="el, 7)
+SAX.startElement(dia:attribute, name='elem_height')
+SAX.characters(
+        <dia:real val="2"/>
+ , 9)
+SAX.startElement(dia:real, val='2')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="bo, 7)
+SAX.startElement(dia:attribute, name='border_width')
+SAX.characters(
+        <dia:real val="0.1"/>, 9)
+SAX.startElement(dia:real, val='0.1')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="bo, 7)
+SAX.startElement(dia:attribute, name='border_color')
+SAX.characters(
+        <dia:color val="#0000, 9)
+SAX.startElement(dia:color, val='#000000')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="in, 7)
+SAX.startElement(dia:attribute, name='inner_color')
+SAX.characters(
+        <dia:color val="#ffff, 9)
+SAX.startElement(dia:color, val='#ffffff')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+      , 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+      <dia:attribute name="li, 7)
+SAX.startElement(dia:attribute, name='line_style')
+SAX.characters(
+        <dia:enum val="0"/>
+ , 9)
+SAX.startElement(dia:enum, val='0')
+SAX.endElement((null))
+SAX.characters(
+      </dia:attribute>
+    </, 7)
+SAX.endElement(dia:attribute)
+SAX.characters(
+    </dia:object>
+  </dia:lay, 5)
+SAX.endElement(dia:object)
+SAX.characters(
+  </dia:layer>
+</dia:diagram>, 3)
+SAX.endElement(dia:layer)
+SAX.characters(
+</dia:diagram>
+, 1)
+SAX.endElement(dia:diagram)
+SAX.endDocument()
diff --git a/SAXresult/dtd1 b/SAXresult/dtd1
new file mode 100644
index 0000000..db7183f
--- /dev/null
+++ b/SAXresult/dtd1
@@ -0,0 +1,10 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(MEMO, -//SGMLSOURCE//DTD MEMO//EN, http://www.sgmlsource.com/dtds/memo.dtd)
+SAX.resolveEntity(-//SGMLSOURCE//DTD MEMO//EN, http://www.sgmlsource.com/dtds/memo.dtd)
+SAX.startElement(MEMO)
+SAX.characters(
+</MEMO>
+, 1)
+SAX.endElement(MEMO)
+SAX.endDocument()
diff --git a/SAXresult/dtd10 b/SAXresult/dtd10
new file mode 100644
index 0000000..c967356
--- /dev/null
+++ b/SAXresult/dtd10
@@ -0,0 +1,21 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 4, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.elementDecl(c, 3, ...)
+SAX.elementDecl(d, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(b)
+SAX.characters(This</b><c> is a</c><d> valid , 4)
+SAX.endElement(b)
+SAX.startElement(c)
+SAX.characters( is a</c><d> valid document</d, 5)
+SAX.endElement(c)
+SAX.startElement(d)
+SAX.characters( valid document</d></doc>
+, 15)
+SAX.endElement(d)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd11 b/SAXresult/dtd11
new file mode 100644
index 0000000..37a69d0
--- /dev/null
+++ b/SAXresult/dtd11
@@ -0,0 +1,8 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 3, ...)
+SAX.attributeDecl(doc, val, 1, 3, (null), ...)
+SAX.startElement(doc, val='v1')
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd2 b/SAXresult/dtd2
new file mode 100644
index 0000000..2203934
--- /dev/null
+++ b/SAXresult/dtd2
@@ -0,0 +1,8 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 3, ...)
+SAX.startElement(doc)
+SAX.characters(This is a valid document !</do, 26)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd3 b/SAXresult/dtd3
new file mode 100644
index 0000000..97ab16c
--- /dev/null
+++ b/SAXresult/dtd3
@@ -0,0 +1,8 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 2, ...)
+SAX.startElement(doc)
+SAX.characters(This is a valid document !</do, 26)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd4 b/SAXresult/dtd4
new file mode 100644
index 0000000..0461a84
--- /dev/null
+++ b/SAXresult/dtd4
@@ -0,0 +1,7 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 1, ...)
+SAX.startElement(doc)
+SAX.endElement((null))
+SAX.endDocument()
diff --git a/SAXresult/dtd5 b/SAXresult/dtd5
new file mode 100644
index 0000000..1f2e48c
--- /dev/null
+++ b/SAXresult/dtd5
@@ -0,0 +1,19 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 3, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(a)
+SAX.characters(This</a> is a <b>valid</b> doc, 4)
+SAX.endElement(a)
+SAX.characters( is a <b>valid</b> document</d, 6)
+SAX.startElement(b)
+SAX.characters(valid</b> document</doc>
+, 5)
+SAX.endElement(b)
+SAX.characters( document</doc>
+, 9)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd6 b/SAXresult/dtd6
new file mode 100644
index 0000000..8a34085
--- /dev/null
+++ b/SAXresult/dtd6
@@ -0,0 +1,19 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 4, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(a)
+SAX.characters(This</a><b> is a valid</b><a> , 4)
+SAX.endElement(a)
+SAX.startElement(b)
+SAX.characters( is a valid</b><a> document</a, 11)
+SAX.endElement(b)
+SAX.startElement(a)
+SAX.characters( document</a></doc>
+, 9)
+SAX.endElement(a)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd7 b/SAXresult/dtd7
new file mode 100644
index 0000000..210258a
--- /dev/null
+++ b/SAXresult/dtd7
@@ -0,0 +1,15 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 4, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(a)
+SAX.characters(This</a><b> is a valid documen, 4)
+SAX.endElement(a)
+SAX.startElement(b)
+SAX.characters( is a valid document</b></doc>, 20)
+SAX.endElement(b)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd8 b/SAXresult/dtd8
new file mode 100644
index 0000000..b508a85
--- /dev/null
+++ b/SAXresult/dtd8
@@ -0,0 +1,17 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 4, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.elementDecl(c, 3, ...)
+SAX.elementDecl(d, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(b)
+SAX.characters(This</b><c> is a valid documen, 4)
+SAX.endElement(b)
+SAX.startElement(c)
+SAX.characters( is a valid document</c></doc>, 20)
+SAX.endElement(c)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/dtd9 b/SAXresult/dtd9
new file mode 100644
index 0000000..c56ec5c
--- /dev/null
+++ b/SAXresult/dtd9
@@ -0,0 +1,17 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, (null), (null))
+SAX.elementDecl(doc, 4, ...)
+SAX.elementDecl(a, 3, ...)
+SAX.elementDecl(b, 3, ...)
+SAX.elementDecl(c, 3, ...)
+SAX.elementDecl(d, 3, ...)
+SAX.startElement(doc)
+SAX.startElement(b)
+SAX.characters(This</b><d> is a valid documen, 4)
+SAX.endElement(b)
+SAX.startElement(d)
+SAX.characters( is a valid document</d></doc>, 20)
+SAX.endElement(d)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/SAXresult/ent1 b/SAXresult/ent1
new file mode 100644
index 0000000..fd4ba41
--- /dev/null
+++ b/SAXresult/ent1
@@ -0,0 +1,21 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(EXAMPLE, (null), example.dtd)
+SAX.resolveEntity((null), example.dtd)
+SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
+SAX.getEntity(xml)
+SAX.startElement(EXAMPLE)
+SAX.characters(
+    &xml;
+</EXAMPLE>
+, 5)
+SAX.getEntity(xml)
+SAX.isStandalone()
+SAX.hasInternalSubset()
+SAX.hasExternalSubset()
+SAX.error: Entity 'xml' not defined
+SAX.characters(
+</EXAMPLE>
+, 1)
+SAX.endElement(EXAMPLE)
+SAX.endDocument()
diff --git a/SAXresult/ent2 b/SAXresult/ent2
new file mode 100644
index 0000000..7a3e3c6
--- /dev/null
+++ b/SAXresult/ent2
@@ -0,0 +1,33 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(EXAMPLE, (null), example.dtd)
+SAX.resolveEntity((null), example.dtd)
+SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
+SAX.getEntity(xml)
+SAX.entityDecl(title, 2, -//MY-TITLE//FR, title.xml, (null))
+SAX.entityDecl(image, 3, (null), img.gif, GIF)
+SAX.startElement(EXAMPLE)
+SAX.characters(
+  &title;
+  This text is abou, 3)
+SAX.getEntity(title)
+SAX.isStandalone()
+SAX.hasInternalSubset()
+SAX.hasExternalSubset()
+SAX.error: Entity 'title' not defined
+SAX.characters(
+  This text is about XML, the, 31)
+SAX.getEntity(xml)
+SAX.isStandalone()
+SAX.hasInternalSubset()
+SAX.hasExternalSubset()
+SAX.error: Entity 'xml' not defined
+SAX.characters( and this is an embedded <IMG , 25)
+SAX.startElement(IMG, src='image')
+SAX.endElement((null))
+SAX.characters(
+</EXAMPLE>
+
+, 1)
+SAX.endElement(EXAMPLE)
+SAX.endDocument()
diff --git a/SAXresult/ent3 b/SAXresult/ent3
new file mode 100644
index 0000000..09af2c0
--- /dev/null
+++ b/SAXresult/ent3
@@ -0,0 +1,11 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(EXAMPLE, (null), example.dtd)
+SAX.resolveEntity((null), example.dtd)
+SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
+SAX.getEntity(xml)
+SAX.startElement(EXAMPLE, prop1='a&amp;b', prop2='&xml;')
+SAX.characters(
+  Test of entities in attribu, 35)
+SAX.endElement(EXAMPLE)
+SAX.endDocument()
diff --git a/SAXresult/ent4 b/SAXresult/ent4
new file mode 100644
index 0000000..ca195d1
--- /dev/null
+++ b/SAXresult/ent4
@@ -0,0 +1,21 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(EXAMPLE, (null), example.dtd)
+SAX.resolveEntity((null), example.dtd)
+SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
+SAX.getEntity(xml)
+SAX.startElement(EXAMPLE)
+SAX.characters(
+  Test of &amp;amp; behaviour, 11)
+SAX.getEntity(amp)
+SAX.characters(&, 1)
+SAX.characters(amp; behaviour a&amp;b .
+</EXA, 16)
+SAX.getEntity(amp)
+SAX.characters(&, 1)
+SAX.characters(b .
+</EXAMPLE>
+
+, 4)
+SAX.endElement(EXAMPLE)
+SAX.endDocument()
diff --git a/SAXresult/ent5 b/SAXresult/ent5
new file mode 100644
index 0000000..6695697
--- /dev/null
+++ b/SAXresult/ent5
@@ -0,0 +1,15 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(EXAMPLE)
+SAX.characters(
+    This is an inverted excla, 42)
+SAX.characters(¡, 1)
+SAX.characters(
+    This is a space &#32; 
+</, 21)
+SAX.characters( , 1)
+SAX.characters( 
+</EXAMPLE>
+, 2)
+SAX.endElement(EXAMPLE)
+SAX.endDocument()
diff --git a/SAXresult/p3p b/SAXresult/p3p
new file mode 100644
index 0000000..87c5609
--- /dev/null
+++ b/SAXresult/p3p
@@ -0,0 +1,75 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(RDF:RDF, xmlsn:p3p='http//www.w3.org/TR/1998/WD-P3P10-syntax#proposal.DTD', xmlns:RDF='http://www.w3.org/TR/WD-rdf-syntax#')
+SAX.characters(
+<PROP realm="http://www.CoolC, 1)
+SAX.startElement(PROP, realm='http://www.CoolCatalog.com/catalogue/', entity='CoolCatalog', agreeID='94df1293a3e519bb', assurance='http://www.TrustUs.org')
+SAX.characters(
+  <USES>
+  <STATEMENT purp="2, 3)
+SAX.startElement(USES)
+SAX.characters(
+  <STATEMENT purp="2,3" recpn, 3)
+SAX.startElement(STATEMENT, purp='2,3', recpnt='0', id='0', consq='a site with clothes you'd appreciate.')
+SAX.characters(
+    <WITH><PREFIX name="User., 5)
+SAX.startElement(WITH)
+SAX.startElement(PREFIX, name='User.')
+SAX.characters(
+     <REF name="Name.First"/>, 6)
+SAX.startElement(REF, name='Name.First')
+SAX.endElement((null))
+SAX.characters(
+     <REF name="Bdate.Year" o, 6)
+SAX.startElement(REF, name='Bdate.Year', optional='1')
+SAX.endElement((null))
+SAX.characters(
+     <REF name="Gender"/>
+   , 6)
+SAX.startElement(REF, name='Gender')
+SAX.endElement((null))
+SAX.characters(
+    </PREFIX></WITH>
+  </STAT, 5)
+SAX.endElement(PREFIX)
+SAX.endElement(WITH)
+SAX.characters(
+  </STATEMENT>
+  </USES>
+  <U, 3)
+SAX.endElement(STATEMENT)
+SAX.characters(
+  </USES>
+  <USES>
+  <STATEME, 3)
+SAX.endElement(USES)
+SAX.characters(
+  <USES>
+  <STATEMENT action=, 3)
+SAX.startElement(USES)
+SAX.characters(
+  <STATEMENT action="read&amp, 3)
+SAX.startElement(STATEMENT, action='read&amp;write', purp='0', recpnt='0', id='1')
+SAX.characters(
+    <REF name="User.Shipping., 5)
+SAX.startElement(REF, name='User.Shipping.')
+SAX.endElement((null))
+SAX.characters(
+  </STATEMENT>
+  </USES>
+  <D, 3)
+SAX.endElement(STATEMENT)
+SAX.characters(
+  </USES>
+  <DISCLOSURE discU, 3)
+SAX.endElement(USES)
+SAX.characters(
+  <DISCLOSURE discURI="http:/, 3)
+SAX.startElement(DISCLOSURE, discURI='http://www.CoolCatalog.com/PrivacyPractice.html', access='3', other='0,1')
+SAX.endElement((null))
+SAX.characters(
+</PROP></RDF:RDF>
+, 1)
+SAX.endElement(PROP)
+SAX.endElement(RDF:RDF)
+SAX.endDocument()
diff --git a/SAXresult/rdf1 b/SAXresult/rdf1
new file mode 100644
index 0000000..e1cdde3
--- /dev/null
+++ b/SAXresult/rdf1
@@ -0,0 +1,223 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(RDF:RDF, xmlns:RPM='http://www.rpm.org/', xmlns:RDF='http://www.w3.org/TR/WD-rdf-syntax#')
+SAX.characters(
+  <RDF:Description HREF="ftp:, 3)
+SAX.startElement(RDF:Description, HREF='ftp://rufus.w3.org/linux/redhat/redhat-5.1/i386/RedHat/RPMS/rpm-2.5-2.i386.rpm')
+SAX.characters(
+    <RPM:Name>rpm</RPM:Name>
+, 5)
+SAX.startElement(RPM:Name)
+SAX.characters(rpm</RPM:Name>
+    <RPM:Versio, 3)
+SAX.endElement(RPM:Name)
+SAX.characters(
+    <RPM:Version>2.5</RPM:Ver, 5)
+SAX.startElement(RPM:Version)
+SAX.characters(2.5</RPM:Version>
+    <RPM:Rel, 3)
+SAX.endElement(RPM:Version)
+SAX.characters(
+    <RPM:Release>2</RPM:Relea, 5)
+SAX.startElement(RPM:Release)
+SAX.characters(2</RPM:Release>
+    <RPM:Arch>, 1)
+SAX.endElement(RPM:Release)
+SAX.characters(
+    <RPM:Arch>i386</RPM:Arch>, 5)
+SAX.startElement(RPM:Arch)
+SAX.characters(i386</RPM:Arch>
+    <RPM:Os>Li, 4)
+SAX.endElement(RPM:Arch)
+SAX.characters(
+    <RPM:Os>Linux</RPM:Os>
+  , 5)
+SAX.startElement(RPM:Os)
+SAX.characters(Linux</RPM:Os>
+    <RPM:Distri, 5)
+SAX.endElement(RPM:Os)
+SAX.characters(
+    <RPM:Distribution>Manhatt, 5)
+SAX.startElement(RPM:Distribution)
+SAX.characters(Manhattan </RPM:Distribution>
+, 10)
+SAX.endElement(RPM:Distribution)
+SAX.characters(
+    <RPM:Vendor>Red Hat Softw, 5)
+SAX.startElement(RPM:Vendor)
+SAX.characters(Red Hat Software</RPM:Vendor>
+, 16)
+SAX.endElement(RPM:Vendor)
+SAX.characters(
+    <RPM:Packager>Red Hat Sof, 5)
+SAX.startElement(RPM:Packager)
+SAX.characters(Red Hat Software &lt;bugs@redh, 17)
+SAX.getEntity(lt)
+SAX.characters(<, 1)
+SAX.characters(bugs@redhat.com&gt;</RPM:Packa, 15)
+SAX.getEntity(gt)
+SAX.characters(>, 1)
+SAX.endElement(RPM:Packager)
+SAX.characters(
+    <RPM:Group>Utilities/Syst, 5)
+SAX.startElement(RPM:Group)
+SAX.characters(Utilities/System</RPM:Group>
+ , 16)
+SAX.endElement(RPM:Group)
+SAX.characters(
+    <RPM:Summary>Red Hat Pack, 5)
+SAX.startElement(RPM:Summary)
+SAX.characters(Red Hat Package Manager</RPM:S, 23)
+SAX.endElement(RPM:Summary)
+SAX.characters(
+    <RPM:Description>RPM is a, 5)
+SAX.startElement(RPM:Description)
+SAX.characters(RPM is a powerful package mana, 248)
+SAX.endElement(RPM:Description)
+SAX.characters(
+    <RPM:Copyright>GPL</RPM:C, 5)
+SAX.startElement(RPM:Copyright)
+SAX.characters(GPL</RPM:Copyright>
+    <RPM:C, 3)
+SAX.endElement(RPM:Copyright)
+SAX.characters(
+    <RPM:Changelog>* Sun May , 5)
+SAX.startElement(RPM:Changelog)
+SAX.characters(* Sun May 10 1998 Prospector S, 36)
+SAX.getEntity(lt)
+SAX.characters(<, 1)
+SAX.characters(bugs@redhat.com&gt;
+  - transl, 15)
+SAX.getEntity(gt)
+SAX.characters(>, 1)
+SAX.characters(
+  - translations modified for, 42)
+SAX.endElement(RPM:Changelog)
+SAX.characters(
+    <RPM:Sources>rpm-2.5-2.sr, 5)
+SAX.startElement(RPM:Sources)
+SAX.characters(rpm-2.5-2.src.rpm</RPM:Sources, 17)
+SAX.endElement(RPM:Sources)
+SAX.characters(
+    <RPM:SourcesFtp>ftp://ftp, 5)
+SAX.startElement(RPM:SourcesFtp)
+SAX.characters(ftp://ftp.redhat.com/pub/redha, 48)
+SAX.endElement(RPM:SourcesFtp)
+SAX.characters(
+    <RPM:BuildDate>Sun May 10, 5)
+SAX.startElement(RPM:BuildDate)
+SAX.characters(Sun May 10 14:52:32 1998</RPM:, 24)
+SAX.endElement(RPM:BuildDate)
+SAX.characters(
+    <RPM:Date>894826352</RPM:, 5)
+SAX.startElement(RPM:Date)
+SAX.characters(894826352</RPM:Date>
+    <RPM:, 9)
+SAX.endElement(RPM:Date)
+SAX.characters(
+    <RPM:Size>850599</RPM:Siz, 5)
+SAX.startElement(RPM:Size)
+SAX.characters(850599</RPM:Size>
+    <RPM:Bui, 6)
+SAX.endElement(RPM:Size)
+SAX.characters(
+    <RPM:BuildHost>porky.redh, 5)
+SAX.startElement(RPM:BuildHost)
+SAX.characters(porky.redhat.com</RPM:BuildHos, 16)
+SAX.endElement(RPM:BuildHost)
+SAX.characters(
+    <RPM:Provides>
+      <RDF, 5)
+SAX.startElement(RPM:Provides)
+SAX.characters(
+      <RDF:Bag>
+        <RPM:, 7)
+SAX.startElement(RDF:Bag)
+SAX.characters(
+        <RPM:Resource>rpm</RP, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(rpm</RPM:Resource>
+      </RDF, 3)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+      </RDF:Bag>
+    </RPM:Pr, 7)
+SAX.endElement(RDF:Bag)
+SAX.characters(
+    </RPM:Provides>
+    <RPM:, 5)
+SAX.endElement(RPM:Provides)
+SAX.characters(
+    <RPM:Requires>
+      <RDF, 5)
+SAX.startElement(RPM:Requires)
+SAX.characters(
+      <RDF:Bag>
+        <RPM:, 7)
+SAX.startElement(RDF:Bag)
+SAX.characters(
+        <RPM:Resource>/bin/sh, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(/bin/sh</RPM:Resource>
+       , 7)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>ld-linu, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(ld-linux.so.2</RPM:Resource>
+ , 13)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>libc.so, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(libc.so.6</RPM:Resource>
+     , 9)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>libdb.s, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(libdb.so.2</RPM:Resource>
+    , 10)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>libz.so, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(libz.so.1</RPM:Resource>
+     , 9)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>/bin/ba, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(/bin/bash</RPM:Resource>
+     , 9)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource>/bin/sh, 9)
+SAX.startElement(RPM:Resource)
+SAX.characters(/bin/sh</RPM:Resource>
+      <, 7)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+      </RDF:Bag>
+    </RPM:Re, 7)
+SAX.endElement(RDF:Bag)
+SAX.characters(
+    </RPM:Requires>
+    <RPM:, 5)
+SAX.endElement(RPM:Requires)
+SAX.characters(
+    <RPM:Files>/bin/rpm
+/usr/, 5)
+SAX.startElement(RPM:Files)
+SAX.characters(/bin/rpm
+/usr/bin/find-provide, 885)
+SAX.endElement(RPM:Files)
+SAX.characters(
+  </RDF:Description>
+</RDF:RD, 3)
+SAX.endElement(RDF:Description)
+SAX.characters(
+</RDF:RDF>
+, 1)
+SAX.endElement(RDF:RDF)
+SAX.endDocument()
diff --git a/SAXresult/rdf2 b/SAXresult/rdf2
new file mode 100644
index 0000000..bd7dbb2
--- /dev/null
+++ b/SAXresult/rdf2
@@ -0,0 +1,193 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(RDF:RDF, xmlns:RDF='http://www.w3.org/TR/WD-rdf-syntax#', xmlns:RPM='http://www.rpm.org/')
+SAX.characters(
+  <RDF:Description about="ftp, 3)
+SAX.startElement(RDF:Description, about='ftp://rufus.w3.org/linux/dld/5.4/i386/RPMS/i386/ncurses4-4.2-3.i386.rpm')
+SAX.characters(
+    <RPM:Name>ncurses4</RPM:N, 5)
+SAX.startElement(RPM:Name)
+SAX.characters(ncurses4</RPM:Name>
+    <RPM:V, 8)
+SAX.endElement(RPM:Name)
+SAX.characters(
+    <RPM:Version>4.2</RPM:Ver, 5)
+SAX.startElement(RPM:Version)
+SAX.characters(4.2</RPM:Version>
+    <RPM:Rel, 3)
+SAX.endElement(RPM:Version)
+SAX.characters(
+    <RPM:Release>3</RPM:Relea, 5)
+SAX.startElement(RPM:Release)
+SAX.characters(3</RPM:Release>
+    <RPM:Arch>, 1)
+SAX.endElement(RPM:Release)
+SAX.characters(
+    <RPM:Arch>i386</RPM:Arch>, 5)
+SAX.startElement(RPM:Arch)
+SAX.characters(i386</RPM:Arch>
+    <RPM:Os>Li, 4)
+SAX.endElement(RPM:Arch)
+SAX.characters(
+    <RPM:Os>Linux</RPM:Os>
+  , 5)
+SAX.startElement(RPM:Os)
+SAX.characters(Linux</RPM:Os>
+    <RPM:Distri, 5)
+SAX.endElement(RPM:Os)
+SAX.characters(
+    <RPM:Distribution>DLD</RP, 5)
+SAX.startElement(RPM:Distribution)
+SAX.characters(DLD</RPM:Distribution>
+    <RP, 3)
+SAX.endElement(RPM:Distribution)
+SAX.characters(
+    <RPM:Vendor>delix Compute, 5)
+SAX.startElement(RPM:Vendor)
+SAX.characters(delix Computer GmbH</RPM:Vendo, 19)
+SAX.endElement(RPM:Vendor)
+SAX.characters(
+    <RPM:Packager>Till Bubeck, 5)
+SAX.startElement(RPM:Packager)
+SAX.characters(Till Bubeck &lt;bubeck@delix.d, 12)
+SAX.getEntity(lt)
+SAX.characters(<, 1)
+SAX.characters(bubeck@delix.de&gt;, Ngo Than , 15)
+SAX.getEntity(gt)
+SAX.characters(>, 1)
+SAX.characters(, Ngo Than &lt;than@delix.de&g, 11)
+SAX.getEntity(lt)
+SAX.characters(<, 1)
+SAX.characters(than@delix.de&gt;</RPM:Package, 13)
+SAX.getEntity(gt)
+SAX.characters(>, 1)
+SAX.endElement(RPM:Packager)
+SAX.characters(
+    <RPM:Group>Libraries</RPM, 5)
+SAX.startElement(RPM:Group)
+SAX.characters(Libraries</RPM:Group>
+    <RPM, 9)
+SAX.endElement(RPM:Group)
+SAX.characters(
+    <RPM:Summary>Bibliothek z, 5)
+SAX.startElement(RPM:Summary)
+SAX.characters(Bibliothek zur Ansteuerung von, 40)
+SAX.endElement(RPM:Summary)
+SAX.characters(
+    <RPM:Description>Diese Li, 5)
+SAX.startElement(RPM:Description)
+SAX.characters(Diese Library stellt dem Progr, 57)
+SAX.characters(ä, 1)
+SAX.characters(ngige
+Routinen zur Ansteuerung, 57)
+SAX.characters(ü, 1)
+SAX.characters(gung, die
+speziell optimiert s, 57)
+SAX.getEntity(apos)
+SAX.characters(', 1)
+SAX.characters(new curses&apos; (ncurses) Var, 10)
+SAX.getEntity(apos)
+SAX.characters(', 1)
+SAX.characters( (ncurses) Variante und ist de, 51)
+SAX.characters(ü, 1)
+SAX.characters(r die klassische Curses-Librar, 70)
+SAX.endElement(RPM:Description)
+SAX.characters(
+    <RPM:Copyright>GPL</RPM:C, 5)
+SAX.startElement(RPM:Copyright)
+SAX.characters(GPL</RPM:Copyright>
+    <RPM:S, 3)
+SAX.endElement(RPM:Copyright)
+SAX.characters(
+    <RPM:Sources>ncurses4-4.2, 5)
+SAX.startElement(RPM:Sources)
+SAX.characters(ncurses4-4.2-3.src.rpm</RPM:So, 22)
+SAX.endElement(RPM:Sources)
+SAX.characters(
+    <RPM:BuildDate>Tue May 12, 5)
+SAX.startElement(RPM:BuildDate)
+SAX.characters(Tue May 12 19:30:26 1998</RPM:, 24)
+SAX.endElement(RPM:BuildDate)
+SAX.characters(
+    <RPM:Date>895015826</RPM:, 5)
+SAX.startElement(RPM:Date)
+SAX.characters(895015826</RPM:Date>
+    <RPM:, 9)
+SAX.endElement(RPM:Date)
+SAX.characters(
+    <RPM:Size>1373513</RPM:Si, 5)
+SAX.startElement(RPM:Size)
+SAX.characters(1373513</RPM:Size>
+    <RPM:Bu, 7)
+SAX.endElement(RPM:Size)
+SAX.characters(
+    <RPM:BuildHost>erdbeere.d, 5)
+SAX.startElement(RPM:BuildHost)
+SAX.characters(erdbeere.delix.de</RPM:BuildHo, 17)
+SAX.endElement(RPM:BuildHost)
+SAX.characters(
+    <RPM:Provides>
+      <RDF, 5)
+SAX.startElement(RPM:Provides)
+SAX.characters(
+      <RDF:Bag>
+        <RPM:, 7)
+SAX.startElement(RDF:Bag)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/ncurses4.rdf')
+SAX.characters(ncurses4</RPM:Resource>
+      , 8)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/libpanel.so.4.rdf')
+SAX.characters(libpanel.so.4</RPM:Resource>
+ , 13)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/libncurses.so.4.rdf')
+SAX.characters(libncurses.so.4</RPM:Resource>, 15)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/libmenu.so.4.rdf')
+SAX.characters(libmenu.so.4</RPM:Resource>
+  , 12)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/libform.so.4.rdf')
+SAX.characters(libform.so.4</RPM:Resource>
+  , 12)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+        <RPM:Resource href="., 9)
+SAX.startElement(RPM:Resource, href='../../../../../resources/ncurses.rdf')
+SAX.characters(ncurses</RPM:Resource>
+      <, 7)
+SAX.endElement(RPM:Resource)
+SAX.characters(
+      </RDF:Bag>
+    </RPM:Pr, 7)
+SAX.endElement(RDF:Bag)
+SAX.characters(
+    </RPM:Provides>
+    <RPM:, 5)
+SAX.endElement(RPM:Provides)
+SAX.characters(
+    <RPM:Files>/lib/libncurse, 5)
+SAX.startElement(RPM:Files)
+SAX.characters(/lib/libncurses.so.4
+/lib/libn, 72915)
+SAX.endElement(RPM:Files)
+SAX.characters(
+  </RDF:Description>
+</RDF:RD, 3)
+SAX.endElement(RDF:Description)
+SAX.characters(
+</RDF:RDF>
+, 1)
+SAX.endElement(RDF:RDF)
+SAX.endDocument()
diff --git a/SAXresult/svg1 b/SAXresult/svg1
new file mode 100644
index 0000000..042e52f
--- /dev/null
+++ b/SAXresult/svg1
@@ -0,0 +1,627 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(svg, -//W3C//DTD SVG April 1999//EN, http://www.w3.org/Graphics/SVG/svg-19990412.dtd)
+SAX.resolveEntity(-//W3C//DTD SVG April 1999//EN, http://www.w3.org/Graphics/SVG/svg-19990412.dtd)
+SAX.startElement(svg, width='242px', height='383px')
+SAX.characters(
+<g style = "stroke: #000000" , 1)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+</g> 
+<g style = "fill: #f2c, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #f2cc99" >, 2)
+SAX.startElement(g, style='fill: #f2cc99')
+SAX.characters( 
+   <polyline verts = " 69,18, 5)
+SAX.startElement(polyline, verts=' 69,18 82,8 99,3 118,5 135,12 149,21 156,13 165,9 177,13 183,28 180,50 164,91 155,107 154,114 151,121 141,127 139,136 155,206 157,251 126,342 133,357 128,376 83,376 75,368 67,350 61,350 53,369 4,369 2,361 5,354 12,342 16,321 4,257 4,244 7,218 9,179 26,127 43,93 32,77 30,70 24,67 16,49 17,35 18,23 30,12 40,7 53,7 62,12 69,18 69,18 69,18')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #e5b, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #e5b27f" >, 2)
+SAX.startElement(g, style='fill: #e5b27f')
+SAX.characters( 
+   <polyline verts = " 142,7, 5)
+SAX.startElement(polyline, verts=' 142,79 136,74 138,82 133,78 133,84 127,78 128,85 124,80 125,87 119,82 119,90 125,99 125,96 128,100 128,94 131,98 132,93 135,97 136,93 138,97 139,94 141,98 143,94 144,85 142,79 142,79 142,79')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #eb8, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #eb8080" >, 2)
+SAX.startElement(g, style='fill: #eb8080')
+SAX.characters( 
+   <polyline verts = " 127,1, 5)
+SAX.startElement(polyline, verts=' 127,101 132,100 137,99 144,101 143,105 135,110 127,101 127,101 127,101')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #f2c, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #f2cc99" >, 2)
+SAX.startElement(g, style='fill: #f2cc99')
+SAX.characters( 
+   <polyline verts = " 178,2, 5)
+SAX.startElement(polyline, verts=' 178,229 157,248 139,296 126,349 137,356 158,357 183,342 212,332 235,288 235,261 228,252 212,250 188,251 178,229 178,229 178,229')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #9c8, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #9c826b" >, 2)
+SAX.startElement(g, style='fill: #9c826b')
+SAX.characters( 
+   <polyline verts = " 56,22, 5)
+SAX.startElement(polyline, verts=' 56,229 48,241 48,250 57,281 63,325 71,338 81,315 76,321 79,311 83,301 75,308 80,298 73,303 76,296 71,298 74,292 69,293 74,284 78,278 71,278 74,274 68,273 70,268 66,267 68,261 60,266 62,259 65,253 57,258 59,251 55,254 55,248 60,237 54,240 58,234 54,236 56,229 56,229 56,229')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 74,36, 5)
+SAX.startElement(polyline, verts=' 74,363 79,368 81,368 85,362 89,363 92,370 96,373 101,372 108,361 110,371 113,373 116,371 120,358 122,363 123,371 126,371 129,367 132,357 135,361 130,376 127,377 94,378 84,376 76,371 74,363 74,363 74,363')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 212,2, 5)
+SAX.startElement(polyline, verts=' 212,250 219,251 228,258 236,270 235,287 225,304 205,332 177,343 171,352 158,357 166,352 168,346 168,339 165,333 155,327 155,323 161,320 165,316 169,316 167,312 171,313 168,308 173,309 170,306 177,306 175,308 177,311 174,311 176,316 171,315 174,319 168,320 168,323 175,327 179,332 183,326 184,332 189,323 190,328 194,320 194,325 199,316 201,320 204,313 206,316 208,310 211,305 219,298 226,288 229,279 228,266 224,259 217,253 212,250 212,250 212,250')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 151,2, 5)
+SAX.startElement(polyline, verts=' 151,205 151,238 149,252 141,268 128,282 121,301 130,300 126,313 118,324 116,337 120,346 133,352 133,340 137,333 145,329 156,327 153,319 153,291 157,271 170,259 178,277 193,250 174,216 151,205 151,205 151,205')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 78,12, 5)
+SAX.startElement(polyline, verts=' 78,127 90,142 95,155 108,164 125,167 139,175 150,206 152,191 141,140 121,148 100,136 78,127 78,127 78,127')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 21,58, 5)
+SAX.startElement(polyline, verts=' 21,58 35,63 38,68 32,69 42,74 40,79 47,80 54,83 45,94 34,81 32,73 24,66 21,58 21,58 21,58')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 71,34, 5)
+SAX.startElement(polyline, verts=' 71,34 67,34 66,27 59,24 54,17 48,17 39,22 30,26 28,31 31,39 38,46 29,45 36,54 41,61 41,70 50,69 54,71 55,58 67,52 76,43 76,39 68,44 71,34 71,34 71,34')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 139,7, 5)
+SAX.startElement(polyline, verts=' 139,74 141,83 143,89 144,104 148,104 155,106 154,86 157,77 155,72 150,77 144,77 139,74 139,74 139,74')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 105,4, 5)
+SAX.startElement(polyline, verts=' 105,44 102,53 108,58 111,62 112,55 105,44 105,44 105,44')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 141,4, 5)
+SAX.startElement(polyline, verts=' 141,48 141,54 144,58 139,62 137,66 136,59 137,52 141,48 141,48 141,48')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 98,13, 5)
+SAX.startElement(polyline, verts=' 98,135 104,130 105,134 108,132 108,135 112,134 113,137 116,136 116,139 119,139 124,141 128,140 133,138 140,133 139,140 126,146 104,144 98,135 98,135 98,135')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 97,11, 5)
+SAX.startElement(polyline, verts=' 97,116 103,119 103,116 111,118 116,117 122,114 127,107 135,111 142,107 141,114 145,118 149,121 145,125 140,124 127,121 113,125 100,124 97,116 97,116 97,116')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 147,3, 5)
+SAX.startElement(polyline, verts=' 147,33 152,35 157,34 153,31 160,31 156,28 161,28 159,24 163,25 163,21 165,22 170,23 167,17 172,21 174,18 175,23 176,22 177,28 177,33 174,37 176,39 174,44 171,49 168,53 164,57 159,68 156,70 154,60 150,51 146,43 144,35 147,33 147,33 147,33')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 85,72, 5)
+SAX.startElement(polyline, verts=' 85,72 89,74 93,75 100,76 105,75 102,79 94,79 88,76 85,72 85,72 85,72')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 86,21, 5)
+SAX.startElement(polyline, verts=' 86,214 79,221 76,232 82,225 78,239 82,234 78,245 81,243 79,255 84,250 84,267 87,254 90,271 90,257 95,271 93,256 95,249 92,252 93,243 89,253 89,241 86,250 87,236 83,245 87,231 82,231 90,219 84,221 86,214 86,214 86,214')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #ffc, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #ffcc7f" >, 2)
+SAX.startElement(g, style='fill: #ffcc7f')
+SAX.characters( 
+   <polyline verts = " 93,68, 5)
+SAX.startElement(polyline, verts=' 93,68 96,72 100,73 106,72 108,66 105,63 100,62 93,68 93,68 93,68')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 144,6, 5)
+SAX.startElement(polyline, verts=' 144,64 142,68 142,73 146,74 150,73 154,64 149,62 144,64 144,64 144,64')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #9c8, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #9c826b" >, 2)
+SAX.startElement(g, style='fill: #9c826b')
+SAX.characters( 
+   <polyline verts = " 57,91, 5)
+SAX.startElement(polyline, verts=' 57,91 42,111 52,105 41,117 53,112 46,120 53,116 50,124 57,119 55,127 61,122 60,130 67,126 66,134 71,129 72,136 77,130 76,137 80,133 82,138 86,135 96,135 94,129 86,124 83,117 77,123 79,117 73,120 75,112 68,116 71,111 65,114 69,107 63,110 68,102 61,107 66,98 61,103 63,97 57,99 57,91 57,91 57,91')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 83,79, 5)
+SAX.startElement(polyline, verts=' 83,79 76,79 67,82 75,83 65,88 76,87 65,92 76,91 68,96 77,95 70,99 80,98 72,104 80,102 76,108 85,103 92,101 87,98 93,96 86,94 91,93 85,91 93,89 99,89 105,93 107,85 102,82 92,80 83,79 83,79 83,79')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 109,7, 5)
+SAX.startElement(polyline, verts=' 109,77 111,83 109,89 113,94 117,90 117,81 114,78 109,77 109,77 109,77')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 122,1, 5)
+SAX.startElement(polyline, verts=' 122,128 127,126 134,127 136,129 134,130 130,128 124,129 122,128 122,128 122,128')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 78,27, 5)
+SAX.startElement(polyline, verts=' 78,27 82,32 80,33 82,36 78,37 82,40 78,42 81,46 76,47 78,49 74,50 82,52 87,50 83,48 91,46 86,45 91,42 88,40 92,37 86,34 90,31 86,29 89,26 78,27 78,27 78,27')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 82,17, 5)
+SAX.startElement(polyline, verts=' 82,17 92,20 79,21 90,25 81,25 94,28 93,26 101,30 101,26 107,33 108,28 111,40 113,34 115,45 117,39 119,54 121,46 124,58 126,47 129,59 130,49 134,58 133,44 137,48 133,37 137,40 133,32 126,20 135,26 132,19 138,23 135,17 142,18 132,11 116,6 94,6 78,11 92,12 80,14 90,16 82,17 82,17 82,17')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 142,2, 5)
+SAX.startElement(polyline, verts=' 142,234 132,227 124,223 115,220 110,225 118,224 127,229 135,236 122,234 115,237 113,242 121,238 139,243 121,245 111,254 95,254 102,244 104,235 110,229 100,231 104,224 113,216 122,215 132,217 141,224 145,230 149,240 142,234 142,234 142,234')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 115,2, 5)
+SAX.startElement(polyline, verts=' 115,252 125,248 137,249 143,258 134,255 125,254 115,252 115,252 115,252')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 114,2, 5)
+SAX.startElement(polyline, verts=' 114,212 130,213 140,219 147,225 144,214 137,209 128,207 114,212 114,212 114,212')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 102,2, 5)
+SAX.startElement(polyline, verts=' 102,263 108,258 117,257 131,258 116,260 109,265 102,263 102,263 102,263')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 51,24, 5)
+SAX.startElement(polyline, verts=' 51,241 35,224 40,238 23,224 31,242 19,239 28,247 17,246 25,250 37,254 39,263 44,271 47,294 48,317 51,328 60,351 60,323 53,262 47,246 51,241 51,241 51,241')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 2,364, 5)
+SAX.startElement(polyline, verts=' 2,364 9,367 14,366 18,355 20,364 26,366 31,357 35,364 39,364 42,357 47,363 53,360 59,357 54,369 7,373 2,364 2,364 2,364')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 7,349, 5)
+SAX.startElement(polyline, verts=' 7,349 19,345 25,339 18,341 23,333 28,326 23,326 27,320 23,316 25,311 20,298 15,277 12,264 9,249 10,223 3,248 5,261 15,307 17,326 11,343 7,349 7,349 7,349')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 11,22, 5)
+SAX.startElement(polyline, verts=' 11,226 15,231 25,236 18,227 11,226 11,226 11,226')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 13,21, 5)
+SAX.startElement(polyline, verts=' 13,214 19,217 32,227 23,214 16,208 15,190 24,148 31,121 24,137 14,170 8,189 13,214 13,214 13,214')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 202,2, 5)
+SAX.startElement(polyline, verts=' 202,254 195,258 199,260 193,263 197,263 190,268 196,268 191,273 188,282 200,272 194,272 201,266 197,265 204,262 200,258 204,256 202,254 202,254 202,254')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #845, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #845433" >, 2)
+SAX.startElement(g, style='fill: #845433')
+SAX.characters( 
+   <polyline verts = " 151,2, 5)
+SAX.startElement(polyline, verts=' 151,213 165,212 179,225 189,246 187,262 179,275 176,263 177,247 171,233 163,230 165,251 157,264 146,298 145,321 133,326 143,285 154,260 153,240 151,213 151,213 151,213')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 91,13, 5)
+SAX.startElement(polyline, verts=' 91,132 95,145 97,154 104,148 107,155 109,150 111,158 115,152 118,159 120,153 125,161 126,155 133,164 132,154 137,163 137,152 142,163 147,186 152,192 148,167 141,143 124,145 105,143 91,132 91,132 91,132')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #9c8, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #9c826b" >, 2)
+SAX.startElement(g, style='fill: #9c826b')
+SAX.characters( 
+   <polyline verts = " 31,57, 5)
+SAX.startElement(polyline, verts=' 31,57 23,52 26,51 20,44 23,42 21,36 22,29 25,23 24,32 30,43 26,41 30,50 26,48 31,57 31,57 31,57')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 147,2, 5)
+SAX.startElement(polyline, verts=' 147,21 149,28 155,21 161,16 167,14 175,15 173,11 161,9 147,21 147,21 147,21')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 181,3, 5)
+SAX.startElement(polyline, verts=' 181,39 175,51 169,57 171,65 165,68 165,75 160,76 162,91 171,71 180,51 181,39 181,39 181,39')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 132,3, 5)
+SAX.startElement(polyline, verts=' 132,346 139,348 141,346 142,341 147,342 143,355 133,350 132,346 132,346 132,346')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 146,3, 5)
+SAX.startElement(polyline, verts=' 146,355 151,352 155,348 157,343 160,349 151,356 147,357 146,355 146,355 146,355')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 99,26, 5)
+SAX.startElement(polyline, verts=' 99,266 100,281 94,305 86,322 78,332 72,346 73,331 91,291 99,266 99,266 99,266')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 20,34, 5)
+SAX.startElement(polyline, verts=' 20,347 32,342 45,340 54,345 45,350 42,353 38,350 31,353 29,356 23,350 19,353 15,349 20,347 20,347 20,347')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 78,34, 5)
+SAX.startElement(polyline, verts=' 78,344 86,344 92,349 88,358 84,352 78,344 78,344 78,344')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 93,34, 5)
+SAX.startElement(polyline, verts=' 93,347 104,344 117,345 124,354 121,357 116,351 112,351 108,355 102,351 93,347 93,347 93,347')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #000, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #000000" >, 2)
+SAX.startElement(g, style='fill: #000000')
+SAX.characters( 
+   <polyline verts = " 105,1, 5)
+SAX.startElement(polyline, verts=' 105,12 111,18 113,24 113,29 119,34 116,23 112,16 105,12 105,12 105,12')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 122,2, 5)
+SAX.startElement(polyline, verts=' 122,27 125,34 127,43 128,34 125,29 122,27 122,27 122,27')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 115,1, 5)
+SAX.startElement(polyline, verts=' 115,13 122,19 122,15 113,10 115,13 115,13 115,13')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #ffe, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #ffe5b2" >, 2)
+SAX.startElement(g, style='fill: #ffe5b2')
+SAX.characters( 
+   <polyline verts = " 116,1, 5)
+SAX.startElement(polyline, verts=' 116,172 107,182 98,193 98,183 90,199 89,189 84,207 88,206 87,215 95,206 93,219 91,230 98,216 97,226 104,214 112,209 104,208 113,202 126,200 139,207 132,198 142,203 134,192 142,195 134,187 140,185 130,181 136,177 126,177 125,171 116,180 116,172 116,172 116,172')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 74,22, 5)
+SAX.startElement(polyline, verts=' 74,220 67,230 67,221 59,235 63,233 60,248 70,232 65,249 71,243 67,256 73,250 69,262 73,259 71,267 76,262 72,271 78,270 76,275 82,274 78,290 86,279 86,289 92,274 88,275 87,264 82,270 82,258 77,257 78,247 73,246 77,233 72,236 74,220 74,220 74,220')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 133,2, 5)
+SAX.startElement(polyline, verts=' 133,230 147,242 148,250 145,254 138,247 129,246 142,245 138,241 128,237 137,238 133,230 133,230 133,230')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 133,2, 5)
+SAX.startElement(polyline, verts=' 133,261 125,261 116,263 111,267 125,265 133,261 133,261 133,261')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 121,2, 5)
+SAX.startElement(polyline, verts=' 121,271 109,273 103,279 99,305 92,316 85,327 83,335 89,340 97,341 94,336 101,336 96,331 103,330 97,327 108,325 99,322 109,321 100,318 110,317 105,314 110,312 107,310 113,308 105,306 114,303 105,301 115,298 107,295 115,294 108,293 117,291 109,289 117,286 109,286 118,283 112,281 118,279 114,278 119,276 115,274 121,271 121,271 121,271')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 79,36, 5)
+SAX.startElement(polyline, verts=' 79,364 74,359 74,353 76,347 80,351 83,356 82,360 79,364 79,364 79,364')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 91,36, 5)
+SAX.startElement(polyline, verts=' 91,363 93,356 97,353 103,355 105,360 103,366 99,371 94,368 91,363 91,363 91,363')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 110,3, 5)
+SAX.startElement(polyline, verts=' 110,355 114,353 118,357 117,363 113,369 111,362 110,355 110,355 110,355')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 126,3, 5)
+SAX.startElement(polyline, verts=' 126,354 123,358 124,367 126,369 129,361 129,357 126,354 126,354 126,354')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 30,15, 5)
+SAX.startElement(polyline, verts=' 30,154 24,166 20,182 23,194 29,208 37,218 41,210 41,223 46,214 46,227 52,216 52,227 61,216 59,225 68,213 73,219 70,207 77,212 69,200 77,202 70,194 78,197 68,187 76,182 64,182 58,175 58,185 53,177 50,186 46,171 44,182 39,167 36,172 36,162 30,166 30,154 30,154 30,154')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 44,13, 5)
+SAX.startElement(polyline, verts=' 44,130 41,137 45,136 43,150 48,142 48,157 53,150 52,164 60,156 61,169 64,165 66,175 70,167 74,176 77,168 80,183 85,172 90,182 93,174 98,181 99,173 104,175 105,169 114,168 102,163 95,157 94,166 90,154 87,162 82,149 75,159 72,148 68,155 67,143 62,148 62,138 58,145 56,133 52,142 52,128 49,134 47,125 44,130 44,130 44,130')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 13,21, 5)
+SAX.startElement(polyline, verts=' 13,216 19,219 36,231 22,223 16,222 22,227 12,224 13,220 16,220 13,216 13,216 13,216')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 10,23, 5)
+SAX.startElement(polyline, verts=' 10,231 14,236 25,239 27,237 19,234 10,231 10,231 10,231')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 9,245, 5)
+SAX.startElement(polyline, verts=' 9,245 14,242 25,245 13,245 9,245 9,245 9,245')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 33,25, 5)
+SAX.startElement(polyline, verts=' 33,255 26,253 18,254 25,256 18,258 27,260 18,263 27,265 19,267 29,270 21,272 29,276 21,278 30,281 22,283 31,287 24,288 32,292 23,293 34,298 26,299 37,303 32,305 39,309 33,309 39,314 34,314 40,318 34,317 40,321 34,321 41,326 33,326 40,330 33,332 39,333 33,337 42,337 54,341 49,337 52,335 47,330 50,330 45,325 49,325 45,321 48,321 45,316 46,306 45,286 43,274 36,261 33,255 33,255 33,255')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 7,358, 5)
+SAX.startElement(polyline, verts=' 7,358 9,351 14,351 17,359 11,364 7,358 7,358 7,358')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 44,35, 5)
+SAX.startElement(polyline, verts=' 44,354 49,351 52,355 49,361 44,354 44,354 44,354')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 32,35, 5)
+SAX.startElement(polyline, verts=' 32,357 37,353 40,358 36,361 32,357 32,357 32,357')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 139,3, 5)
+SAX.startElement(polyline, verts=' 139,334 145,330 154,330 158,334 154,341 152,348 145,350 149,340 147,336 141,339 139,345 136,342 136,339 139,334 139,334 139,334')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 208,2, 5)
+SAX.startElement(polyline, verts=' 208,259 215,259 212,255 220,259 224,263 225,274 224,283 220,292 208,300 206,308 203,304 199,315 197,309 195,318 193,313 190,322 190,316 185,325 182,318 180,325 172,321 178,320 176,313 186,312 180,307 188,307 184,303 191,302 186,299 195,294 187,290 197,288 192,286 201,283 194,280 203,277 198,275 207,271 200,269 209,265 204,265 212,262 208,259 208,259 208,259')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 106,1, 5)
+SAX.startElement(polyline, verts=' 106,126 106,131 109,132 111,134 115,132 115,135 119,133 118,137 123,137 128,137 133,134 136,130 136,127 132,124 118,128 112,128 106,126 106,126 106,126')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 107,1, 5)
+SAX.startElement(polyline, verts=' 107,114 101,110 98,102 105,97 111,98 119,102 121,108 118,112 113,115 107,114 107,114 107,114')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 148,1, 5)
+SAX.startElement(polyline, verts=' 148,106 145,110 146,116 150,118 152,111 151,107 148,106 148,106 148,106')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 80,55, 5)
+SAX.startElement(polyline, verts=' 80,55 70,52 75,58 63,57 72,61 57,61 67,66 57,67 62,69 54,71 61,73 54,77 63,78 53,85 60,84 56,90 69,84 63,82 75,76 70,75 77,72 72,71 78,69 72,66 81,67 78,64 82,63 80,60 86,62 80,55 80,55 80,55')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 87,56, 5)
+SAX.startElement(polyline, verts=' 87,56 91,52 96,50 102,56 98,56 92,60 87,56 87,56 87,56')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 85,68, 5)
+SAX.startElement(polyline, verts=' 85,68 89,73 98,76 106,74 96,73 91,70 85,68 85,68 85,68')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 115,5, 5)
+SAX.startElement(polyline, verts=' 115,57 114,64 111,64 115,75 122,81 122,74 126,79 126,74 131,78 130,72 133,77 131,68 126,61 119,57 115,57 115,57 115,57')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 145,4, 5)
+SAX.startElement(polyline, verts=' 145,48 143,53 147,59 151,59 150,55 145,48 145,48 145,48')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 26,22, 5)
+SAX.startElement(polyline, verts=' 26,22 34,15 43,10 52,10 59,16 47,15 32,22 26,22 26,22 26,22')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 160,1, 5)
+SAX.startElement(polyline, verts=' 160,19 152,26 149,34 154,33 152,30 157,30 155,26 158,27 157,23 161,23 160,19 160,19 160,19')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "fill: #000, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #000000" >, 2)
+SAX.startElement(g, style='fill: #000000')
+SAX.characters( 
+   <polyline verts = " 98,11, 5)
+SAX.startElement(polyline, verts=' 98,117 105,122 109,122 105,117 113,120 121,120 130,112 128,108 123,103 123,99 128,101 132,106 135,109 142,105 142,101 145,101 145,91 148,101 145,105 136,112 135,116 143,124 148,120 150,122 142,128 133,122 121,125 112,126 103,125 100,129 96,124 98,117 98,117 98,117')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 146,1, 5)
+SAX.startElement(polyline, verts=' 146,118 152,118 152,115 149,115 146,118 146,118 146,118')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 148,1, 5)
+SAX.startElement(polyline, verts=' 148,112 154,111 154,109 149,109 148,112 148,112 148,112')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 106,1, 5)
+SAX.startElement(polyline, verts=' 106,112 108,115 114,116 118,114 106,112 106,112 106,112')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 108,1, 5)
+SAX.startElement(polyline, verts=' 108,108 111,110 116,110 119,108 108,108 108,108 108,108')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 106,1, 5)
+SAX.startElement(polyline, verts=' 106,104 109,105 117,106 115,104 106,104 106,104 106,104')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 50,25, 5)
+SAX.startElement(polyline, verts=' 50,25 41,26 34,33 39,43 49,58 36,51 47,68 55,69 54,59 61,57 74,46 60,52 67,42 57,48 61,40 54,45 60,36 59,29 48,38 52,30 47,32 50,25 50,25 50,25')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 147,3, 5)
+SAX.startElement(polyline, verts=' 147,34 152,41 155,49 161,53 157,47 164,47 158,43 168,44 159,40 164,37 169,37 164,33 169,34 165,28 170,30 170,25 173,29 175,27 176,32 173,36 175,39 172,42 172,46 168,49 170,55 162,57 158,63 155,58 153,50 149,46 147,34 147,34 147,34')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 155,7, 5)
+SAX.startElement(polyline, verts=' 155,71 159,80 157,93 157,102 155,108 150,101 149,93 154,101 152,91 151,83 155,79 155,71 155,71 155,71')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 112,7, 5)
+SAX.startElement(polyline, verts=' 112,78 115,81 114,91 112,87 113,82 112,78 112,78 112,78')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 78,28, 5)
+SAX.startElement(polyline, verts=' 78,28 64,17 58,11 47,9 36,10 28,16 21,26 18,41 20,51 23,61 33,65 28,68 37,74 36,81 43,87 48,90 43,100 40,98 39,90 31,80 30,72 22,71 17,61 14,46 16,28 23,17 33,9 45,6 54,6 65,12 78,28 78,28 78,28')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 67,18, 5)
+SAX.startElement(polyline, verts=' 67,18 76,9 87,5 101,2 118,3 135,8 149,20 149,26 144,19 132,12 121,9 105,7 89,8 76,14 70,20 67,18 67,18 67,18')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 56,98, 5)
+SAX.startElement(polyline, verts=' 56,98 48,106 56,103 47,112 56,110 52,115 57,113 52,121 62,115 58,123 65,119 63,125 69,121 68,127 74,125 74,129 79,128 83,132 94,135 93,129 85,127 81,122 76,126 75,121 71,124 71,117 66,121 66,117 62,117 64,112 60,113 60,110 57,111 61,105 57,107 60,101 55,102 56,98 56,98 56,98')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 101,1, 5)
+SAX.startElement(polyline, verts=' 101,132 103,138 106,134 106,139 112,136 111,142 115,139 114,143 119,142 125,145 131,142 135,138 140,134 140,129 143,135 145,149 150,171 149,184 145,165 141,150 136,147 132,151 131,149 126,152 125,150 121,152 117,148 111,152 110,148 105,149 104,145 98,150 96,138 94,132 94,130 98,132 101,132 101,132 101,132')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 41,94, 5)
+SAX.startElement(polyline, verts=' 41,94 32,110 23,132 12,163 6,190 7,217 5,236 3,247 9,230 12,211 12,185 18,160 26,134 35,110 43,99 41,94 41,94 41,94')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 32,24, 5)
+SAX.startElement(polyline, verts=' 32,246 41,250 50,257 52,267 53,295 53,323 59,350 54,363 51,365 44,366 42,360 40,372 54,372 59,366 62,353 71,352 75,335 73,330 66,318 68,302 64,294 67,288 63,286 63,279 59,275 58,267 56,262 50,247 42,235 44,246 32,236 35,244 32,246 32,246 32,246')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 134,3, 5)
+SAX.startElement(polyline, verts=' 134,324 146,320 159,322 173,327 179,337 179,349 172,355 158,357 170,350 174,343 170,333 163,328 152,326 134,329 134,324 134,324 134,324')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 173,3, 5)
+SAX.startElement(polyline, verts=' 173,339 183,334 184,338 191,329 194,332 199,323 202,325 206,318 209,320 213,309 221,303 228,296 232,289 234,279 233,269 230,262 225,256 219,253 208,252 198,252 210,249 223,250 232,257 237,265 238,277 238,291 232,305 221,323 218,335 212,342 200,349 178,348 173,339 173,339 173,339')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 165,2, 5)
+SAX.startElement(polyline, verts=' 165,296 158,301 156,310 156,323 162,324 159,318 162,308 162,304 165,296 165,296 165,296')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 99,25, 5)
+SAX.startElement(polyline, verts=' 99,252 105,244 107,234 115,228 121,228 131,235 122,233 113,235 109,246 121,239 133,243 121,243 110,251 99,252 99,252 99,252')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 117,2, 5)
+SAX.startElement(polyline, verts=' 117,252 124,247 134,249 136,253 126,252 117,252 117,252 117,252')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 117,2, 5)
+SAX.startElement(polyline, verts=' 117,218 132,224 144,233 140,225 132,219 117,218 117,218 117,218')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 122,2, 5)
+SAX.startElement(polyline, verts=' 122,212 134,214 143,221 141,213 132,210 122,212 122,212 122,212')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 69,35, 5)
+SAX.startElement(polyline, verts=' 69,352 70,363 76,373 86,378 97,379 108,379 120,377 128,378 132,373 135,361 133,358 132,366 127,375 121,374 121,362 119,367 117,374 110,376 110,362 107,357 106,371 104,375 97,376 90,375 90,368 86,362 83,364 86,369 85,373 78,370 73,362 71,351 69,352 69,352 69,352')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 100,3, 5)
+SAX.startElement(polyline, verts=' 100,360 96,363 99,369 102,364 100,360 100,360 100,360')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 115,3, 5)
+SAX.startElement(polyline, verts=' 115,360 112,363 114,369 117,364 115,360 115,360 115,360')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 127,3, 5)
+SAX.startElement(polyline, verts=' 127,362 125,364 126,369 128,365 127,362 127,362 127,362')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 5,255, 5)
+SAX.startElement(polyline, verts=' 5,255 7,276 11,304 15,320 13,334 6,348 2,353 0,363 5,372 12,374 25,372 38,372 44,369 42,367 36,368 31,369 30,360 27,368 20,370 16,361 15,368 10,369 3,366 3,359 6,352 11,348 17,331 19,316 12,291 9,274 5,255 5,255 5,255')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 10,35, 5)
+SAX.startElement(polyline, verts=' 10,358 7,362 10,366 11,362 10,358 10,358 10,358')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 25,35, 5)
+SAX.startElement(polyline, verts=' 25,357 22,360 24,366 27,360 25,357 25,357 25,357')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 37,35, 5)
+SAX.startElement(polyline, verts=' 37,357 34,361 36,365 38,361 37,357 37,357 37,357')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 49,35, 5)
+SAX.startElement(polyline, verts=' 49,356 46,359 47,364 50,360 49,356 49,356 49,356')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 130,1, 5)
+SAX.startElement(polyline, verts=' 130,101 132,102 135,101 139,102 143,103 142,101 137,100 133,100 130,101 130,101 130,101')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 106,4, 5)
+SAX.startElement(polyline, verts=' 106,48 105,52 108,56 109,52 106,48 106,48 106,48')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 139,5, 5)
+SAX.startElement(polyline, verts=' 139,52 139,56 140,60 142,58 141,56 139,52 139,52 139,52')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 25,34, 5)
+SAX.startElement(polyline, verts=' 25,349 29,351 30,355 33,350 37,348 42,351 45,347 49,345 44,343 36,345 25,349 25,349 25,349')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 98,34, 5)
+SAX.startElement(polyline, verts=' 98,347 105,351 107,354 109,349 115,349 120,353 118,349 113,346 104,346 98,347 98,347 98,347')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 83,34, 5)
+SAX.startElement(polyline, verts=' 83,348 87,352 87,357 89,351 87,348 83,348 83,348 83,348')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 155,1, 5)
+SAX.startElement(polyline, verts=' 155,107 163,107 170,107 186,108 175,109 155,109 155,107 155,107 155,107')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 153,1, 5)
+SAX.startElement(polyline, verts=' 153,114 162,113 175,112 192,114 173,114 154,115 153,114 153,114 153,114')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 152,1, 5)
+SAX.startElement(polyline, verts=' 152,118 164,120 180,123 197,129 169,123 151,120 152,118 152,118 152,118')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 68,10, 5)
+SAX.startElement(polyline, verts=' 68,109 87,106 107,106 106,108 88,108 68,109 68,109 68,109')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 105,1, 5)
+SAX.startElement(polyline, verts=' 105,111 95,112 79,114 71,116 85,115 102,113 105,111 105,111 105,111')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 108,1, 5)
+SAX.startElement(polyline, verts=' 108,101 98,99 87,99 78,99 93,100 105,102 108,101 108,101 108,101')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 85,63, 5)
+SAX.startElement(polyline, verts=' 85,63 91,63 97,60 104,60 108,62 111,69 112,75 110,74 108,71 103,73 106,69 105,65 103,64 103,67 102,70 99,70 97,66 94,67 97,72 88,67 84,66 85,63 85,63 85,63')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 140,7, 5)
+SAX.startElement(polyline, verts=' 140,74 141,66 144,61 150,61 156,62 153,70 150,73 152,65 150,65 151,68 149,71 146,71 144,66 143,70 143,74 140,74 140,74 140,74')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 146,2, 5)
+SAX.startElement(polyline, verts=' 146,20 156,11 163,9 172,9 178,14 182,18 184,32 182,42 182,52 177,58 176,67 171,76 165,90 157,105 160,92 164,85 168,78 167,73 173,66 172,62 175,59 174,55 177,53 180,46 181,29 179,21 173,13 166,11 159,13 153,18 148,23 146,20 146,20 146,20')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 150,1, 5)
+SAX.startElement(polyline, verts=' 150,187 148,211 150,233 153,247 148,267 135,283 125,299 136,292 131,313 122,328 122,345 129,352 133,359 133,367 137,359 148,356 140,350 131,347 129,340 132,332 140,328 137,322 140,304 154,265 157,244 155,223 161,220 175,229 186,247 185,260 176,275 178,287 185,277 188,261 196,253 189,236 174,213 150,187 150,187 150,187')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 147,3, 5)
+SAX.startElement(polyline, verts=' 147,338 142,341 143,345 141,354 147,343 147,338 147,338 147,338')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 157,3, 5)
+SAX.startElement(polyline, verts=' 157,342 156,349 150,356 157,353 163,346 162,342 157,342 157,342 157,342')
+SAX.endElement((null))
+SAX.characters( 
+   <polyline verts = " 99,26, 5)
+SAX.startElement(polyline, verts=' 99,265 96,284 92,299 73,339 73,333 87,300 99,265 99,265 99,265')
+SAX.endElement((null))
+SAX.characters( 
+</g></svg>
+

+, 2)
+SAX.endElement(g)
+SAX.endElement(svg)
+SAX.endDocument()
diff --git a/SAXresult/svg2 b/SAXresult/svg2
new file mode 100644
index 0000000..4b602b6
--- /dev/null
+++ b/SAXresult/svg2
@@ -0,0 +1,226 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(svg, -//W3C//DTD SVG April 1999//EN, http://www.w3.org/Graphics/SVG/svg-19990412.dtd)
+SAX.resolveEntity(-//W3C//DTD SVG April 1999//EN, http://www.w3.org/Graphics/SVG/svg-19990412.dtd)
+SAX.startElement(svg, width='268px', height='207px')
+SAX.characters(
+<g style = "stroke: #000000" , 1)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+   <path  d = " M 29 28 "/> , 5)
+SAX.startElement(path, d=' M 29 28 ')
+SAX.endElement((null))
+SAX.characters( 
+   <path  d = " L 19 74 "/> , 5)
+SAX.startElement(path, d=' L 19 74 ')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "stroke: #8, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #800040", 2)
+SAX.startElement(g, style='stroke: #800040')
+SAX.characters( 
+   <polyline verts = " 32,10, 5)
+SAX.startElement(polyline, verts=' 32,100 72,50 90,82 73,16 120,64 152,9 177,107')
+SAX.endElement((null))
+SAX.characters( 
+</g> 
+<g style = "stroke: #0, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #000000", 2)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+</g> 
+<g style = "stroke: #0, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #0000ff", 2)
+SAX.startElement(g, style='stroke: #0000ff')
+SAX.characters( 
+   <rect x = "30" y = "101" , 5)
+SAX.startElement(rect, x='30', y='101', width='51', height='33')
+SAX.endElement((null))
+SAX.characters(
+</g> 
+<g style = "fill: #0000, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #0000ff" >, 2)
+SAX.startElement(g, style='fill: #0000ff')
+SAX.characters( 
+   <ellipse cx = "182" cy = , 5)
+SAX.startElement(ellipse, cx='182', cy='127', major='37', minor='31', angle='90')
+SAX.endElement((null))
+SAX.characters(
+</g> 
+<g style = "fill: #ff00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #ff0000" >, 2)
+SAX.startElement(g, style='fill: #ff0000')
+SAX.characters( 
+   <polyline verts = " 78,18, 5)
+SAX.startElement(polyline, verts=' 78,180 76,151 131,149 136,182 135,182 134,183 127,185 117,186 109,192 104,194 98,199 96,200 95,201 94,202 92,202 85,202 70,200 54,199 47,198 46,197 45,197 37,195 26,193 17,187 9,181 8,181 7,176 6,175 6,173 6,172 6,170 8,164 8,163 8,162 9,162 10,162 11,162 13,162 20,162 26,162 27,162 28,162 30,162 30,163 31,163 32,164 34,166 35,166 36,167 36,168 37,169 38,169 39,169 41,170 43,170 45,170 47,170 49,170 50,168 50,161 50,160 50,159 47,162 78,180')
+SAX.endElement((null))
+SAX.characters( 
+   <g>
+     <desc> Java Font, 5)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Dialog 0, 30)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+   <g>
+     <desc> J, 5)
+SAX.endElement(g)
+SAX.characters(
+   <g>
+     <desc> Java Font , 4)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Helvetic, 33)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+</g> 
+<g style = "st, 5)
+SAX.endElement(g)
+SAX.characters(
+</g> 
+<g style = "stroke: #00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #000000", 2)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+   <text x = "188" y = "36" , 5)
+SAX.startElement(text, x='188', y='36')
+SAX.characters(this is text</text>
+</g> 
+<g s, 12)
+SAX.endElement(text)
+SAX.characters(
+</g> 
+<g style = "stroke: #00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #000000", 2)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+   <g>
+     <desc> Java Font, 5)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Dialog 0, 30)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+   <g>
+     <desc> J, 5)
+SAX.endElement(g)
+SAX.characters(
+   <g>
+     <desc> Java Font , 4)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Helvetic, 35)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+</g> 
+<g style = "st, 5)
+SAX.endElement(g)
+SAX.characters(
+</g> 
+<g style = "stroke: #00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #008080", 2)
+SAX.startElement(g, style='stroke: #008080')
+SAX.characters( 
+   <text x = "176" y = "85" , 5)
+SAX.startElement(text, x='176', y='85')
+SAX.characters(sadfsadfsad</text>
+</g> 
+<g st, 11)
+SAX.endElement(text)
+SAX.characters(
+</g> 
+<g style = "stroke: #00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #000000", 2)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+</g> 
+<g style = "fill: #800, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #800040" >, 2)
+SAX.startElement(g, style='fill: #800040')
+SAX.characters( 
+   <ellipse cx = "208" cy = , 5)
+SAX.startElement(ellipse, cx='208', cy='180', major='45', minor='31', angle='0')
+SAX.endElement((null))
+SAX.characters(
+</g> 
+<g style = "stroke: #00, 1)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "stroke: #000000", 2)
+SAX.startElement(g, style='stroke: #000000')
+SAX.characters( 
+</g> 
+<g style = "fill: #fff, 2)
+SAX.endElement(g)
+SAX.characters( 
+<g style = "fill: #ffffff" >, 2)
+SAX.startElement(g, style='fill: #ffffff')
+SAX.characters( 
+   <g>
+     <desc> Java Font, 5)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Dialog 7, 32)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+   <g>
+     <desc> J, 5)
+SAX.endElement(g)
+SAX.characters(
+   <g>
+     <desc> Java Font , 4)
+SAX.startElement(g)
+SAX.characters(
+     <desc> Java Font definit, 6)
+SAX.startElement(desc)
+SAX.characters( Java Font definition:Dialog 7, 32)
+SAX.endElement(desc)
+SAX.characters( 
+   </g>
+</g></svg>
+

+, 5)
+SAX.endElement(g)
+SAX.characters(
+</g></svg>
+

+, 1)
+SAX.endElement(g)
+SAX.endElement(svg)
+SAX.endDocument()
diff --git a/SAXresult/xml1 b/SAXresult/xml1
new file mode 100644
index 0000000..e509449
--- /dev/null
+++ b/SAXresult/xml1
@@ -0,0 +1,16 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(test, (null), (null))
+SAX.getEntity(amp)
+SAX.entityDecl(example, 1, (null), (null), <p>An ampersand (&#38;) may be escaped
+ numerically (&#38;#38;) or with a general entity
+  (&amp;).</p>)
+SAX.getEntity(example)
+SAX.startElement(test)
+SAX.getEntity(example)
+SAX.isStandalone()
+SAX.hasInternalSubset()
+SAX.hasExternalSubset()
+SAX.error: Entity 'example' not defined
+SAX.endElement(test)
+SAX.endDocument()
diff --git a/SAXresult/xml2 b/SAXresult/xml2
new file mode 100644
index 0000000..7d75185
--- /dev/null
+++ b/SAXresult/xml2
@@ -0,0 +1,21 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(test, (null), (null))
+SAX.elementDecl(test, 3, ...)
+SAX.entityDecl(xx, 4, (null), (null), %zz;)
+SAX.getEntity(xx)
+SAX.entityDecl(zz, 4, (null), (null), <!ENTITY tricky "error-prone" >)
+SAX.getEntity(zz)
+SAX.getEntity(xx)
+SAX.warning: xmlParsePEReference: %xx; not found
+SAX.startElement(test)
+SAX.characters(This sample shows a &tricky; m, 20)
+SAX.getEntity(tricky)
+SAX.isStandalone()
+SAX.hasInternalSubset()
+SAX.hasExternalSubset()
+SAX.error: Entity 'tricky' not defined
+SAX.characters( method.</test>
+, 8)
+SAX.endElement(test)
+SAX.endDocument()
diff --git a/configure.in b/configure.in
index f76d329..59e2d58 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@
 AC_PREREQ(2.2)
 AC_INIT(entities.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libxml, 1.0.0)
+AM_INIT_AUTOMAKE(libxml, 1.1.0)
 
 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
 
diff --git a/doc/html/gnome-xml-entities.html b/doc/html/gnome-xml-entities.html
index c398709..5f326a1 100644
--- a/doc/html/gnome-xml-entities.html
+++ b/doc/html/gnome-xml-entities.html
@@ -65,7 +65,7 @@
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN3432"
+NAME="AEN3492"
 ></A
 ><H2
 >Name</H2
@@ -73,7 +73,7 @@
 ><DIV
 CLASS="REFSYNOPSISDIV"
 ><A
-NAME="AEN3435"
+NAME="AEN3495"
 ></A
 ><H2
 >Synopsis</H2
@@ -258,21 +258,7 @@
                                              <A
 HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
 >xmlEntitiesTablePtr</A
-> table);
-<A
-HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
->xmlParserInputPtr</A
-> <A
-HREF="gnome-xml-entities.html#XMLNEWENTITYINPUTSTREAM"
->xmlNewEntityInputStream</A
->   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
-                                             <A
-HREF="gnome-xml-entities.html#XMLENTITYPTR"
->xmlEntityPtr</A
-> entity);</PRE
+> table);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -280,7 +266,7 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN3488"
+NAME="AEN3544"
 ></A
 ><H2
 >Description</H2
@@ -290,14 +276,14 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN3491"
+NAME="AEN3547"
 ></A
 ><H2
 >Details</H2
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3493"
+NAME="AEN3549"
 ></A
 ><H3
 ><A
@@ -323,7 +309,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3498"
+NAME="AEN3554"
 ></A
 ><H3
 ><A
@@ -349,7 +335,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3503"
+NAME="AEN3559"
 ></A
 ><H3
 ><A
@@ -375,7 +361,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3508"
+NAME="AEN3564"
 ></A
 ><H3
 ><A
@@ -401,7 +387,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3513"
+NAME="AEN3569"
 ></A
 ><H3
 ><A
@@ -427,7 +413,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3518"
+NAME="AEN3574"
 ></A
 ><H3
 ><A
@@ -453,7 +439,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3523"
+NAME="AEN3579"
 ></A
 ><H3
 ><A
@@ -479,7 +465,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3528"
+NAME="AEN3584"
 ></A
 ><H3
 ><A
@@ -505,7 +491,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3533"
+NAME="AEN3589"
 ></A
 ><H3
 ><A
@@ -531,7 +517,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3538"
+NAME="AEN3594"
 ></A
 ><H3
 ><A
@@ -696,7 +682,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3578"
+NAME="AEN3634"
 ></A
 ><H3
 ><A
@@ -861,7 +847,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3618"
+NAME="AEN3674"
 ></A
 ><H3
 ><A
@@ -942,7 +928,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3639"
+NAME="AEN3695"
 ></A
 ><H3
 ><A
@@ -1046,7 +1032,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3665"
+NAME="AEN3721"
 ></A
 ><H3
 ><A
@@ -1149,7 +1135,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3691"
+NAME="AEN3747"
 ></A
 ><H3
 ><A
@@ -1186,9 +1172,6 @@
 >TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
 get erroneous.</P
 ><P
->TODO This routine is not reentrant and this will be changed, the interface
-should not be modified though.</P
-><P
 ></P
 ><DIV
 CLASS="INFORMALTABLE"
@@ -1258,7 +1241,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3719"
+NAME="AEN3774"
 ></A
 ><H3
 ><A
@@ -1319,7 +1302,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3735"
+NAME="AEN3790"
 ></A
 ><H3
 ><A
@@ -1400,7 +1383,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3756"
+NAME="AEN3811"
 ></A
 ><H3
 ><A
@@ -1463,7 +1446,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3772"
+NAME="AEN3827"
 ></A
 ><H3
 ><A
@@ -1544,108 +1527,6 @@
 ></P
 ></DIV
 ></DIV
-><HR><DIV
-CLASS="REFSECT2"
-><A
-NAME="AEN3793"
-></A
-><H3
-><A
-NAME="XMLNEWENTITYINPUTSTREAM"
-></A
->xmlNewEntityInputStream()</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#E8E8F8"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
-><A
-HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
->xmlParserInputPtr</A
-> xmlNewEntityInputStream   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
-                                             <A
-HREF="gnome-xml-entities.html#XMLENTITYPTR"
->xmlEntityPtr</A
-> entity);</PRE
-></TD
-></TR
-></TABLE
-><P
->Create a new input stream based on a memory buffer.</P
-><P
-></P
-><DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="0"
-WIDTH="100%"
-BGCOLOR="#FFE0E0"
-CELLSPACING="0"
-CELLPADDING="4"
-CLASS="CALSTABLE"
-><TR
-><TD
-WIDTH="20%"
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="PARAMETER"
-><I
->ctxt</I
-></TT
->&nbsp;:</TD
-><TD
-WIDTH="80%"
-ALIGN="LEFT"
-VALIGN="TOP"
->  an XML parser context</TD
-></TR
-><TR
-><TD
-WIDTH="20%"
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="PARAMETER"
-><I
->entity</I
-></TT
->&nbsp;:</TD
-><TD
-WIDTH="80%"
-ALIGN="LEFT"
-VALIGN="TOP"
->  an Entity pointer</TD
-></TR
-><TR
-><TD
-WIDTH="20%"
-ALIGN="RIGHT"
-VALIGN="TOP"
-><I
-CLASS="EMPHASIS"
->Returns</I
-> :</TD
-><TD
-WIDTH="80%"
-ALIGN="LEFT"
-VALIGN="TOP"
->the new input stream</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></DIV
 ></DIV
 ><DIV
 CLASS="NAVFOOTER"
diff --git a/doc/html/gnome-xml-parser.html b/doc/html/gnome-xml-parser.html
index 4497c3b..9424c0e 100644
--- a/doc/html/gnome-xml-parser.html
+++ b/doc/html/gnome-xml-parser.html
@@ -137,10 +137,7 @@
 > (<A
 HREF="gnome-xml-parser.html#RESOLVEENTITYSAXFUNC"
 >*resolveEntitySAXFunc</A
->)   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)   (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -152,10 +149,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#INTERNALSUBSETSAXFUNC"
 >*internalSubsetSAXFunc</A
->)        (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)        (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -174,10 +168,7 @@
 > (<A
 HREF="gnome-xml-parser.html#GETENTITYSAXFUNC"
 >*getEntitySAXFunc</A
->)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -185,10 +176,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#ENTITYDECLSAXFUNC"
 >*entityDeclSAXFunc</A
->)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -209,10 +197,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#NOTATIONDECLSAXFUNC"
 >*notationDeclSAXFunc</A
->)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)          (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -228,10 +213,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#ATTRIBUTEDECLSAXFUNC"
 >*attributeDeclSAXFunc</A
->)         (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)         (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -253,10 +235,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#ELEMENTDECLSAXFUNC"
 >*elementDeclSAXFunc</A
->)           (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)           (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -269,10 +248,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#UNPARSEDENTITYDECLSAXFUNC"
 >*unparsedEntityDeclSAXFunc</A
->)    (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)    (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -292,10 +268,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#SETDOCUMENTLOCATORSAXFUNC"
 >*setDocumentLocatorSAXFunc</A
->)    (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)    (void *ctx,
                                              <A
 HREF="gnome-xml-parser.html#XMLSAXLOCATORPTR"
 >xmlSAXLocatorPtr</A
@@ -303,24 +276,15 @@
 void        (<A
 HREF="gnome-xml-parser.html#STARTDOCUMENTSAXFUNC"
 >*startDocumentSAXFunc</A
->)         (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);
+>)         (void *ctx);
 void        (<A
 HREF="gnome-xml-parser.html#ENDDOCUMENTSAXFUNC"
 >*endDocumentSAXFunc</A
->)           (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);
+>)           (void *ctx);
 void        (<A
 HREF="gnome-xml-parser.html#STARTELEMENTSAXFUNC"
 >*startElementSAXFunc</A
->)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)          (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -332,10 +296,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#ENDELEMENTSAXFUNC"
 >*endElementSAXFunc</A
->)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -343,10 +304,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#ATTRIBUTESAXFUNC"
 >*attributeSAXFunc</A
->)             (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)             (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -358,10 +316,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#REFERENCESAXFUNC"
 >*referenceSAXFunc</A
->)             (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)             (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -369,10 +324,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#CHARACTERSSAXFUNC"
 >*charactersSAXFunc</A
->)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -381,10 +333,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#IGNORABLEWHITESPACESAXFUNC"
 >*ignorableWhitespaceSAXFunc</A
->)   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)   (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -393,10 +342,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#PROCESSINGINSTRUCTIONSAXFUNC"
 >*processingInstructionSAXFunc</A
->) (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>) (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -408,10 +354,7 @@
 void        (<A
 HREF="gnome-xml-parser.html#COMMENTSAXFUNC"
 >*commentSAXFunc</A
->)               (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)               (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -419,51 +362,33 @@
 void        (<A
 HREF="gnome-xml-parser.html#WARNINGSAXFUNC"
 >*warningSAXFunc</A
->)               (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)               (void *ctx,
                                              const char *msg,
                                              ...);
 void        (<A
 HREF="gnome-xml-parser.html#ERRORSAXFUNC"
 >*errorSAXFunc</A
->)                 (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)                 (void *ctx,
                                              const char *msg,
                                              ...);
 void        (<A
 HREF="gnome-xml-parser.html#FATALERRORSAXFUNC"
 >*fatalErrorSAXFunc</A
->)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>)            (void *ctx,
                                              const char *msg,
                                              ...);
 int         (<A
 HREF="gnome-xml-parser.html#ISSTANDALONESAXFUNC"
 >*isStandaloneSAXFunc</A
->)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);
+>)          (void *ctx);
 int         (<A
 HREF="gnome-xml-parser.html#HASINTERNALSUBSETSAXFUNC"
 >*hasInternalSubsetSAXFunc</A
->)     (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);
+>)     (void *ctx);
 int         (<A
 HREF="gnome-xml-parser.html#HASEXTERNALSUBSETSAXFUNC"
 >*hasExternalSubsetSAXFunc</A
->)     (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);
+>)     (void *ctx);
 typedef     <A
 HREF="gnome-xml-parser.html#XMLSAXHANDLERPTR"
 >xmlSAXHandlerPtr</A
@@ -587,6 +512,10 @@
 HREF="gnome-xml-parser.html#XMLPARSEFILE"
 >xmlParseFile</A
 >                    (const char *filename);
+int         <A
+HREF="gnome-xml-parser.html#XMLSUBSTITUTEENTITIESDEFAULT"
+>xmlSubstituteEntitiesDefault</A
+>    (int val);
 <A
 HREF="gnome-xml-tree.html#XMLDOCPTR"
 >xmlDocPtr</A
@@ -659,6 +588,38 @@
 > sax,
                                              const char *filename,
                                              int recovery);
+<A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+>   <A
+HREF="gnome-xml-parser.html#XMLPARSEDTD"
+>xmlParseDTD</A
+>                     (const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *ExternalID,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *SystemID);
+<A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+>   <A
+HREF="gnome-xml-parser.html#XMLSAXPARSEDTD"
+>xmlSAXParseDTD</A
+>                  (<A
+HREF="gnome-xml-parser.html#XMLSAXHANDLERPTR"
+>xmlSAXHandlerPtr</A
+> sax,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *ExternalID,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *SystemID);
 void        <A
 HREF="gnome-xml-parser.html#XMLINITPARSERCTXT"
 >xmlInitParserCtxt</A
@@ -750,7 +711,7 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN191"
+NAME="AEN176"
 ></A
 ><H2
 >Description</H2
@@ -760,14 +721,14 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN194"
+NAME="AEN179"
 ></A
 ><H2
 >Details</H2
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN196"
+NAME="AEN181"
 ></A
 ><H3
 ><A
@@ -793,7 +754,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN201"
+NAME="AEN186"
 ></A
 ><H3
 ><A
@@ -854,7 +815,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN216"
+NAME="AEN201"
 ></A
 ><H3
 ><A
@@ -880,7 +841,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN221"
+NAME="AEN206"
 ></A
 ><H3
 ><A
@@ -906,7 +867,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN226"
+NAME="AEN211"
 ></A
 ><H3
 ><A
@@ -932,7 +893,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN231"
+NAME="AEN216"
 ></A
 ><H3
 ><A
@@ -958,7 +919,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN236"
+NAME="AEN221"
 ></A
 ><H3
 ><A
@@ -984,7 +945,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN241"
+NAME="AEN226"
 ></A
 ><H3
 ><A
@@ -1010,7 +971,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN246"
+NAME="AEN231"
 ></A
 ><H3
 ><A
@@ -1036,7 +997,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN251"
+NAME="AEN236"
 ></A
 ><H3
 ><A
@@ -1062,7 +1023,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN256"
+NAME="AEN241"
 ></A
 ><H3
 ><A
@@ -1081,10 +1042,7 @@
 ><A
 HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
 >xmlParserInputPtr</A
-> (*resolveEntitySAXFunc)   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+> (*resolveEntitySAXFunc)   (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1117,7 +1075,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1183,7 +1141,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN286"
+NAME="AEN270"
 ></A
 ><H3
 ><A
@@ -1199,10 +1157,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*internalSubsetSAXFunc)        (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*internalSubsetSAXFunc)        (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1239,7 +1194,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1307,7 +1262,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN316"
+NAME="AEN299"
 ></A
 ><H3
 ><A
@@ -1326,10 +1281,7 @@
 ><A
 HREF="gnome-xml-entities.html#XMLENTITYPTR"
 >xmlEntityPtr</A
-> (*getEntitySAXFunc)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+> (*getEntitySAXFunc)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1358,7 +1310,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1407,7 +1359,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN341"
+NAME="AEN323"
 ></A
 ><H3
 ><A
@@ -1423,10 +1375,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*entityDeclSAXFunc)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*entityDeclSAXFunc)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1468,7 +1417,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1570,7 +1519,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN380"
+NAME="AEN361"
 ></A
 ><H3
 ><A
@@ -1586,10 +1535,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*notationDeclSAXFunc)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*notationDeclSAXFunc)          (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1626,7 +1572,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1694,7 +1640,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN410"
+NAME="AEN390"
 ></A
 ><H3
 ><A
@@ -1710,10 +1656,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*attributeDeclSAXFunc)         (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*attributeDeclSAXFunc)         (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1756,7 +1699,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1875,7 +1818,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN453"
+NAME="AEN432"
 ></A
 ><H3
 ><A
@@ -1891,10 +1834,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*elementDeclSAXFunc)           (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*elementDeclSAXFunc)           (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -1928,7 +1868,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -1996,7 +1936,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN482"
+NAME="AEN460"
 ></A
 ><H3
 ><A
@@ -2012,10 +1952,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*unparsedEntityDeclSAXFunc)    (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*unparsedEntityDeclSAXFunc)    (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2056,7 +1993,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2141,7 +2078,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN517"
+NAME="AEN494"
 ></A
 ><H3
 ><A
@@ -2157,10 +2094,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*setDocumentLocatorSAXFunc)    (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*setDocumentLocatorSAXFunc)    (void *ctx,
                                              <A
 HREF="gnome-xml-parser.html#XMLSAXLOCATORPTR"
 >xmlSAXLocatorPtr</A
@@ -2189,7 +2123,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2223,7 +2157,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN537"
+NAME="AEN513"
 ></A
 ><H3
 ><A
@@ -2239,10 +2173,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*startDocumentSAXFunc)         (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);</PRE
+>void        (*startDocumentSAXFunc)         (void *ctx);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -2267,7 +2198,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2284,7 +2215,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN552"
+NAME="AEN527"
 ></A
 ><H3
 ><A
@@ -2300,10 +2231,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*endDocumentSAXFunc)           (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);</PRE
+>void        (*endDocumentSAXFunc)           (void *ctx);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -2328,7 +2256,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2345,7 +2273,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN567"
+NAME="AEN541"
 ></A
 ><H3
 ><A
@@ -2361,10 +2289,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*startElementSAXFunc)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*startElementSAXFunc)          (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2397,7 +2322,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2448,7 +2373,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN592"
+NAME="AEN565"
 ></A
 ><H3
 ><A
@@ -2464,10 +2389,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*endElementSAXFunc)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*endElementSAXFunc)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2496,7 +2418,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2530,7 +2452,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN612"
+NAME="AEN584"
 ></A
 ><H3
 ><A
@@ -2546,10 +2468,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*attributeSAXFunc)             (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*attributeSAXFunc)             (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2582,7 +2501,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2633,7 +2552,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN637"
+NAME="AEN608"
 ></A
 ><H3
 ><A
@@ -2649,10 +2568,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*referenceSAXFunc)             (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*referenceSAXFunc)             (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2681,7 +2597,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2715,7 +2631,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN657"
+NAME="AEN627"
 ></A
 ><H3
 ><A
@@ -2731,10 +2647,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*charactersSAXFunc)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*charactersSAXFunc)            (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2764,7 +2677,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2815,7 +2728,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN681"
+NAME="AEN650"
 ></A
 ><H3
 ><A
@@ -2831,10 +2744,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*ignorableWhitespaceSAXFunc)   (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*ignorableWhitespaceSAXFunc)   (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2864,7 +2774,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -2915,7 +2825,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN705"
+NAME="AEN673"
 ></A
 ><H3
 ><A
@@ -2931,10 +2841,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*processingInstructionSAXFunc) (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*processingInstructionSAXFunc) (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -2967,7 +2874,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3018,7 +2925,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN730"
+NAME="AEN697"
 ></A
 ><H3
 ><A
@@ -3034,10 +2941,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*commentSAXFunc)               (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*commentSAXFunc)               (void *ctx,
                                              const <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -3066,7 +2970,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3100,7 +3004,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN750"
+NAME="AEN716"
 ></A
 ><H3
 ><A
@@ -3116,10 +3020,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*warningSAXFunc)               (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*warningSAXFunc)               (void *ctx,
                                              const char *msg,
                                              ...);</PRE
 ></TD
@@ -3146,7 +3047,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3197,7 +3098,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN773"
+NAME="AEN738"
 ></A
 ><H3
 ><A
@@ -3213,10 +3114,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*errorSAXFunc)                 (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*errorSAXFunc)                 (void *ctx,
                                              const char *msg,
                                              ...);</PRE
 ></TD
@@ -3243,7 +3141,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3294,7 +3192,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN796"
+NAME="AEN760"
 ></A
 ><H3
 ><A
@@ -3310,10 +3208,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->void        (*fatalErrorSAXFunc)            (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt,
+>void        (*fatalErrorSAXFunc)            (void *ctx,
                                              const char *msg,
                                              ...);</PRE
 ></TD
@@ -3340,7 +3235,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3391,7 +3286,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN819"
+NAME="AEN782"
 ></A
 ><H3
 ><A
@@ -3407,10 +3302,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->int         (*isStandaloneSAXFunc)          (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);</PRE
+>int         (*isStandaloneSAXFunc)          (void *ctx);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -3435,7 +3327,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3467,7 +3359,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN838"
+NAME="AEN800"
 ></A
 ><H3
 ><A
@@ -3483,10 +3375,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->int         (*hasInternalSubsetSAXFunc)     (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);</PRE
+>int         (*hasInternalSubsetSAXFunc)     (void *ctx);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -3511,7 +3400,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3543,7 +3432,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN857"
+NAME="AEN818"
 ></A
 ><H3
 ><A
@@ -3559,10 +3448,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
->int         (*hasExternalSubsetSAXFunc)     (<A
-HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
->xmlParserCtxtPtr</A
-> ctxt);</PRE
+>int         (*hasExternalSubsetSAXFunc)     (void *ctx);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -3587,7 +3473,7 @@
 ><TT
 CLASS="PARAMETER"
 ><I
->ctxt</I
+>ctx</I
 ></TT
 >&nbsp;:</TD
 ><TD
@@ -3619,7 +3505,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN876"
+NAME="AEN836"
 ></A
 ><H3
 ><A
@@ -3645,7 +3531,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN881"
+NAME="AEN841"
 ></A
 ><H3
 ><A
@@ -3726,7 +3612,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN902"
+NAME="AEN862"
 ></A
 ><H3
 ><A
@@ -3830,7 +3716,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN928"
+NAME="AEN888"
 ></A
 ><H3
 ><A
@@ -3932,7 +3818,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN954"
+NAME="AEN914"
 ></A
 ><H3
 ><A
@@ -4031,7 +3917,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN979"
+NAME="AEN939"
 ></A
 ><H3
 ><A
@@ -4148,7 +4034,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1008"
+NAME="AEN968"
 ></A
 ><H3
 ><A
@@ -4226,7 +4112,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1028"
+NAME="AEN988"
 ></A
 ><H3
 ><A
@@ -4328,7 +4214,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1054"
+NAME="AEN1014"
 ></A
 ><H3
 ><A
@@ -4453,7 +4339,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1085"
+NAME="AEN1045"
 ></A
 ><H3
 ><A
@@ -4534,7 +4420,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1106"
+NAME="AEN1066"
 ></A
 ><H3
 ><A
@@ -4630,7 +4516,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1130"
+NAME="AEN1090"
 ></A
 ><H3
 ><A
@@ -4709,7 +4595,90 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1150"
+NAME="AEN1110"
+></A
+><H3
+><A
+NAME="XMLSUBSTITUTEENTITIESDEFAULT"
+></A
+>xmlSubstituteEntitiesDefault()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int         xmlSubstituteEntitiesDefault    (int val);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Set and return the previous value for default entity support.
+Initially the parser always keep entity references instead of substituting
+entity values in the output. This function has to be used to change the
+default parser behaviour
+SAX::<GTKDOCLINK
+HREF="SUBTITUTEENTITIES"
+>subtituteEntities</GTKDOCLINK
+>() has to be used for changing that on a file by
+file basis.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>val</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  int 0 or 1 </TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>the last value for 0 for no substitution, 1 for substitution.</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN1130"
 ></A
 ><H3
 ><A
@@ -4791,7 +4760,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1171"
+NAME="AEN1151"
 ></A
 ><H3
 ><A
@@ -4888,7 +4857,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1195"
+NAME="AEN1175"
 ></A
 ><H3
 ><A
@@ -4968,7 +4937,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1215"
+NAME="AEN1195"
 ></A
 ><H3
 ><A
@@ -5052,7 +5021,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1237"
+NAME="AEN1217"
 ></A
 ><H3
 ><A
@@ -5175,7 +5144,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1267"
+NAME="AEN1247"
 ></A
 ><H3
 ><A
@@ -5209,8 +5178,6 @@
 to handle the parsing callback. If sax is NULL, fallback to the default
 DOM tree building routines.</P
 ><P
->TODO : plug some encoding conversion routines here. !!!</P
-><P
 ></P
 ><DIV
 CLASS="INFORMALTABLE"
@@ -5315,7 +5282,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1301"
+NAME="AEN1280"
 ></A
 ><H3
 ><A
@@ -5436,7 +5403,232 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1330"
+NAME="AEN1309"
+></A
+><H3
+><A
+NAME="XMLPARSEDTD"
+></A
+>xmlParseDTD()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+>   xmlParseDTD                     (const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *ExternalID,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *SystemID);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Load and parse an external subset.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ExternalID</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  a NAME* containing the External ID of the DTD</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>SystemID</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  a NAME* containing the URL to the DTD</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>the resulting xmlDtdPtr or NULL in case of error.</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN1335"
+></A
+><H3
+><A
+NAME="XMLSAXPARSEDTD"
+></A
+>xmlSAXParseDTD()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+>   xmlSAXParseDTD                  (<A
+HREF="gnome-xml-parser.html#XMLSAXHANDLERPTR"
+>xmlSAXHandlerPtr</A
+> sax,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *ExternalID,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *SystemID);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Load and parse an external subset.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>sax</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the SAX handler block</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ExternalID</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  a NAME* containing the External ID of the DTD</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>SystemID</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  a NAME* containing the URL to the DTD</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>the resulting xmlDtdPtr or NULL in case of error.</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN1366"
 ></A
 ><H3
 ><A
@@ -5499,7 +5691,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1346"
+NAME="AEN1382"
 ></A
 ><H3
 ><A
@@ -5562,7 +5754,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1362"
+NAME="AEN1398"
 ></A
 ><H3
 ><A
@@ -5666,7 +5858,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1387"
+NAME="AEN1423"
 ></A
 ><H3
 ><A
@@ -5769,7 +5961,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1413"
+NAME="AEN1449"
 ></A
 ><H3
 ><A
@@ -5832,7 +6024,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1429"
+NAME="AEN1465"
 ></A
 ><H3
 ><A
@@ -5896,7 +6088,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1445"
+NAME="AEN1481"
 ></A
 ><H3
 ><A
@@ -5999,7 +6191,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1471"
+NAME="AEN1507"
 ></A
 ><H3
 ><A
@@ -6083,7 +6275,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1492"
+NAME="AEN1528"
 ></A
 ><H3
 ><A
diff --git a/doc/html/gnome-xml-parserinternals.html b/doc/html/gnome-xml-parserinternals.html
index 75e342e..7612d3b 100644
--- a/doc/html/gnome-xml-parserinternals.html
+++ b/doc/html/gnome-xml-parserinternals.html
@@ -59,7 +59,7 @@
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN4419"
+NAME="AEN4441"
 ></A
 ><H2
 >Name</H2
@@ -67,7 +67,7 @@
 ><DIV
 CLASS="REFSYNOPSISDIV"
 ><A
-NAME="AEN4422"
+NAME="AEN4444"
 ></A
 ><H2
 >Synopsis</H2
@@ -177,7 +177,7 @@
 HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
 >xmlParserInputPtr</A
 > <A
-HREF="gnome-xml-entities.html#XMLNEWENTITYINPUTSTREAM"
+HREF="gnome-xml-parserinternals.html#XMLNEWENTITYINPUTSTREAM"
 >xmlNewEntityInputStream</A
 >   (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
@@ -216,6 +216,17 @@
 >xmlParserInputPtr</A
 > input);
 <A
+HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
+>xmlParserInputPtr</A
+> <A
+HREF="gnome-xml-parserinternals.html#XMLNEWINPUTFROMFILE"
+>xmlNewInputFromFile</A
+>       (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+                                             const char *filename);
+<A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
 >*       <A
@@ -309,7 +320,11 @@
 >             (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
-> ctxt);
+> ctxt,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> **orig);
 <A
 HREF="gnome-xml-tree.html#CHAR"
 >CHAR</A
@@ -513,10 +528,7 @@
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);
-<A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       <A
+int         <A
 HREF="gnome-xml-parserinternals.html#XMLPARSECHARREF"
 >xmlParseCharRef</A
 >                 (<A
@@ -524,29 +536,23 @@
 >xmlParserCtxtPtr</A
 > ctxt);
 <A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       <A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> <A
 HREF="gnome-xml-parserinternals.html#XMLPARSEENTITYREF"
 >xmlParseEntityRef</A
->               (<A
+>              (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);
-<A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       <A
+void        <A
 HREF="gnome-xml-parserinternals.html#XMLPARSEREFERENCE"
 >xmlParseReference</A
 >               (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);
-<A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       <A
+void        <A
 HREF="gnome-xml-parserinternals.html#XMLPARSEPEREFERENCE"
 >xmlParsePEReference</A
 >             (<A
@@ -669,7 +675,47 @@
 >                    (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
-> ctxt);</PRE
+> ctxt);
+#define     <A
+HREF="gnome-xml-parserinternals.html#XML-SUBSTITUTE-NONE"
+>XML_SUBSTITUTE_NONE</A
+>
+#define     <A
+HREF="gnome-xml-parserinternals.html#XML-SUBSTITUTE-REF"
+>XML_SUBSTITUTE_REF</A
+>
+#define     <A
+HREF="gnome-xml-parserinternals.html#XML-SUBSTITUTE-PEREF"
+>XML_SUBSTITUTE_PEREF</A
+>
+#define     <A
+HREF="gnome-xml-parserinternals.html#XML-SUBSTITUTE-BOTH"
+>XML_SUBSTITUTE_BOTH</A
+>
+<A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+>*       <A
+HREF="gnome-xml-parserinternals.html#XMLDECODEENTITIES"
+>xmlDecodeEntities</A
+>               (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+                                             int len,
+                                             int what,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end2,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end3);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -677,7 +723,7 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN4592"
+NAME="AEN4625"
 ></A
 ><H2
 >Description</H2
@@ -687,14 +733,14 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN4595"
+NAME="AEN4628"
 ></A
 ><H2
 >Details</H2
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4597"
+NAME="AEN4630"
 ></A
 ><H3
 ><A
@@ -752,7 +798,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4611"
+NAME="AEN4644"
 ></A
 ><H3
 ><A
@@ -810,7 +856,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4625"
+NAME="AEN4658"
 ></A
 ><H3
 ><A
@@ -868,7 +914,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4639"
+NAME="AEN4672"
 ></A
 ><H3
 ><A
@@ -926,7 +972,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4653"
+NAME="AEN4686"
 ></A
 ><H3
 ><A
@@ -984,7 +1030,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4667"
+NAME="AEN4700"
 ></A
 ><H3
 ><A
@@ -1042,7 +1088,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4681"
+NAME="AEN4714"
 ></A
 ><H3
 ><A
@@ -1104,7 +1150,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4695"
+NAME="AEN4728"
 ></A
 ><H3
 ><A
@@ -1162,7 +1208,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4709"
+NAME="AEN4742"
 ></A
 ><H3
 ><A
@@ -1229,7 +1275,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4723"
+NAME="AEN4756"
 ></A
 ><H3
 ><A
@@ -1289,7 +1335,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4737"
+NAME="AEN4770"
 ></A
 ><H3
 ><A
@@ -1348,7 +1394,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4751"
+NAME="AEN4784"
 ></A
 ><H3
 ><A
@@ -1407,7 +1453,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4765"
+NAME="AEN4798"
 ></A
 ><H3
 ><A
@@ -1486,7 +1532,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4785"
+NAME="AEN4818"
 ></A
 ><H3
 ><A
@@ -1566,7 +1612,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4805"
+NAME="AEN4838"
 ></A
 ><H3
 ><A
@@ -1662,7 +1708,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4829"
+NAME="AEN4862"
 ></A
 ><H3
 ><A
@@ -1726,7 +1772,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4845"
+NAME="AEN4878"
 ></A
 ><H3
 ><A
@@ -1812,7 +1858,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4866"
+NAME="AEN4899"
 ></A
 ><H3
 ><A
@@ -1843,7 +1889,7 @@
 ></TR
 ></TABLE
 ><P
->Create a new input stream based on a memory buffer.</P
+>Create a new input stream based on an xmlEntityPtr</P
 ><P
 ></P
 ><DIV
@@ -1872,7 +1918,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>  an XML parser context</TD
 ></TR
 ><TR
 ><TD
@@ -1889,7 +1935,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>  an Entity pointer</TD
 ></TR
 ><TR
 ><TD
@@ -1904,7 +1950,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>the new input stream</TD
 ></TR
 ></TABLE
 ><P
@@ -1914,7 +1960,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4892"
+NAME="AEN4925"
 ></A
 ><H3
 ><A
@@ -1999,7 +2045,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4913"
+NAME="AEN4946"
 ></A
 ><H3
 ><A
@@ -2083,7 +2129,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4935"
+NAME="AEN4968"
 ></A
 ><H3
 ><A
@@ -2146,7 +2192,106 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4951"
+NAME="AEN4984"
+></A
+><H3
+><A
+NAME="XMLNEWINPUTFROMFILE"
+></A
+>xmlNewInputFromFile()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-parser.html#XMLPARSERINPUTPTR"
+>xmlParserInputPtr</A
+> xmlNewInputFromFile       (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+                                             const char *filename);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Create a new input stream based on a file.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctxt</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  an XML parser context</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>filename</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the filename to use as entity</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>the new input stream or NULL in case of error</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5009"
 ></A
 ><H3
 ><A
@@ -2255,7 +2400,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4980"
+NAME="AEN5038"
 ></A
 ><H3
 ><A
@@ -2341,7 +2486,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5003"
+NAME="AEN5061"
 ></A
 ><H3
 ><A
@@ -2450,7 +2595,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5032"
+NAME="AEN5090"
 ></A
 ><H3
 ><A
@@ -2535,7 +2680,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5055"
+NAME="AEN5113"
 ></A
 ><H3
 ><A
@@ -2616,7 +2761,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5076"
+NAME="AEN5134"
 ></A
 ><H3
 ><A
@@ -2683,7 +2828,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5093"
+NAME="AEN5151"
 ></A
 ><H3
 ><A
@@ -2771,7 +2916,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5117"
+NAME="AEN5175"
 ></A
 ><H3
 ><A
@@ -2856,7 +3001,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5140"
+NAME="AEN5198"
 ></A
 ><H3
 ><A
@@ -2878,7 +3023,11 @@
 >*       xmlParseEntityValue             (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
-> ctxt);</PRE
+> ctxt,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> **orig);</PRE
 ></TD
 ></TR
 ></TABLE
@@ -2922,6 +3071,23 @@
 WIDTH="20%"
 ALIGN="RIGHT"
 VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>orig</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  if non-NULL store a copy of the original entity value</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
 ><I
 CLASS="EMPHASIS"
 >Returns</I
@@ -2930,7 +3096,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->the EntityValue parsed or NULL</TD
+>the EntityValue parsed with reference substitued or NULL</TD
 ></TR
 ></TABLE
 ><P
@@ -2940,7 +3106,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5162"
+NAME="AEN5225"
 ></A
 ><H3
 ><A
@@ -2967,7 +3133,10 @@
 ></TR
 ></TABLE
 ><P
->parse a value for an attribute</P
+>parse a value for an attribute
+Note: the parser won't do substitution of entities here, this
+will be handled later in xmlStringGetNodeList, unless it was
+asked for ctxt-&gt;replaceEntities != 0 </P
 ><P
 >[10] AttValue ::= '"' ([^&lt;&amp;"] | Reference)* '"' |
 "'" ([^&lt;&amp;'] | Reference)* "'"</P
@@ -3024,7 +3193,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5184"
+NAME="AEN5247"
 ></A
 ><H3
 ><A
@@ -3107,7 +3276,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5206"
+NAME="AEN5269"
 ></A
 ><H3
 ><A
@@ -3190,7 +3359,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5228"
+NAME="AEN5291"
 ></A
 ><H3
 ><A
@@ -3274,7 +3443,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5249"
+NAME="AEN5312"
 ></A
 ><H3
 ><A
@@ -3405,7 +3574,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5282"
+NAME="AEN5345"
 ></A
 ><H3
 ><A
@@ -3491,7 +3660,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5303"
+NAME="AEN5366"
 ></A
 ><H3
 ><A
@@ -3574,7 +3743,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5325"
+NAME="AEN5388"
 ></A
 ><H3
 ><A
@@ -3641,7 +3810,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5343"
+NAME="AEN5406"
 ></A
 ><H3
 ><A
@@ -3716,7 +3885,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5363"
+NAME="AEN5426"
 ></A
 ><H3
 ><A
@@ -3791,7 +3960,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5385"
+NAME="AEN5448"
 ></A
 ><H3
 ><A
@@ -3902,7 +4071,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5414"
+NAME="AEN5477"
 ></A
 ><H3
 ><A
@@ -3987,7 +4156,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5437"
+NAME="AEN5500"
 ></A
 ><H3
 ><A
@@ -4070,7 +4239,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5459"
+NAME="AEN5522"
 ></A
 ><H3
 ><A
@@ -4173,7 +4342,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5486"
+NAME="AEN5549"
 ></A
 ><H3
 ><A
@@ -4279,7 +4448,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5514"
+NAME="AEN5577"
 ></A
 ><H3
 ><A
@@ -4346,7 +4515,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5532"
+NAME="AEN5595"
 ></A
 ><H3
 ><A
@@ -4438,7 +4607,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5556"
+NAME="AEN5619"
 ></A
 ><H3
 ><A
@@ -4530,7 +4699,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5581"
+NAME="AEN5644"
 ></A
 ><H3
 ><A
@@ -4653,7 +4822,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5612"
+NAME="AEN5675"
 ></A
 ><H3
 ><A
@@ -4735,7 +4904,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5634"
+NAME="AEN5697"
 ></A
 ><H3
 ><A
@@ -4803,7 +4972,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5652"
+NAME="AEN5715"
 ></A
 ><H3
 ><A
@@ -4819,10 +4988,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
-><A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       xmlParseCharRef                 (<A
+>int         xmlParseCharRef                 (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);</PRE
@@ -4880,7 +5046,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->the value parsed</TD
+>the value parsed (as an int)</TD
 ></TR
 ></TABLE
 ><P
@@ -4890,7 +5056,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5675"
+NAME="AEN5737"
 ></A
 ><H3
 ><A
@@ -4907,9 +5073,9 @@
 ><PRE
 CLASS="PROGRAMLISTING"
 ><A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       xmlParseEntityRef               (<A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> xmlParseEntityRef              (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);</PRE
@@ -4963,7 +5129,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->the entity ref string or NULL if directly as input stream.</TD
+>the xmlEntityPtr if found, or NULL otherwise.</TD
 ></TR
 ></TABLE
 ><P
@@ -4973,7 +5139,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5697"
+NAME="AEN5759"
 ></A
 ><H3
 ><A
@@ -4989,10 +5155,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
-><A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       xmlParseReference               (<A
+>void        xmlParseReference               (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);</PRE
@@ -5000,7 +5163,16 @@
 ></TR
 ></TABLE
 ><P
->parse Reference declarations</P
+>parse and handle entity references in content, depending on the SAX
+interface, this may end-up in a call to <GTKDOCLINK
+HREF="CHARACTER"
+>character</GTKDOCLINK
+>() if this is a
+CharRef, a predefined entity, if there is no <GTKDOCLINK
+HREF="REFERENCE"
+>reference</GTKDOCLINK
+>() callback.
+or if the parser was asked to switch to that mode.</P
 ><P
 >[67] Reference ::= EntityRef | CharRef</P
 ><P
@@ -5033,22 +5205,6 @@
 VALIGN="TOP"
 >  an XML parser context</TD
 ></TR
-><TR
-><TD
-WIDTH="20%"
-ALIGN="RIGHT"
-VALIGN="TOP"
-><I
-CLASS="EMPHASIS"
->Returns</I
-> :</TD
-><TD
-WIDTH="80%"
-ALIGN="LEFT"
-VALIGN="TOP"
->the entity string or NULL if handled directly by pushing
-the entity value as the input.</TD
-></TR
 ></TABLE
 ><P
 ></P
@@ -5057,7 +5213,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5719"
+NAME="AEN5778"
 ></A
 ><H3
 ><A
@@ -5073,10 +5229,7 @@
 ><TD
 ><PRE
 CLASS="PROGRAMLISTING"
-><A
-HREF="gnome-xml-tree.html#CHAR"
->CHAR</A
->*       xmlParsePEReference             (<A
+>void        xmlParsePEReference             (<A
 HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
 >xmlParserCtxtPtr</A
 > ctxt);</PRE
@@ -5084,7 +5237,9 @@
 ></TR
 ></TABLE
 ><P
->parse PEReference declarations</P
+>parse PEReference declarations
+The entity content is handled directly by pushing it's content as
+a new input stream.</P
 ><P
 >[69] PEReference ::= '%' Name ';'</P
 ><P
@@ -5117,21 +5272,6 @@
 VALIGN="TOP"
 >  an XML parser context</TD
 ></TR
-><TR
-><TD
-WIDTH="20%"
-ALIGN="RIGHT"
-VALIGN="TOP"
-><I
-CLASS="EMPHASIS"
->Returns</I
-> :</TD
-><TD
-WIDTH="80%"
-ALIGN="LEFT"
-VALIGN="TOP"
->the entity content or NULL if handled directly.</TD
-></TR
 ></TABLE
 ><P
 ></P
@@ -5140,7 +5280,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5741"
+NAME="AEN5795"
 ></A
 ><H3
 ><A
@@ -5206,7 +5346,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5758"
+NAME="AEN5812"
 ></A
 ><H3
 ><A
@@ -5319,7 +5459,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5789"
+NAME="AEN5843"
 ></A
 ><H3
 ><A
@@ -5393,7 +5533,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5810"
+NAME="AEN5864"
 ></A
 ><H3
 ><A
@@ -5462,7 +5602,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5829"
+NAME="AEN5883"
 ></A
 ><H3
 ><A
@@ -5533,7 +5673,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5849"
+NAME="AEN5903"
 ></A
 ><H3
 ><A
@@ -5598,7 +5738,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5866"
+NAME="AEN5920"
 ></A
 ><H3
 ><A
@@ -5665,7 +5805,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5884"
+NAME="AEN5938"
 ></A
 ><H3
 ><A
@@ -5748,7 +5888,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5906"
+NAME="AEN5960"
 ></A
 ><H3
 ><A
@@ -5833,7 +5973,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5929"
+NAME="AEN5983"
 ></A
 ><H3
 ><A
@@ -5916,7 +6056,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5951"
+NAME="AEN6005"
 ></A
 ><H3
 ><A
@@ -6001,7 +6141,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5974"
+NAME="AEN6028"
 ></A
 ><H3
 ><A
@@ -6082,7 +6222,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN5995"
+NAME="AEN6049"
 ></A
 ><H3
 ><A
@@ -6147,7 +6287,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN6012"
+NAME="AEN6066"
 ></A
 ><H3
 ><A
@@ -6209,6 +6349,293 @@
 ></P
 ></DIV
 ></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6083"
+></A
+><H3
+><A
+NAME="XML-SUBSTITUTE-NONE"
+></A
+>XML_SUBSTITUTE_NONE</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define XML_SUBSTITUTE_NONE	0</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6088"
+></A
+><H3
+><A
+NAME="XML-SUBSTITUTE-REF"
+></A
+>XML_SUBSTITUTE_REF</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define XML_SUBSTITUTE_REF	1</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6093"
+></A
+><H3
+><A
+NAME="XML-SUBSTITUTE-PEREF"
+></A
+>XML_SUBSTITUTE_PEREF</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define XML_SUBSTITUTE_PEREF	2</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6098"
+></A
+><H3
+><A
+NAME="XML-SUBSTITUTE-BOTH"
+></A
+>XML_SUBSTITUTE_BOTH</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define XML_SUBSTITUTE_BOTH 	3</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6103"
+></A
+><H3
+><A
+NAME="XMLDECODEENTITIES"
+></A
+>xmlDecodeEntities()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+>*       xmlDecodeEntities               (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+                                             int len,
+                                             int what,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end2,
+                                             <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> end3);</PRE
+></TD
+></TR
+></TABLE
+><P
+>[67] Reference ::= EntityRef | CharRef</P
+><P
+>[69] PEReference ::= '%' Name ';'</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctxt</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the parser context</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>len</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the len to decode (in bytes !), -1 for no size limit</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>what</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>end</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  an end marker CHAR, 0 if none</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>end2</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  an end marker CHAR, 0 if none</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>end3</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  an end marker CHAR, 0 if none</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>A newly allocated string with the substitution done. The caller
+must deallocate it !</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
 ></DIV
 ><DIV
 CLASS="NAVFOOTER"
diff --git a/doc/html/gnome-xml-tree.html b/doc/html/gnome-xml-tree.html
index 72121bc..eedec7f 100644
--- a/doc/html/gnome-xml-tree.html
+++ b/doc/html/gnome-xml-tree.html
@@ -65,7 +65,7 @@
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN1503"
+NAME="AEN1539"
 ></A
 ><H2
 >Name</H2
@@ -73,7 +73,7 @@
 ><DIV
 CLASS="REFSYNOPSISDIV"
 ><A
-NAME="AEN1506"
+NAME="AEN1542"
 ></A
 ><H2
 >Synopsis</H2
@@ -898,6 +898,17 @@
 > buf,
                                              const char *string);
 void        <A
+HREF="gnome-xml-tree.html#XMLBUFFERWRITEQUOTEDSTRING"
+>xmlBufferWriteQuotedString</A
+>      (<A
+HREF="gnome-xml-tree.html#XMLBUFFERPTR"
+>xmlBufferPtr</A
+> buf,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *string);
+void        <A
 HREF="gnome-xml-tree.html#XMLDOCDUMPMEMORY"
 >xmlDocDumpMemory</A
 >                (<A
@@ -958,7 +969,7 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN1746"
+NAME="AEN1785"
 ></A
 ><H2
 >Description</H2
@@ -968,14 +979,14 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN1749"
+NAME="AEN1788"
 ></A
 ><H2
 >Details</H2
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1751"
+NAME="AEN1790"
 ></A
 ><H3
 ><A
@@ -1014,7 +1025,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1756"
+NAME="AEN1795"
 ></A
 ><H3
 ><A
@@ -1027,7 +1038,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1760"
+NAME="AEN1799"
 ></A
 ><H3
 ><A
@@ -1053,7 +1064,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1765"
+NAME="AEN1804"
 ></A
 ><H3
 ><A
@@ -1090,7 +1101,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1770"
+NAME="AEN1809"
 ></A
 ><H3
 ><A
@@ -1121,7 +1132,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1775"
+NAME="AEN1814"
 ></A
 ><H3
 ><A
@@ -1147,7 +1158,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1780"
+NAME="AEN1819"
 ></A
 ><H3
 ><A
@@ -1173,7 +1184,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1785"
+NAME="AEN1824"
 ></A
 ><H3
 ><A
@@ -1204,7 +1215,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1790"
+NAME="AEN1829"
 ></A
 ><H3
 ><A
@@ -1235,7 +1246,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1795"
+NAME="AEN1834"
 ></A
 ><H3
 ><A
@@ -1261,7 +1272,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1800"
+NAME="AEN1839"
 ></A
 ><H3
 ><A
@@ -1292,7 +1303,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1805"
+NAME="AEN1844"
 ></A
 ><H3
 ><A
@@ -1318,7 +1329,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1810"
+NAME="AEN1849"
 ></A
 ><H3
 ><A
@@ -1347,7 +1358,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1815"
+NAME="AEN1854"
 ></A
 ><H3
 ><A
@@ -1373,7 +1384,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1820"
+NAME="AEN1859"
 ></A
 ><H3
 ><A
@@ -1399,7 +1410,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1825"
+NAME="AEN1864"
 ></A
 ><H3
 ><A
@@ -1425,7 +1436,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1830"
+NAME="AEN1869"
 ></A
 ><H3
 ><A
@@ -1451,7 +1462,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1835"
+NAME="AEN1874"
 ></A
 ><H3
 ><A
@@ -1477,7 +1488,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1840"
+NAME="AEN1879"
 ></A
 ><H3
 ><A
@@ -1503,7 +1514,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1845"
+NAME="AEN1884"
 ></A
 ><H3
 ><A
@@ -1529,7 +1540,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1850"
+NAME="AEN1889"
 ></A
 ><H3
 ><A
@@ -1555,7 +1566,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1855"
+NAME="AEN1894"
 ></A
 ><H3
 ><A
@@ -1581,7 +1592,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1860"
+NAME="AEN1899"
 ></A
 ><H3
 ><A
@@ -1642,7 +1653,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1876"
+NAME="AEN1915"
 ></A
 ><H3
 ><A
@@ -1705,7 +1716,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1892"
+NAME="AEN1931"
 ></A
 ><H3
 ><A
@@ -1804,7 +1815,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1917"
+NAME="AEN1956"
 ></A
 ><H3
 ><A
@@ -1906,7 +1917,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1942"
+NAME="AEN1981"
 ></A
 ><H3
 ><A
@@ -1990,7 +2001,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1963"
+NAME="AEN2002"
 ></A
 ><H3
 ><A
@@ -2071,7 +2082,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN1983"
+NAME="AEN2022"
 ></A
 ><H3
 ><A
@@ -2215,7 +2226,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2019"
+NAME="AEN2058"
 ></A
 ><H3
 ><A
@@ -2359,7 +2370,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2055"
+NAME="AEN2094"
 ></A
 ><H3
 ><A
@@ -2422,7 +2433,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2071"
+NAME="AEN2110"
 ></A
 ><H3
 ><A
@@ -2545,7 +2556,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2102"
+NAME="AEN2141"
 ></A
 ><H3
 ><A
@@ -2668,7 +2679,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2133"
+NAME="AEN2172"
 ></A
 ><H3
 ><A
@@ -2731,7 +2742,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2149"
+NAME="AEN2188"
 ></A
 ><H3
 ><A
@@ -2812,7 +2823,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2170"
+NAME="AEN2209"
 ></A
 ><H3
 ><A
@@ -2876,7 +2887,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2186"
+NAME="AEN2225"
 ></A
 ><H3
 ><A
@@ -2999,7 +3010,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2217"
+NAME="AEN2256"
 ></A
 ><H3
 ><A
@@ -3122,7 +3133,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2248"
+NAME="AEN2287"
 ></A
 ><H3
 ><A
@@ -3185,7 +3196,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2264"
+NAME="AEN2303"
 ></A
 ><H3
 ><A
@@ -3248,7 +3259,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2280"
+NAME="AEN2319"
 ></A
 ><H3
 ><A
@@ -3329,7 +3340,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2301"
+NAME="AEN2340"
 ></A
 ><H3
 ><A
@@ -3410,7 +3421,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2322"
+NAME="AEN2361"
 ></A
 ><H3
 ><A
@@ -3491,7 +3502,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2343"
+NAME="AEN2382"
 ></A
 ><H3
 ><A
@@ -3591,7 +3602,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2368"
+NAME="AEN2407"
 ></A
 ><H3
 ><A
@@ -3746,7 +3757,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2406"
+NAME="AEN2445"
 ></A
 ><H3
 ><A
@@ -3860,7 +3871,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2434"
+NAME="AEN2473"
 ></A
 ><H3
 ><A
@@ -4021,7 +4032,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2473"
+NAME="AEN2512"
 ></A
 ><H3
 ><A
@@ -4123,7 +4134,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2499"
+NAME="AEN2538"
 ></A
 ><H3
 ><A
@@ -4204,7 +4215,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2520"
+NAME="AEN2559"
 ></A
 ><H3
 ><A
@@ -4325,7 +4336,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2550"
+NAME="AEN2589"
 ></A
 ><H3
 ><A
@@ -4424,7 +4435,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2575"
+NAME="AEN2614"
 ></A
 ><H3
 ><A
@@ -4526,7 +4537,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2601"
+NAME="AEN2640"
 ></A
 ><H3
 ><A
@@ -4607,7 +4618,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2622"
+NAME="AEN2661"
 ></A
 ><H3
 ><A
@@ -4709,7 +4720,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2648"
+NAME="AEN2687"
 ></A
 ><H3
 ><A
@@ -4808,7 +4819,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2673"
+NAME="AEN2712"
 ></A
 ><H3
 ><A
@@ -4889,7 +4900,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2694"
+NAME="AEN2733"
 ></A
 ><H3
 ><A
@@ -4970,7 +4981,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2715"
+NAME="AEN2754"
 ></A
 ><H3
 ><A
@@ -5048,7 +5059,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2735"
+NAME="AEN2774"
 ></A
 ><H3
 ><A
@@ -5155,7 +5166,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2762"
+NAME="AEN2801"
 ></A
 ><H3
 ><A
@@ -5218,7 +5229,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2778"
+NAME="AEN2817"
 ></A
 ><H3
 ><A
@@ -5320,7 +5331,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2804"
+NAME="AEN2843"
 ></A
 ><H3
 ><A
@@ -5427,7 +5438,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2830"
+NAME="AEN2869"
 ></A
 ><H3
 ><A
@@ -5491,7 +5502,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2846"
+NAME="AEN2885"
 ></A
 ><H3
 ><A
@@ -5554,7 +5565,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2862"
+NAME="AEN2901"
 ></A
 ><H3
 ><A
@@ -5685,7 +5696,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2894"
+NAME="AEN2933"
 ></A
 ><H3
 ><A
@@ -5809,7 +5820,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2925"
+NAME="AEN2964"
 ></A
 ><H3
 ><A
@@ -5893,7 +5904,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2946"
+NAME="AEN2985"
 ></A
 ><H3
 ><A
@@ -5974,7 +5985,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2967"
+NAME="AEN3006"
 ></A
 ><H3
 ><A
@@ -6055,7 +6066,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN2988"
+NAME="AEN3027"
 ></A
 ><H3
 ><A
@@ -6178,7 +6189,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3019"
+NAME="AEN3058"
 ></A
 ><H3
 ><A
@@ -6281,7 +6292,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3045"
+NAME="AEN3084"
 ></A
 ><H3
 ><A
@@ -6384,7 +6395,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3071"
+NAME="AEN3110"
 ></A
 ><H3
 ><A
@@ -6505,7 +6516,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3101"
+NAME="AEN3140"
 ></A
 ><H3
 ><A
@@ -6626,7 +6637,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3131"
+NAME="AEN3170"
 ></A
 ><H3
 ><A
@@ -6710,7 +6721,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3152"
+NAME="AEN3191"
 ></A
 ><H3
 ><A
@@ -6817,7 +6828,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3178"
+NAME="AEN3217"
 ></A
 ><H3
 ><A
@@ -6901,7 +6912,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3199"
+NAME="AEN3238"
 ></A
 ><H3
 ><A
@@ -7008,7 +7019,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3225"
+NAME="AEN3264"
 ></A
 ><H3
 ><A
@@ -7093,7 +7104,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3246"
+NAME="AEN3285"
 ></A
 ><H3
 ><A
@@ -7178,7 +7189,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3267"
+NAME="AEN3306"
 ></A
 ><H3
 ><A
@@ -7233,7 +7244,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->  the XML buffer</TD
+>  the XML buffer output</TD
 ></TR
 ><TR
 ><TD
@@ -7260,7 +7271,93 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3287"
+NAME="AEN3326"
+></A
+><H3
+><A
+NAME="XMLBUFFERWRITEQUOTEDSTRING"
+></A
+>xmlBufferWriteQuotedString()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#E8E8F8"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>void        xmlBufferWriteQuotedString      (<A
+HREF="gnome-xml-tree.html#XMLBUFFERPTR"
+>xmlBufferPtr</A
+> buf,
+                                             const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *string);</PRE
+></TD
+></TR
+></TABLE
+><P
+>routine which manage and grows an output buffer. This one writes
+a quoted or double quoted CHAR string, checking first if it holds
+quote or double-quotes internally</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFE0E0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>buf</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the XML buffer output</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>string</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>  the string to add</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN3347"
 ></A
 ><H3
 ><A
@@ -7363,7 +7460,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3312"
+NAME="AEN3372"
 ></A
 ><H3
 ><A
@@ -7447,7 +7544,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3333"
+NAME="AEN3393"
 ></A
 ><H3
 ><A
@@ -7544,7 +7641,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3357"
+NAME="AEN3417"
 ></A
 ><H3
 ><A
@@ -7622,7 +7719,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3377"
+NAME="AEN3437"
 ></A
 ><H3
 ><A
@@ -7704,7 +7801,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3397"
+NAME="AEN3457"
 ></A
 ><H3
 ><A
@@ -7762,7 +7859,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3412"
+NAME="AEN3472"
 ></A
 ><H3
 ><A
diff --git a/doc/html/gnome-xml-valid.html b/doc/html/gnome-xml-valid.html
index 6c47337..7b7cc67 100644
--- a/doc/html/gnome-xml-valid.html
+++ b/doc/html/gnome-xml-valid.html
@@ -65,7 +65,7 @@
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN3824"
+NAME="AEN3853"
 ></A
 ><H2
 >Name</H2
@@ -73,7 +73,7 @@
 ><DIV
 CLASS="REFSYNOPSISDIV"
 ><A
-NAME="AEN3827"
+NAME="AEN3856"
 ></A
 ><H2
 >Synopsis</H2
@@ -327,7 +327,7 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN3894"
+NAME="AEN3923"
 ></A
 ><H2
 >Description</H2
@@ -337,14 +337,14 @@
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN3897"
+NAME="AEN3926"
 ></A
 ><H2
 >Details</H2
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3899"
+NAME="AEN3928"
 ></A
 ><H3
 ><A
@@ -370,7 +370,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3904"
+NAME="AEN3933"
 ></A
 ><H3
 ><A
@@ -396,7 +396,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3909"
+NAME="AEN3938"
 ></A
 ><H3
 ><A
@@ -422,7 +422,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3914"
+NAME="AEN3943"
 ></A
 ><H3
 ><A
@@ -448,7 +448,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3919"
+NAME="AEN3948"
 ></A
 ><H3
 ><A
@@ -474,7 +474,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3924"
+NAME="AEN3953"
 ></A
 ><H3
 ><A
@@ -500,7 +500,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3929"
+NAME="AEN3958"
 ></A
 ><H3
 ><A
@@ -644,7 +644,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3965"
+NAME="AEN3994"
 ></A
 ><H3
 ><A
@@ -725,7 +725,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN3986"
+NAME="AEN4015"
 ></A
 ><H3
 ><A
@@ -788,7 +788,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4002"
+NAME="AEN4031"
 ></A
 ><H3
 ><A
@@ -818,9 +818,6 @@
 ><P
 >This will dump the content of the notation table as an XML DTD definition</P
 ><P
->NOTE: TODO an extra parameter allowing a reentant implementation will
-be added.</P
-><P
 ></P
 ><DIV
 CLASS="INFORMALTABLE"
@@ -848,7 +845,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>  the XML buffer output</TD
 ></TR
 ><TR
 ><TD
@@ -875,7 +872,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4024"
+NAME="AEN4052"
 ></A
 ><H3
 ><A
@@ -974,7 +971,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4049"
+NAME="AEN4077"
 ></A
 ><H3
 ><A
@@ -1055,7 +1052,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4070"
+NAME="AEN4098"
 ></A
 ><H3
 ><A
@@ -1118,7 +1115,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4086"
+NAME="AEN4114"
 ></A
 ><H3
 ><A
@@ -1259,7 +1256,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4121"
+NAME="AEN4149"
 ></A
 ><H3
 ><A
@@ -1340,7 +1337,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4142"
+NAME="AEN4170"
 ></A
 ><H3
 ><A
@@ -1403,7 +1400,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4158"
+NAME="AEN4186"
 ></A
 ><H3
 ><A
@@ -1433,9 +1430,6 @@
 ><P
 >This will dump the content of the element table as an XML DTD definition</P
 ><P
->NOTE: TODO an extra parameter allowing a reentant implementation will
-be added.</P
-><P
 ></P
 ><DIV
 CLASS="INFORMALTABLE"
@@ -1463,7 +1457,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>  the XML buffer output</TD
 ></TR
 ><TR
 ><TD
@@ -1490,7 +1484,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4180"
+NAME="AEN4207"
 ></A
 ><H3
 ><A
@@ -1572,7 +1566,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4201"
+NAME="AEN4228"
 ></A
 ><H3
 ><A
@@ -1635,7 +1629,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4217"
+NAME="AEN4244"
 ></A
 ><H3
 ><A
@@ -1717,7 +1711,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4238"
+NAME="AEN4265"
 ></A
 ><H3
 ><A
@@ -1918,7 +1912,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4287"
+NAME="AEN4314"
 ></A
 ><H3
 ><A
@@ -1999,7 +1993,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4308"
+NAME="AEN4335"
 ></A
 ><H3
 ><A
@@ -2062,7 +2056,7 @@
 ><HR><DIV
 CLASS="REFSECT2"
 ><A
-NAME="AEN4324"
+NAME="AEN4351"
 ></A
 ><H3
 ><A
@@ -2092,9 +2086,6 @@
 ><P
 >This will dump the content of the attribute table as an XML DTD definition</P
 ><P
->NOTE: TODO an extra parameter allowing a reentant implementation will
-be added.</P
-><P
 ></P
 ><DIV
 CLASS="INFORMALTABLE"
@@ -2122,7 +2113,7 @@
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->&nbsp;</TD
+>  the XML buffer output</TD
 ></TR
 ><TR
 ><TD
diff --git a/doc/html/index.sgml b/doc/html/index.sgml
index ed627da..0d09d3a 100644
--- a/doc/html/index.sgml
+++ b/doc/html/index.sgml
@@ -46,6 +46,7 @@
 <ANCHOR id ="XMLPARSEDOC" href="gnome-xml/gnome-xml-parser.html#XMLPARSEDOC">
 <ANCHOR id ="XMLPARSEMEMORY" href="gnome-xml/gnome-xml-parser.html#XMLPARSEMEMORY">
 <ANCHOR id ="XMLPARSEFILE" href="gnome-xml/gnome-xml-parser.html#XMLPARSEFILE">
+<ANCHOR id ="XMLSUBSTITUTEENTITIESDEFAULT" href="gnome-xml/gnome-xml-parser.html#XMLSUBSTITUTEENTITIESDEFAULT">
 <ANCHOR id ="XMLRECOVERDOC" href="gnome-xml/gnome-xml-parser.html#XMLRECOVERDOC">
 <ANCHOR id ="XMLRECOVERMEMORY" href="gnome-xml/gnome-xml-parser.html#XMLRECOVERMEMORY">
 <ANCHOR id ="XMLRECOVERFILE" href="gnome-xml/gnome-xml-parser.html#XMLRECOVERFILE">
@@ -53,6 +54,8 @@
 <ANCHOR id ="XMLSAXPARSEDOC" href="gnome-xml/gnome-xml-parser.html#XMLSAXPARSEDOC">
 <ANCHOR id ="XMLSAXPARSEMEMORY" href="gnome-xml/gnome-xml-parser.html#XMLSAXPARSEMEMORY">
 <ANCHOR id ="XMLSAXPARSEFILE" href="gnome-xml/gnome-xml-parser.html#XMLSAXPARSEFILE">
+<ANCHOR id ="XMLPARSEDTD" href="gnome-xml/gnome-xml-parser.html#XMLPARSEDTD">
+<ANCHOR id ="XMLSAXPARSEDTD" href="gnome-xml/gnome-xml-parser.html#XMLSAXPARSEDTD">
 <ANCHOR id ="XMLINITPARSERCTXT" href="gnome-xml/gnome-xml-parser.html#XMLINITPARSERCTXT">
 <ANCHOR id ="XMLCLEARPARSERCTXT" href="gnome-xml/gnome-xml-parser.html#XMLCLEARPARSERCTXT">
 <ANCHOR id ="XMLSETUPPARSERFORBUFFER" href="gnome-xml/gnome-xml-parser.html#XMLSETUPPARSERFORBUFFER">
@@ -144,6 +147,7 @@
 <ANCHOR id ="XMLNODEGETCONTENT" href="gnome-xml/gnome-xml-tree.html#XMLNODEGETCONTENT">
 <ANCHOR id ="XMLBUFFERWRITECHAR" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERWRITECHAR">
 <ANCHOR id ="XMLBUFFERWRITECHAR" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERWRITECHAR">
+<ANCHOR id ="XMLBUFFERWRITEQUOTEDSTRING" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERWRITEQUOTEDSTRING">
 <ANCHOR id ="XMLDOCDUMPMEMORY" href="gnome-xml/gnome-xml-tree.html#XMLDOCDUMPMEMORY">
 <ANCHOR id ="XMLDOCDUMP" href="gnome-xml/gnome-xml-tree.html#XMLDOCDUMP">
 <ANCHOR id ="XMLSAVEFILE" href="gnome-xml/gnome-xml-tree.html#XMLSAVEFILE">
@@ -171,7 +175,6 @@
 <ANCHOR id ="XMLCOPYENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLCOPYENTITIESTABLE">
 <ANCHOR id ="XMLFREEENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLFREEENTITIESTABLE">
 <ANCHOR id ="XMLDUMPENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLDUMPENTITIESTABLE">
-<ANCHOR id ="XMLNEWENTITYINPUTSTREAM" href="gnome-xml/gnome-xml-entities.html#XMLNEWENTITYINPUTSTREAM">
 <ANCHOR id ="GNOME-XML-VALID" href="gnome-xml/gnome-xml-valid.html">
 <ANCHOR id ="XML-MIN-NOTATION-TABLE" href="gnome-xml/gnome-xml-valid.html#XML-MIN-NOTATION-TABLE">
 <ANCHOR id ="XMLNOTATIONTABLEPTR" href="gnome-xml/gnome-xml-valid.html#XMLNOTATIONTABLEPTR">
@@ -222,6 +225,7 @@
 <ANCHOR id ="XMLPUSHINPUT" href="gnome-xml/gnome-xml-parserinternals.html#XMLPUSHINPUT">
 <ANCHOR id ="XMLPOPINPUT" href="gnome-xml/gnome-xml-parserinternals.html#XMLPOPINPUT">
 <ANCHOR id ="XMLFREEINPUTSTREAM" href="gnome-xml/gnome-xml-parserinternals.html#XMLFREEINPUTSTREAM">
+<ANCHOR id ="XMLNEWINPUTFROMFILE" href="gnome-xml/gnome-xml-parserinternals.html#XMLNEWINPUTFROMFILE">
 <ANCHOR id ="XMLSPLITQNAME" href="gnome-xml/gnome-xml-parserinternals.html#XMLSPLITQNAME">
 <ANCHOR id ="XMLNAMESPACEPARSENCNAME" href="gnome-xml/gnome-xml-parserinternals.html#XMLNAMESPACEPARSENCNAME">
 <ANCHOR id ="XMLNAMESPACEPARSEQNAME" href="gnome-xml/gnome-xml-parserinternals.html#XMLNAMESPACEPARSEQNAME">
@@ -270,3 +274,8 @@
 <ANCHOR id ="XMLPARSESDDECL" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSESDDECL">
 <ANCHOR id ="XMLPARSEXMLDECL" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSEXMLDECL">
 <ANCHOR id ="XMLPARSEMISC" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSEMISC">
+<ANCHOR id ="XML-SUBSTITUTE-NONE" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-NONE">
+<ANCHOR id ="XML-SUBSTITUTE-REF" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-REF">
+<ANCHOR id ="XML-SUBSTITUTE-PEREF" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-PEREF">
+<ANCHOR id ="XML-SUBSTITUTE-BOTH" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-BOTH">
+<ANCHOR id ="XMLDECODEENTITIES" href="gnome-xml/gnome-xml-parserinternals.html#XMLDECODEENTITIES">
diff --git a/encoding.c b/encoding.c
index a7e984e..a9a5fa7 100644
--- a/encoding.c
+++ b/encoding.c
@@ -216,7 +216,7 @@
  * Returns one of the XML_CHAR_ENCODING_... values.
  */
 xmlCharEncoding
-xmlDetectCharEncoding(unsigned char* in)
+xmlDetectCharEncoding(const unsigned char* in)
 {
     if ((in[0] == 0x00) && (in[1] == 0x00) &&
         (in[2] == 0x00) && (in[3] == 0x3C))
@@ -255,7 +255,7 @@
  * if not recognized.
  */
 xmlCharEncoding
-xmlParseCharEncoding(char* name)
+xmlParseCharEncoding(const char* name)
 {
     char upper[500];
     int i;
diff --git a/encoding.h b/encoding.h
index 217edbc..3c5cee0 100644
--- a/encoding.h
+++ b/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/entities.c b/entities.c
index 88f2661..c61f81d 100644
--- a/entities.c
+++ b/entities.c
@@ -30,23 +30,18 @@
 xmlEntitiesTablePtr xmlPredefinedEntities = NULL;
 
 /*
- * A buffer used for converting entities to their equivalent and back.
- *
- * TODO: remove this, this helps performances but forbid reentrancy in a 
- *       stupid way.
+ * Macro used to grow the current buffer.
  */
-static int buffer_size = 0;
-static CHAR *buffer = NULL;
-
-void growBuffer(void) {
-    buffer_size *= 2;
-    buffer = (CHAR *) realloc(buffer, buffer_size * sizeof(CHAR));
-    if (buffer == NULL) {
-	perror("realloc failed");
-	exit(1);
-    }
+#define growBuffer() {							\
+    buffer_size *= 2;							\
+    buffer = (CHAR *) realloc(buffer, buffer_size * sizeof(CHAR));	\
+    if (buffer == NULL) {						\
+	perror("realloc failed");					\
+	exit(1);							\
+    }									\
 }
 
+
 /*
  * xmlFreeEntity : clean-up an entity record.
  */
@@ -61,6 +56,8 @@
         free((char *) entity->SystemID);
     if (entity->content != NULL)
         free((char *) entity->content);
+    if (entity->orig != NULL)
+        free((char *) entity->orig);
     memset(entity, -1, sizeof(xmlEntity));
 }
 
@@ -116,6 +113,7 @@
 	cur->content = xmlStrdup(content);
     else
         cur->content = NULL;
+    cur->orig = NULL;
     table->nb_entities++;
 }
 
@@ -314,26 +312,28 @@
  * TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
  *           get erroneous.
  *
- * TODO This routine is not reentrant and this will be changed, the interface
- *      should not be modified though.
- * 
  * Returns A newly allocated string with the substitution done.
  */
 CHAR *
 xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
     const CHAR *cur = input;
-    CHAR *out = buffer;
+    CHAR *buffer = NULL;
+    CHAR *out = NULL;
+    int buffer_size = 0;
 
     if (input == NULL) return(NULL);
+
+    /*
+     * allocate an translation buffer.
+     */
+    buffer_size = 1000;
+    buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));
     if (buffer == NULL) {
-        buffer_size = 1000;
-        buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));
-	if (buffer == NULL) {
-	    perror("malloc failed");
-            exit(1);
-	}
-	out = buffer;
+	perror("malloc failed");
+	exit(1);
     }
+    out = buffer;
+
     while (*cur != '\0') {
         if (out - buffer > buffer_size - 100) {
 	    int index = out - buffer;
@@ -517,6 +517,10 @@
 	    cur->content = xmlStrdup(ent->content);
 	else
 	    cur->content = NULL;
+	if (ent->orig != NULL)
+	    cur->orig = xmlStrdup(ent->orig);
+	else
+	    cur->orig = NULL;
     }
     return(ret);
 }
@@ -541,23 +545,24 @@
 	    case XML_INTERNAL_GENERAL_ENTITY:
 	        xmlBufferWriteChar(buf, "<!ENTITY ");
 		xmlBufferWriteCHAR(buf, cur->name);
-		xmlBufferWriteChar(buf, " \"");
-		xmlBufferWriteCHAR(buf, cur->content);
-		xmlBufferWriteChar(buf, "\">\n");
+		xmlBufferWriteChar(buf, " ");
+		if (cur->orig != NULL)
+		    xmlBufferWriteQuotedString(buf, cur->orig);
+		else
+		    xmlBufferWriteQuotedString(buf, cur->content);
+		xmlBufferWriteChar(buf, ">\n");
 	        break;
 	    case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
 	        xmlBufferWriteChar(buf, "<!ENTITY ");
 		xmlBufferWriteCHAR(buf, cur->name);
 		if (cur->ExternalID != NULL) {
-		     xmlBufferWriteChar(buf, " PUBLIC \"");
-		     xmlBufferWriteCHAR(buf, cur->ExternalID);
-		     xmlBufferWriteChar(buf, "\" \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " PUBLIC ");
+		     xmlBufferWriteQuotedString(buf, cur->ExternalID);
+		     xmlBufferWriteChar(buf, " ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		} else {
-		     xmlBufferWriteChar(buf, " SYSTEM \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " SYSTEM ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		}
 		xmlBufferWriteChar(buf, ">\n");
 	        break;
@@ -565,42 +570,44 @@
 	        xmlBufferWriteChar(buf, "<!ENTITY ");
 		xmlBufferWriteCHAR(buf, cur->name);
 		if (cur->ExternalID != NULL) {
-		     xmlBufferWriteChar(buf, " PUBLIC \"");
-		     xmlBufferWriteCHAR(buf, cur->ExternalID);
-		     xmlBufferWriteChar(buf, "\" \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " PUBLIC ");
+		     xmlBufferWriteQuotedString(buf, cur->ExternalID);
+		     xmlBufferWriteChar(buf, " ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		} else {
-		     xmlBufferWriteChar(buf, " SYSTEM \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " SYSTEM ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		}
 		if (cur->content != NULL) { /* Should be true ! */
 		    xmlBufferWriteChar(buf, " NDATA ");
-		    xmlBufferWriteCHAR(buf, cur->content);
+		    if (cur->orig != NULL)
+			xmlBufferWriteCHAR(buf, cur->orig);
+		    else
+			xmlBufferWriteCHAR(buf, cur->content);
 		}
 		xmlBufferWriteChar(buf, ">\n");
 	        break;
 	    case XML_INTERNAL_PARAMETER_ENTITY:
 	        xmlBufferWriteChar(buf, "<!ENTITY % ");
 		xmlBufferWriteCHAR(buf, cur->name);
-		xmlBufferWriteChar(buf, " \"");
-		xmlBufferWriteCHAR(buf, cur->content);
-		xmlBufferWriteChar(buf, "\">\n");
+		xmlBufferWriteChar(buf, " ");
+		if (cur->orig == NULL)
+		    xmlBufferWriteQuotedString(buf, cur->content);
+		else
+		    xmlBufferWriteQuotedString(buf, cur->orig);
+		xmlBufferWriteChar(buf, ">\n");
 	        break;
 	    case XML_EXTERNAL_PARAMETER_ENTITY:
 	        xmlBufferWriteChar(buf, "<!ENTITY % ");
 		xmlBufferWriteCHAR(buf, cur->name);
 		if (cur->ExternalID != NULL) {
-		     xmlBufferWriteChar(buf, " PUBLIC \"");
-		     xmlBufferWriteCHAR(buf, cur->ExternalID);
-		     xmlBufferWriteChar(buf, "\" \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " PUBLIC ");
+		     xmlBufferWriteQuotedString(buf, cur->ExternalID);
+		     xmlBufferWriteChar(buf, " ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		} else {
-		     xmlBufferWriteChar(buf, " SYSTEM \"");
-		     xmlBufferWriteCHAR(buf, cur->SystemID);
-		     xmlBufferWriteChar(buf, "\"");
+		     xmlBufferWriteChar(buf, " SYSTEM ");
+		     xmlBufferWriteQuotedString(buf, cur->SystemID);
 		}
 		xmlBufferWriteChar(buf, ">\n");
 	        break;
diff --git a/entities.h b/entities.h
index 5d6506d..b653542 100644
--- a/entities.h
+++ b/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/error.c b/error.c
index a9f0a0b..6d1f57d 100644
--- a/error.c
+++ b/error.c
@@ -12,7 +12,7 @@
 
 /**
  * xmlParserError:
- * @ctxt:  an XML parser context
+ * @ctx:  an XML parser context
  * @msg:  the message to display/transmit
  * @...:  extra parameters for the message display
  * 
@@ -66,7 +66,7 @@
 
 /**
  * xmlParserWarning:
- * @ctxt:  an XML parser context
+ * @ctx:  an XML parser context
  * @msg:  the message to display/transmit
  * @...:  extra parameters for the message display
  * 
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
diff --git a/libxml.spec.in b/libxml.spec.in
index 7b888a4..919969f 100644
--- a/libxml.spec.in
+++ b/libxml.spec.in
@@ -30,6 +30,11 @@
 
 %changelog
 
+* Wed Jun  2 1999 Daniel Veillard <Daniel.Veillard@w3.org>
+
+- Switched to version 1.1: SAX extensions, better entities support, lots of
+  bug fixes.
+
 * Sun Oct  4 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
 - Added xml-config to the package
diff --git a/parser.c b/parser.c
index d934f82..8161ecd 100644
--- a/parser.c
+++ b/parser.c
@@ -39,6 +39,9 @@
  * 		Parser stacks related functions and macros		*
  *									*
  ************************************************************************/
+
+int xmlSubstituteEntitiesDefaultValue = 0;
+
 /*
  * Generic function for accessing stacks in the Parser Context
  */
@@ -91,13 +94,14 @@
  *   SKIP(n) Skip n CHAR, and must also be used only to skip ASCII defined
  *           strings within the parser.
  *
- * Clean macros, not dependent of an ASCII context.
+ * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding
  *
  *   CURRENT Returns the current char value, with the full decoding of
  *           UTF-8 if we are using this mode. It returns an int.
  *   NEXT    Skip to the next character, this does the proper decoding
  *           in UTF-8 mode. It also pop-up unfinished entities on the fly.
  *           It returns the pointer to the current CHAR.
+ *   COPY(to) copy one char to *to, increment CUR_PTR and to accordingly
  */
 
 #define CUR (*ctxt->input->cur)
@@ -173,7 +177,7 @@
  * @ctxt:  an XML parser context
  * @entity:  an Entity pointer
  *
- * Create a new input stream based on a memory buffer.
+ * Create a new input stream based on an xmlEntityPtr
  * Returns the new input stream
  */
 xmlParserInputPtr
@@ -210,16 +214,16 @@
 /**
  * xmlNewStringInputStream:
  * @ctxt:  an XML parser context
- * @entity:  an Entity pointer
+ * @entity:  an Entity memory buffer
  *
  * Create a new input stream based on a memory buffer.
  * Returns the new input stream
  */
 xmlParserInputPtr
-xmlNewStringInputStream(xmlParserCtxtPtr ctxt, CHAR *string) {
+xmlNewStringInputStream(xmlParserCtxtPtr ctxt, CHAR *entity) {
     xmlParserInputPtr input;
 
-    if (string == NULL) {
+    if (entity == NULL) {
         if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 	    ctxt->sax->error(ctxt->userData,
 	      "internal: xmlNewStringInputStream string = NULL\n");
@@ -232,14 +236,236 @@
 	return(NULL);
     }
     input->filename = NULL;
-    input->base = string;
-    input->cur = string;
+    input->base = entity;
+    input->cur = entity;
     input->line = 1;
     input->col = 1;
     input->free = NULL;
     return(input);
 }
 
+/**
+ * xmlNewInputFromFile:
+ * @ctxt:  an XML parser context
+ * @filename:  the filename to use as entity
+ *
+ * Create a new input stream based on a file.
+ *
+ * Returns the new input stream or NULL in case of error
+ */
+xmlParserInputPtr
+xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
+#ifdef HAVE_ZLIB_H
+    gzFile input;
+#else
+    int input;
+#endif
+    int res;
+    int len;
+    struct stat buf;
+    char *buffer;
+    xmlParserInputPtr inputStream;
+    /* xmlCharEncoding enc; */
+
+    res = stat(filename, &buf);
+    if (res < 0) return(NULL);
+
+#ifdef HAVE_ZLIB_H
+    len = (buf.st_size * 8) + 1000;
+retry_bigger:
+    buffer = malloc(len);
+#else
+    len = buf.st_size + 100;
+    buffer = malloc(len);
+#endif
+    if (buffer == NULL) {
+	perror("malloc");
+        return(NULL);
+    }
+
+    memset(buffer, 0, len);
+#ifdef HAVE_ZLIB_H
+    input = gzopen (filename, "r");
+    if (input == NULL) {
+        fprintf (stderr, "Cannot read file %s :\n", filename);
+	perror ("gzopen failed");
+	return(NULL);
+    }
+#else
+#ifdef WIN32
+    input = _open (filename, O_RDONLY | _O_BINARY);
+#else
+    input = open (filename, O_RDONLY);
+#endif
+    if (input < 0) {
+        fprintf (stderr, "Cannot read file %s :\n", filename);
+	perror ("open failed");
+	return(NULL);
+    }
+#endif
+#ifdef HAVE_ZLIB_H
+    res = gzread(input, buffer, len);
+#else
+    res = read(input, buffer, buf.st_size);
+#endif
+    if (res < 0) {
+        fprintf (stderr, "Cannot read file %s :\n", filename);
+#ifdef HAVE_ZLIB_H
+	perror ("gzread failed");
+#else
+	perror ("read failed");
+#endif
+	return(NULL);
+    }
+#ifdef HAVE_ZLIB_H
+    gzclose(input);
+    if (res >= len) {
+        free(buffer);
+	len *= 2;
+	goto retry_bigger;
+    }
+    buf.st_size = res;
+#else
+    close(input);
+#endif
+
+    buffer[buf.st_size] = '\0';
+
+    inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+    if (inputStream == NULL) {
+        perror("malloc");
+	free(ctxt);
+	return(NULL);
+    }
+
+    inputStream->filename = strdup(filename);
+    inputStream->line = 1;
+    inputStream->col = 1;
+
+    /*
+     * plug some encoding conversion routines here. !!!
+    enc = xmlDetectCharEncoding(buffer);
+    xmlSwitchEncoding(ctxt, enc);
+     */
+
+    inputStream->base = buffer;
+    inputStream->cur = buffer;
+    inputStream->free = (xmlParserInputDeallocate) free;
+
+    return(inputStream);
+}
+
+/************************************************************************
+ *									*
+ *		Commodity functions to handle entities			*
+ *									*
+ ************************************************************************/
+
+/*
+ * Macro used to grow the current buffer.
+ */
+#define growBuffer(buffer) {						\
+    buffer##_size *= 2;							\
+    buffer = (CHAR *) realloc(buffer, buffer##_size * sizeof(CHAR));	\
+    if (buffer == NULL) {						\
+	perror("realloc failed");					\
+	exit(1);							\
+    }									\
+}
+
+
+/**
+ * xmlDecodeEntities:
+ * @ctxt:  the parser context
+ * @what:  combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
+ * @len:  the len to decode (in bytes !), -1 for no size limit
+ * @end:  an end marker CHAR, 0 if none
+ * @end2:  an end marker CHAR, 0 if none
+ * @end3:  an end marker CHAR, 0 if none
+ * 
+ * [67] Reference ::= EntityRef | CharRef
+ *
+ * [69] PEReference ::= '%' Name ';'
+ *
+ * Returns A newly allocated string with the substitution done. The caller
+ *      must deallocate it !
+ */
+CHAR *
+xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
+                  CHAR end, CHAR  end2, CHAR end3) {
+    CHAR *buffer = NULL;
+    int buffer_size = 0;
+    CHAR *out = NULL;
+
+    CHAR *cur = NULL;
+    xmlEntityPtr ent;
+    const CHAR *start = CUR_PTR;
+    unsigned int max = (unsigned int) len;
+
+    /*
+     * allocate a translation buffer.
+     */
+    buffer_size = 1000;
+    buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));
+    if (buffer == NULL) {
+	perror("xmlDecodeEntities: malloc failed");
+	return(NULL);
+    }
+    out = buffer;
+
+    /*
+     * Ok loop until we reach one of the ending char or a size limit.
+     */
+    while ((CUR_PTR - start < max) && (CUR != end) &&
+           (CUR != end2) && (CUR != end3)) {
+
+        if (CUR == '&' && (what & XML_SUBSTITUTE_REF)) {
+	    if (NXT(1) == '#') {
+		int val = xmlParseCharRef(ctxt);
+		/* TODO: invalid for UTF-8 variable encoding !!! */
+		*out++ = val;
+	    } else {
+		ent = xmlParseEntityRef(ctxt);
+		if (ent != NULL) {
+		    cur = ent->content;
+		    while (*cur != 0) {
+		        *out++ = *cur++;
+			if (out - buffer > buffer_size - 100) {
+			    int index = out - buffer;
+
+			    growBuffer(buffer);
+			    out = &buffer[index];
+			}
+		    }
+		}
+	    }
+	} else if (CUR == '%' && (what & XML_SUBSTITUTE_PEREF)) {
+	    /*
+	     * a PEReference induce to switch the entity flow,
+	     * we break here to flush the current set of chars
+	     * parsed if any. We will be called back later.
+	     */
+	    if (CUR_PTR != start) break;
+
+	    xmlParsePEReference(ctxt);
+
+	    /*
+	     * Pop-up of finished entities.
+	     */
+	    while ((CUR == 0) && (ctxt->inputNr > 1))
+		xmlPopInput(ctxt);
+
+            break;
+	} else {
+	    /*  TODO: invalid for UTF-8 , use COPY(out); */
+	    *out++ = CUR;
+	    NEXT;
+	}
+    }
+    *out++ = 0;
+    return(buffer);
+}
+
 
 /************************************************************************
  *									*
@@ -683,8 +909,8 @@
 /*
  * Forward definition for recusive behaviour.
  */
-CHAR *xmlParsePEReference(xmlParserCtxtPtr ctxt);
-CHAR *xmlParseReference(xmlParserCtxtPtr ctxt);
+void xmlParsePEReference(xmlParserCtxtPtr ctxt);
+void xmlParseReference(xmlParserCtxtPtr ctxt);
 
 /************************************************************************
  *									*
@@ -1066,92 +1292,64 @@
 /**
  * xmlParseEntityValue:
  * @ctxt:  an XML parser context
+ * @orig:  if non-NULL store a copy of the original entity value
  *
  * parse a value for ENTITY decl.
  *
  * [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' |
  *	               "'" ([^%&'] | PEReference | Reference)* "'"
  *
- * Returns the EntityValue parsed or NULL
+ * Returns the EntityValue parsed with reference substitued or NULL
  */
 
 CHAR *
-xmlParseEntityValue(xmlParserCtxtPtr ctxt) {
-    CHAR *ret = NULL, *cur;
-    const CHAR *q;
+xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
+    CHAR *ret = NULL;
+    const CHAR *org = NULL;
+    const CHAR *tst = NULL;
+    const CHAR *temp = NULL;
 
     if (CUR == '"') {
         NEXT;
-
-	q = CUR_PTR;
-	while ((IS_CHAR(CUR)) && (CUR != '"')) {
-	    if (CUR == '%') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParsePEReference(ctxt);
-		ret = xmlStrcat(ret, cur);
-		q = CUR_PTR;
-	    } else if (CUR == '&') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParseReference(ctxt);
-		if (cur != NULL) {
-		    CHAR buf[2];
-		    buf[0] = '&';
-		    buf[1] = 0;
-		    ret = xmlStrncat(ret, buf, 1);
-		    ret = xmlStrcat(ret, cur);
-		    buf[0] = ';';
-		    buf[1] = 0;
-		    ret = xmlStrncat(ret, buf, 1);
-		}
-		q = CUR_PTR;
-	    } else 
-	        NEXT;
+	org = CUR_PTR;
+	while (CUR != '"') {
+	    tst = CUR_PTR;
+	    temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_BOTH, '"', 0, 0);
+	    if ((temp == NULL) && (tst == CUR_PTR)) break;
+	    ret = xmlStrcat(ret, temp);
+	    if (temp != NULL) free((char *)temp);
 	}
-	if (!IS_CHAR(CUR)) {
+        if (CUR != '"') {
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-	        ctxt->sax->error(ctxt->userData, "Unfinished EntityValue\n");
+		ctxt->sax->error(ctxt->userData, "EntityValue: \" expected\n");
 	    ctxt->wellFormed = 0;
 	} else {
-	    ret = xmlStrncat(ret, q, CUR_PTR - q);
+	    if (orig != NULL)
+	        *orig = xmlStrndup(org, CUR_PTR - org);
 	    NEXT;
-        }
+	}
     } else if (CUR == '\'') {
         NEXT;
-	q = CUR_PTR;
-	while ((IS_CHAR(CUR)) && (CUR != '\'')) {
-	    if (CUR == '%') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParsePEReference(ctxt);
-		ret = xmlStrcat(ret, cur);
-		q = CUR_PTR;
-	    } else if (CUR == '&') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParseReference(ctxt);
-		if (cur != NULL) {
-		    CHAR buf[2];
-		    buf[0] = '&';
-		    buf[1] = 0;
-		    ret = xmlStrncat(ret, buf, 1);
-		    ret = xmlStrcat(ret, cur);
-		    buf[0] = ';';
-		    buf[1] = 0;
-		    ret = xmlStrncat(ret, buf, 1);
-		}
-		q = CUR_PTR;
-	    } else 
-	        NEXT;
+	org = CUR_PTR;
+	while (CUR != '\'') {
+	    tst = CUR_PTR;
+	    temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_BOTH, '\'', 0, 0);
+	    if ((temp == NULL) && (tst == CUR_PTR)) break;
+	    ret = xmlStrcat(ret, temp);
+	    if (temp != NULL) free((char *)temp);
 	}
-	if (!IS_CHAR(CUR)) {
+        if (CUR != '\'') {
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-	        ctxt->sax->error(ctxt->userData, "Unfinished EntityValue\n");
+		ctxt->sax->error(ctxt->userData, "EntityValue: ' expected\n");
 	    ctxt->wellFormed = 0;
 	} else {
-	    ret = xmlStrncat(ret, q, CUR_PTR - q);
+	    if (orig != NULL)
+	        *orig = xmlStrndup(org, CUR_PTR - org);
 	    NEXT;
-        }
+	}
     } else {
 	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-	    ctxt->sax->error(ctxt->userData, "xmlParseEntityValue \" or ' expected\n");
+	    ctxt->sax->error(ctxt->userData, "EntityValue: \" or ' expected\n");
 	ctxt->wellFormed = 0;
     }
     
@@ -1163,6 +1361,9 @@
  * @ctxt:  an XML parser context
  *
  * parse a value for an attribute
+ * Note: the parser won't do substitution of entities here, this
+ * will be handled later in xmlStringGetNodeList, unless it was
+ * asked for ctxt->replaceEntities != 0 
  *
  * [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |
  *                   "'" ([^<&'] | Reference)* "'"
@@ -1172,104 +1373,44 @@
 
 CHAR *
 xmlParseAttValue(xmlParserCtxtPtr ctxt) {
-    CHAR *ret = NULL, *cur;
-    const CHAR *q;
+    CHAR *ret = NULL;
 
     if (CUR == '"') {
         NEXT;
-
-	q = CUR_PTR;
-	while ((IS_CHAR(CUR)) && (CUR != '"')) {
-	    if (CUR == '<') {
-		if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-		    ctxt->sax->error(ctxt->userData,
-		       "Unescaped '<' not allowed in attributes values\n");
-		ctxt->wellFormed = 0;
-	    }
-	    if (CUR == '&') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParseReference(ctxt);
-		if (cur != NULL) {
-		    /*
-		     * Special case for '&amp;', we don't want to
-		     * resolve it here since it will break later
-		     * when searching entities in the string.
-		     */
-		    if ((cur[0] == '&') && (cur[1] == 0)) {
-		        CHAR buf[6] = { '&', 'a', 'm', 'p', ';', 0 };
-		        ret = xmlStrncat(ret, buf, 5);
-		    } else
-		        ret = xmlStrcat(ret, cur);
-		    free(cur);
-		}
-		q = CUR_PTR;
-	    } else 
-	        NEXT;
-	    /*
-	     * Pop out finished entity references.
-	     */
-	    while ((CUR == 0) && (ctxt->inputNr > 1)) {
-		if (CUR_PTR != q)
-		    ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        xmlPopInput(ctxt);
-		q = CUR_PTR;
-	    }
-	}
-	if (!IS_CHAR(CUR)) {
+	if (ctxt->replaceEntities != 0)
+	    ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '"', '<', 0);
+	else
+	    ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_NONE, '"', '<', 0);
+	if (CUR == '<') {
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-	        ctxt->sax->error(ctxt->userData, "Unfinished AttValue\n");
+		ctxt->sax->error(ctxt->userData,
+		   "Unescaped '<' not allowed in attributes values\n");
 	    ctxt->wellFormed = 0;
-	} else {
-	    ret = xmlStrncat(ret, q, CUR_PTR - q);
+	}
+        if (CUR != '"') {
+	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+		ctxt->sax->error(ctxt->userData, "AttValue: ' expected\n");
+	    ctxt->wellFormed = 0;
+	} else
 	    NEXT;
-        }
     } else if (CUR == '\'') {
         NEXT;
-	q = CUR_PTR;
-	while ((IS_CHAR(CUR)) && (CUR != '\'')) {
-	    if (CUR == '<') {
-		if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-		    ctxt->sax->error(ctxt->userData,
-		       "Unescaped '<' not allowed in attributes values\n");
-		ctxt->wellFormed = 0;
-	    }
-	    if (CUR == '&') {
-	        ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        cur = xmlParseReference(ctxt);
-		if (cur != NULL) {
-		    /*
-		     * Special case for '&amp;', we don't want to
-		     * resolve it here since it will break later
-		     * when searching entities in the string.
-		     */
-		    if ((cur[0] == '&') && (cur[1] == 0)) {
-		        CHAR buf[6] = { '&', 'a', 'm', 'p', ';', 0 };
-		        ret = xmlStrncat(ret, buf, 5);
-		    } else
-		        ret = xmlStrcat(ret, cur);
-		    free(cur);
-		}
-		q = CUR_PTR;
-	    } else 
-	        NEXT;
-	    /*
-	     * Pop out finished entity references.
-	     */
-	    while ((CUR == 0) && (ctxt->inputNr > 1)) {
-		if (CUR_PTR != q)
-		    ret = xmlStrncat(ret, q, CUR_PTR - q);
-	        xmlPopInput(ctxt);
-		q = CUR_PTR;
-	    }
-	}
-	if (!IS_CHAR(CUR)) {
+	if (ctxt->replaceEntities != 0)
+	    ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '\'', '<', 0);
+	else
+	    ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_NONE, '\'', '<', 0);
+	if (CUR == '<') {
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
-	        ctxt->sax->error(ctxt->userData, "Unfinished AttValue\n");
+		ctxt->sax->error(ctxt->userData,
+		   "Unescaped '<' not allowed in attributes values\n");
 	    ctxt->wellFormed = 0;
-	} else {
-	    ret = xmlStrncat(ret, q, CUR_PTR - q);
+	}
+        if (CUR != '\'') {
+	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+		ctxt->sax->error(ctxt->userData, "AttValue: ' expected\n");
+	    ctxt->wellFormed = 0;
+	} else
 	    NEXT;
-        }
     } else {
 	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 	    ctxt->sax->error(ctxt->userData, "AttValue: \" or ' expected\n");
@@ -1779,6 +1920,7 @@
     CHAR *URI = NULL, *literal = NULL;
     CHAR *ndata = NULL;
     int isParameter = 0;
+    CHAR *orig = NULL;
     
     if ((CUR == '<') && (NXT(1) == '!') &&
         (NXT(2) == 'E') && (NXT(3) == 'N') &&
@@ -1823,7 +1965,7 @@
 	 */
 	if (isParameter) {
 	    if ((CUR == '"') || (CUR == '\''))
-	        value = xmlParseEntityValue(ctxt);
+	        value = xmlParseEntityValue(ctxt, &orig);
 		if (value) {
 		    if ((ctxt->sax != NULL) && (ctxt->sax->entityDecl != NULL))
 			ctxt->sax->entityDecl(ctxt->userData, name,
@@ -1841,7 +1983,7 @@
 	    }
 	} else {
 	    if ((CUR == '"') || (CUR == '\'')) {
-	        value = xmlParseEntityValue(ctxt);
+	        value = xmlParseEntityValue(ctxt, &orig);
 		if ((ctxt->sax != NULL) && (ctxt->sax->entityDecl != NULL))
 		    ctxt->sax->entityDecl(ctxt->userData, name,
 				XML_INTERNAL_GENERAL_ENTITY,
@@ -1887,6 +2029,19 @@
 	    ctxt->wellFormed = 0;
 	} else
 	    NEXT;
+	if (orig != NULL) {
+	    /*
+	     * TODO: somwhat unclean, extending the SAx API would be better !
+	     */
+	    xmlEntityPtr cur = NULL;
+
+	    if ((ctxt->sax != NULL) && (ctxt->sax->getEntity != NULL))
+	        cur = ctxt->sax->getEntity(ctxt, name);
+            if (cur != NULL)
+	        cur->orig = orig;
+	    else
+		free(orig);
+	}
 	if (name != NULL) free(name);
 	if (value != NULL) free(value);
 	if (URI != NULL) free(URI);
@@ -2681,7 +2836,8 @@
 	} else {
 	    NEXT;
 	    if ((ctxt->sax != NULL) && (ctxt->sax->elementDecl != NULL))
-	        ctxt->sax->elementDecl(ctxt->userData, name, ret, content);
+	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
+		                       content);
 	}
 	if (name != NULL) {
 	    free(name);
@@ -2712,6 +2868,161 @@
 }
 
 /**
+ * xmlParseTextDecl:
+ * @ctxt:  an XML parser context
+ * 
+ * parse an XML declaration header for external entities
+ *
+ * [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
+ *
+ * Returns the only valuable info for an external parsed entity, the encoding
+ */
+
+CHAR *
+xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
+    CHAR *version;
+    CHAR *encoding = NULL;
+
+    /*
+     * We know that '<?xml' is here.
+     */
+    SKIP(5);
+
+    if (!IS_BLANK(CUR)) {
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData, "Blank needed after '<?xml'\n");
+	ctxt->wellFormed = 0;
+    }
+    SKIP_BLANKS;
+
+    /*
+     * We may have the VersionInfo here.
+     */
+    version = xmlParseVersionInfo(ctxt);
+    /* TODO: we should actually inherit from the referencing doc if absent
+    if (version == NULL)
+	version = xmlCharStrdup(XML_DEFAULT_VERSION);
+    ctxt->version = xmlStrdup(version);
+     */
+    if (version != NULL)
+	free(version);
+
+    /*
+     * We must have the encoding declaration
+     */
+    if (!IS_BLANK(CUR)) {
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData, "Blank needed here\n");
+	ctxt->wellFormed = 0;
+    }
+    encoding = xmlParseEncodingDecl(ctxt);
+
+    SKIP_BLANKS;
+    if ((CUR == '?') && (NXT(1) == '>')) {
+        SKIP(2);
+    } else if (CUR == '>') {
+        /* Deprecated old WD ... */
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData, "XML declaration must end-up with '?>'\n");
+	ctxt->wellFormed = 0;
+	NEXT;
+    } else {
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData, "parsing XML declaration: '?>' expected\n");
+	ctxt->wellFormed = 0;
+	MOVETO_ENDTAG(CUR_PTR);
+	NEXT;
+    }
+    return(encoding);
+}
+
+/*
+ * xmlParseConditionalSections
+ * @ctxt:  an XML parser context
+ *
+ * TODO : Conditionnal section are not yet supported !
+ *
+ * [61] conditionalSect ::= includeSect | ignoreSect 
+ * [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' 
+ * [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
+ * [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
+ * [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
+ */
+
+void
+xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
+    if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+	ctxt->sax->warning(ctxt->userData,
+                           "XML conditional section not supported\n");
+    /*
+     * Skip up to the end of the conditionnal section.
+     */
+    while ((CUR != 0) && ((CUR != ']') || (NXT(1) != ']') || (NXT(2) != '>')))
+	NEXT;
+    if (CUR == 0) {
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData,
+	        "XML conditional section not closed\n");
+	ctxt->wellFormed = 0;
+    }
+}
+
+/**
+ * xmlParseExternalSubset
+ * @ctxt:  an XML parser context
+ * 
+ * parse Markup declarations from an external subset
+ *
+ * [30] extSubset ::= textDecl? extSubsetDecl
+ *
+ * [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
+ *
+ * TODO There is a check [ VC: Proper Declaration/PE Nesting ]
+ */
+void
+xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
+                       const CHAR *SystemID) {
+    if ((CUR == '<') && (NXT(1) == '?') &&
+        (NXT(2) == 'x') && (NXT(3) == 'm') &&
+	(NXT(4) == 'l')) {
+	xmlParseTextDecl(ctxt);
+    }
+    if (ctxt->myDoc == NULL) {
+        ctxt->myDoc = xmlNewDoc("1.0");
+    }
+    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
+        xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
+
+    while (((CUR == '<') && (NXT(1) == '?')) ||
+           ((CUR == '<') && (NXT(1) == '!')) ||
+           IS_BLANK(CUR)) {
+        if ((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
+	    xmlParseConditionalSections(ctxt);
+	} else if (IS_BLANK(CUR)) {
+	    NEXT;
+	} else if (CUR == '%') {
+            xmlParsePEReference(ctxt);
+	} else
+	    xmlParseMarkupDecl(ctxt);
+
+	/*
+	 * Pop-up of finished entities.
+	 */
+	while ((CUR == 0) && (ctxt->inputNr > 1))
+	    xmlPopInput(ctxt);
+
+    }
+    
+    if (CUR != 0) {
+	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt->userData,
+	        "Extra content at the end of the document\n");
+	ctxt->wellFormed = 0;
+    }
+
+}
+
+/**
  * xmlParseCharRef:
  * @ctxt:  an XML parser context
  *
@@ -2720,12 +3031,11 @@
  * [66] CharRef ::= '&#' [0-9]+ ';' |
  *                  '&#x' [0-9a-fA-F]+ ';'
  *
- * Returns the value parsed
+ * Returns the value parsed (as an int)
  */
-CHAR *
+int
 xmlParseCharRef(xmlParserCtxtPtr ctxt) {
     int val = 0;
-    CHAR buf[2];
 
     if ((CUR == '&') && (NXT(1) == '#') &&
         (NXT(2) == 'x')) {
@@ -2775,16 +3085,63 @@
      * Check the value IS_CHAR ...
      */
     if (IS_CHAR(val)) {
-        buf[0] = (CHAR) val;
-	buf[1] = 0;
-	return(xmlStrndup(buf, 1));
+        return(val);
     } else {
 	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 	    ctxt->sax->error(ctxt->userData, "xmlParseCharRef: invalid CHAR value %d\n",
 	                     val);
 	ctxt->wellFormed = 0;
     }
-    return(NULL);
+    return(0);
+}
+
+/**
+ * xmlParseReference:
+ * @ctxt:  an XML parser context
+ * 
+ * parse and handle entity references in content, depending on the SAX
+ * interface, this may end-up in a call to character() if this is a
+ * CharRef, a predefined entity, if there is no reference() callback.
+ * or if the parser was asked to switch to that mode.
+ *
+ * [67] Reference ::= EntityRef | CharRef
+ */
+void
+xmlParseReference(xmlParserCtxtPtr ctxt) {
+    xmlEntityPtr ent;
+    CHAR *val;
+    if (CUR != '&') return;
+
+    if (NXT(1) == '#') {
+	CHAR out[2];
+	int val = xmlParseCharRef(ctxt);
+	/* TODO: invalid for UTF-8 variable encoding !!! */
+	out[0] = val;
+	out[1] = 0;
+	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
+	    ctxt->sax->characters(ctxt->userData, out, 1);
+    } else {
+	ent = xmlParseEntityRef(ctxt);
+	if (ent == NULL) return;
+	if ((ent->name != NULL) && 
+	    (ent->type != XML_INTERNAL_PREDEFINED_ENTITY) &&
+	    (ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
+	    (ctxt->replaceEntities == 0)) {
+
+	    /*
+	     * Create a node.
+	     */
+	    ctxt->sax->reference(ctxt->userData, ent->name);
+	    return;
+	}
+	val = ent->content;
+	if (val == NULL) return;
+	/*
+	 * inline the entity.
+	 */
+	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
+	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
+    }
 }
 
 /**
@@ -2795,15 +3152,13 @@
  *
  * [68] EntityRef ::= '&' Name ';'
  *
- * Returns the entity ref string or NULL if directly as input stream.
+ * Returns the xmlEntityPtr if found, or NULL otherwise.
  */
-CHAR *
+xmlEntityPtr
 xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
-    CHAR *ret = NULL;
     const CHAR *q;
     CHAR *name;
     xmlEntityPtr ent = NULL;
-    xmlParserInputPtr input = NULL;
 
     q = CUR_PTR;
     if (CUR == '&') {
@@ -2817,6 +3172,17 @@
 	    if (CUR == ';') {
 	        NEXT;
 		/*
+		 * Ask first SAX for entity resolution, otherwise try the
+		 * predefined set.
+		 */
+		if (ctxt->sax != NULL) {
+		    if (ctxt->sax->getEntity != NULL)
+			ent = ctxt->sax->getEntity(ctxt->userData, name);
+		    if (ent == NULL)
+		        ent = xmlGetPredefinedEntity(name);
+		}
+
+		/*
 		 * Well Formedness Constraint if:
 		 *   - standalone
 		 * or
@@ -2827,26 +3193,24 @@
 		 *
 		 * TODO: to be double checked !!! This is wrong !
 		 */
-		if (ctxt->sax != NULL) {
-		    if (ctxt->sax->getEntity != NULL)
-			ent = ctxt->sax->getEntity(ctxt->userData, name);
-
+		if (ent == NULL) {
+		    if (ctxt->sax != NULL) {
 		    if (((ctxt->sax->isStandalone != NULL) &&
-		         ctxt->sax->isStandalone(ctxt->userData) == 1) ||
+			 ctxt->sax->isStandalone(ctxt->userData) == 1) ||
 			(((ctxt->sax->hasInternalSubset == NULL) ||
 			  ctxt->sax->hasInternalSubset(ctxt->userData) == 0) &&
 			 ((ctxt->sax->hasExternalSubset == NULL) ||
 			  ctxt->sax->hasExternalSubset(ctxt->userData) == 0))) {
-			if (ent == NULL) {
-			    if ((ctxt->sax != NULL) &&
-			        (ctxt->sax->error != NULL))
-				ctxt->sax->error(ctxt->userData, 
-				     "Entity '%s' not defined\n", name);
-			    ctxt->wellFormed = 0;
-			}
+			if (ctxt->sax->error != NULL)
+			    ctxt->sax->error(ctxt->userData, 
+				 "Entity '%s' not defined\n", name);
+			ctxt->wellFormed = 0;
 		    }
-		} else
-		    ctxt->wellFormed = 0;
+		    } else {
+		        fprintf(stderr, "Entity '%s' not defined\n", name);
+			ctxt->wellFormed = 0;
+		    }
+		}
 
 		/*
 		 * Well Formedness Constraint :
@@ -2872,65 +3236,22 @@
 		}
 
 		/*
+		 * TODO: !!!
 		 * Well Formedness Constraint :
 		 *   The referenced entity must not lead to recursion !
 		 */
 		 
-		/*
-		 * We parsed the entity reference correctly, call SAX
-		 * interface for the proper behaviour:
-		 *   - get a new input stream
-		 *   - or keep the reference inline
-		 */
-		if ((ctxt->sax) && (ctxt->sax->resolveEntity != NULL))
-		    input = ctxt->sax->resolveEntity(ctxt->userData, NULL, name);
-		if (input != NULL)
-		    xmlPushInput(ctxt, input);
-		else {
-		    ret = xmlStrndup(q, CUR_PTR - q);
-		}
-	    } else {
-		char cst[2] = { '&', 0 };
 
+	    } else {
 		if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 		    ctxt->sax->error(ctxt->userData,
 		                     "xmlParseEntityRef: expecting ';'\n");
 		ctxt->wellFormed = 0;
-		ret = xmlStrndup(cst, 1);
-		ret = xmlStrcat(ret, name);
 	    }
 	    free(name);
 	}
     }
-    return(ret);
-}
-
-/**
- * xmlParseReference:
- * @ctxt:  an XML parser context
- * 
- * parse Reference declarations
- *
- * [67] Reference ::= EntityRef | CharRef
- *
- * Returns the entity string or NULL if handled directly by pushing
- *      the entity value as the input.
- */
-CHAR *
-xmlParseReference(xmlParserCtxtPtr ctxt) {
-    if ((CUR == '&') && (NXT(1) == '#')) {
-        CHAR *val = xmlParseCharRef(ctxt);
-	xmlParserInputPtr in;
-
-	if (val != NULL) {
-	    in = xmlNewStringInputStream(ctxt, val);
-	    xmlPushInput(ctxt, in);
-	}
-	return(NULL);
-    } else if (CUR == '&') {
-        return(xmlParseEntityRef(ctxt));
-    }
-    return(NULL);
+    return(ent);
 }
 
 /**
@@ -2938,14 +3259,14 @@
  * @ctxt:  an XML parser context
  *
  * parse PEReference declarations
+ * The entity content is handled directly by pushing it's content as
+ * a new input stream.
  *
  * [69] PEReference ::= '%' Name ';'
  *
- * Returns the entity content or NULL if handled directly.
  */
-CHAR *
+void
 xmlParsePEReference(xmlParserCtxtPtr ctxt) {
-    CHAR *ret = NULL;
     CHAR *name;
     xmlEntityPtr entity = NULL;
     xmlParserInputPtr input;
@@ -2961,7 +3282,7 @@
 	    if (CUR == ';') {
 	        NEXT;
 		if ((ctxt->sax != NULL) && (ctxt->sax->getEntity != NULL))
-			entity = ctxt->sax->getEntity(ctxt->userData, name);
+		    entity = ctxt->sax->getEntity(ctxt->userData, name);
 		/* TODO !!!! Must check that it's of the proper type !!! */
 		if (entity == NULL) {
 		    if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
@@ -2972,19 +3293,14 @@
 		    xmlPushInput(ctxt, input);
 		}
 	    } else {
-		char cst[2] = { '%', 0 };
-
 		if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 		    ctxt->sax->error(ctxt->userData,
 		                     "xmlParsePEReference: expecting ';'\n");
 		ctxt->wellFormed = 0;
-		ret = xmlStrndup(cst, 1);
-		ret = xmlStrcat(ret, name);
 	    }
 	    free(name);
 	}
     }
-    return(ret);
 }
 
 /**
@@ -3028,6 +3344,10 @@
     URI = xmlParseExternalID(ctxt, &ExternalID, 1);
     SKIP_BLANKS;
 
+    /*
+     * NOTE: the SAX callback may try to fetch the external subset
+     *       entity and fill it up !
+     */
     if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL))
 	ctxt->sax->internalSubset(ctxt->userData, name, ExternalID, URI);
 
@@ -3055,6 +3375,13 @@
 		ctxt->wellFormed = 0;
 		break;
 	    }
+
+	    /*
+	     * Pop-up of finished entities.
+	     */
+	    while ((CUR == 0) && (ctxt->inputNr > 1))
+		xmlPopInput(ctxt);
+
 	}
 	if (CUR == ']') NEXT;
     }
@@ -3419,23 +3746,7 @@
 	 *    parsing returns it's Name, create the node 
 	 */
 	else if (CUR == '&') {
-	    CHAR *val = xmlParseReference(ctxt);
-	    if (val != NULL) {
-	        if (val[0] != '&') {
-		    /*
-		     * inline predefined entity.
-		     */
-                    if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
-			ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
-		} else {
-		    /*
-		     * user defined entity, create a node.
-		     */
-                    if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL))
-			ctxt->sax->reference(ctxt->userData, val);
-		}
-		free(val);
-	    }
+	    xmlParseReference(ctxt);
 	}
 
 	/*
@@ -3738,6 +4049,7 @@
 	(NXT(6) == 'l') && (NXT(7) == 'o') &&
 	(NXT(8) == 'n') && (NXT(9) == 'e')) {
 	SKIP(10);
+        SKIP_BLANKS;
 	if (CUR != '=') {
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 	        ctxt->sax->error(ctxt->userData,
@@ -4118,6 +4430,109 @@
 }
 
 /**
+ * xmlSAXParseDTD :
+ * @sax:  the SAX handler block
+ * @ExternalID:  a NAME* containing the External ID of the DTD
+ * @SystemID:  a NAME* containing the URL to the DTD
+ *
+ * Load and parse an external subset.
+ * 
+ * Returns the resulting xmlDtdPtr or NULL in case of error.
+ */
+
+xmlDtdPtr
+xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
+                          const CHAR *SystemID) {
+    xmlDtdPtr ret = NULL;
+    xmlParserCtxtPtr ctxt;
+    xmlParserInputPtr input;
+    xmlCharEncoding enc;
+
+    if ((ExternalID == NULL) && (SystemID == NULL)) return(NULL);
+
+    ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+    if (ctxt == NULL) {
+        perror("malloc");
+	return(NULL);
+    }
+    xmlInitParserCtxt(ctxt);
+    input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+    if (input == NULL) {
+        perror("malloc");
+	free(ctxt);
+	return(NULL);
+    }
+
+    /*
+     * Set-up the SAX context
+     */
+    if (ctxt == NULL) return(NULL);
+    if (sax != NULL) { 
+        ctxt->sax = sax;
+        ctxt->userData = NULL;
+    }
+
+    /*
+     * Ask the Entity resolver to load the damn thing
+     */
+
+    if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
+	input = ctxt->sax->resolveEntity(ctxt->userData, ExternalID, SystemID);
+    if (input == NULL) {
+	xmlFreeParserCtxt(ctxt);
+	return(NULL);
+    }
+
+    /*
+     * plug some encoding conversion routines here. !!!
+     */
+    xmlPushInput(ctxt, input);
+    enc = xmlDetectCharEncoding(ctxt->input->cur);
+    xmlSwitchEncoding(ctxt, enc);
+
+    input->filename = xmlStrdup(SystemID);
+    input->line = 1;
+    input->col = 1;
+    input->base = ctxt->input->cur;
+    input->cur = ctxt->input->cur;
+    input->free = NULL;
+
+    /*
+     * let's parse that entity knowing it's an external subset.
+     */
+    xmlParseExternalSubset(ctxt, ExternalID, SystemID);
+
+    if (ctxt->myDoc != NULL) {
+	if (ctxt->wellFormed) {
+	    ret = ctxt->myDoc->intSubset;
+	    ctxt->myDoc->intSubset = NULL;
+	} else {
+	    ret = NULL;
+	}
+        xmlFreeDoc(ctxt->myDoc);
+        ctxt->myDoc = NULL;
+    }
+    xmlFreeParserCtxt(ctxt);
+    
+    return(ret);
+}
+
+/**
+ * xmlParseDTD :
+ * @ExternalID:  a NAME* containing the External ID of the DTD
+ * @SystemID:  a NAME* containing the URL to the DTD
+ *
+ * Load and parse an external subset.
+ * 
+ * Returns the resulting xmlDtdPtr or NULL in case of error.
+ */
+
+xmlDtdPtr
+xmlParseDTD(const CHAR *ExternalID, const CHAR *SystemID) {
+    return(xmlSAXParseDTD(NULL, ExternalID, SystemID));
+}
+
+/**
  * xmlRecoverDoc :
  * @cur:  a pointer to an array of CHAR
  *
@@ -4268,7 +4683,8 @@
  * Returns the resulting document tree
  */
 
-xmlDocPtr xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
+xmlDocPtr
+xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
                           int recovery) {
     xmlDocPtr ret;
     xmlParserCtxtPtr ctxt;
@@ -4303,7 +4719,8 @@
  * Returns the resulting document tree
  */
 
-xmlDocPtr xmlParseFile(const char *filename) {
+xmlDocPtr
+xmlParseFile(const char *filename) {
     return(xmlSAXParseFile(NULL, filename, 0));
 }
 
@@ -4318,11 +4735,34 @@
  * Returns the resulting document tree
  */
 
-xmlDocPtr xmlRecoverFile(const char *filename) {
+xmlDocPtr
+xmlRecoverFile(const char *filename) {
     return(xmlSAXParseFile(NULL, filename, 1));
 }
 
 /**
+ * xmlSubstituteEntitiesDefault :
+ * @val:  int 0 or 1 
+ *
+ * Set and return the previous value for default entity support.
+ * Initially the parser always keep entity references instead of substituting
+ * entity values in the output. This function has to be used to change the
+ * default parser behaviour
+ * SAX::subtituteEntities() has to be used for changing that on a file by
+ * file basis.
+ *
+ * Returns the last value for 0 for no substitution, 1 for substitution.
+ */
+
+int
+xmlSubstituteEntitiesDefault(int val) {
+    int old = xmlSubstituteEntitiesDefaultValue;
+
+    xmlSubstituteEntitiesDefaultValue = val;
+    return(old);
+}
+
+/**
  * xmlCreateMemoryParserCtxt :
  * @buffer:  an pointer to a char array
  * @size:  the siwe of the array
@@ -4469,6 +4909,7 @@
     ctxt->userData = ctxt;
     ctxt->myDoc = NULL;
     ctxt->wellFormed = 1;
+    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
     ctxt->record_info = 0;
     xmlInitNodeInfoSeq(&ctxt->node_seq);
 }
@@ -4698,3 +5139,5 @@
     ctxt->node_seq.length++;
   }   
 }
+
+
diff --git a/parser.h b/parser.h
index 2075607..aaab58c 100644
--- a/parser.h
+++ b/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/parserInternals.h b/parserInternals.h
index 75e9e13..6a31c51 100644
--- a/parserInternals.h
+++ b/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/result/SVG/4rects.xml b/result/SVG/4rects.xml
new file mode 100644
index 0000000..dfaa02d
--- /dev/null
+++ b/result/SVG/4rects.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Four separate rectangles

+  </desc>
+  <rect width="20" height="60"/>
+  <rect width="30" height="70"/>
+  <rect width="40" height="80"/>
+  <rect width="50" height="90"/>
+</svg>
diff --git a/result/SVG/a-valid.xml b/result/SVG/a-valid.xml
new file mode 100644
index 0000000..8f4a204
--- /dev/null
+++ b/result/SVG/a-valid.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This valid svg document draws a triangle which is a hyperlink

+  </desc>
+  <a href="http://www.w3.org">
+    <p d="M 0 0 L 200 0 L 100 200 Z"/>
+  </a>
+</svg>
diff --git a/result/SVG/a-wf.xml b/result/SVG/a-wf.xml
new file mode 100644
index 0000000..c4301bb
--- /dev/null
+++ b/result/SVG/a-wf.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc>This well formed svg document draws a triangle which is a hyperlink

+  </desc>
+  <a link="simple" show="replace" actuate="user" href="http://www.w3.org">
+    <p d="M 0 0 L 200 0 L 100 200 Z"/>
+  </a>
+</svg>
diff --git a/result/SVG/bike-errors.xml b/result/SVG/bike-errors.xml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/result/SVG/bike-errors.xml
diff --git a/result/SVG/bike.xml b/result/SVG/bike.xml
new file mode 100644
index 0000000..f74034b
--- /dev/null
+++ b/result/SVG/bike.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <title>Kona Lavadome mountain bike

+  </title>
+  <desc>This picture shows a mountain bike, a human-propelled, 

+  multi-terrain vehicle. While it can be succesfully used on moorland, 

+  forest, roads, and large hills it is not actually suitable for going 

+  up mountains.

+  </desc>
+  <g id="bike">
+    <defs>
+      <symbol id="spoke">
+        <desc>14/12 gauge double butted spoke</desc>
+      </symbol>
+      <symbol id="hub">
+        <desc>black anodised low torsion hub</desc>
+      </symbol>
+      <symbol id="rim">
+        <desc>twin wall, eyeletted rim</desc>
+      </symbol>
+      <symbol id="cogs">
+        <desc>8 speed, wide ratio gearing</desc>
+      </symbol>
+      <symbol id="lacing">
+        <desc>double cross lacing of 32 spokes</desc>
+      </symbol>
+    </defs>
+    <g id="frontwheel">
+      <title>Front wheel</title>
+      <desc>The front wheel provides grip, steering and some shock absorption</desc>
+      <use href="id(lacing)" style="rotation: 20deg; fillcolor: black"/>
+    </g>
+    <g id="backwheel"/>
+    <g id="frame"/>
+  </g>
+</svg>
diff --git a/result/SVG/circle.xml b/result/SVG/circle.xml
new file mode 100644
index 0000000..ae7d545
--- /dev/null
+++ b/result/SVG/circle.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This is a blue circle with a red outline

+  </desc>
+  <g>
+    <circle style="fill: blue; stroke: red" cx="200" cy="200" r="100"/>
+  </g>
+</svg>
diff --git a/result/SVG/defs.xml b/result/SVG/defs.xml
new file mode 100644
index 0000000..ba48572
--- /dev/null
+++ b/result/SVG/defs.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <rect id="TemplateObject01" width="100" height="37.34"/>
+    <lineargradient id="Gradient01">
+      <gradientstop offset="30%" color="#39F"/>
+    </lineargradient>
+  </defs>
+  <desc>Defining things for later use

+  </desc>
+</svg>
diff --git a/result/SVG/desc.xml b/result/SVG/desc.xml
new file mode 100644
index 0000000..ed598b9
--- /dev/null
+++ b/result/SVG/desc.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg SYSTEM "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <g>
+    <title>

+    Company sales by region

+  </title>
+    <desc>

+    This is a bar chart which shows 

+    company sales by region.

+  </desc>
+  </g>
+</svg>
diff --git a/result/SVG/ellipse.xml b/result/SVG/ellipse.xml
new file mode 100644
index 0000000..1f72346
--- /dev/null
+++ b/result/SVG/ellipse.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This is an ellipse, axis aligned and centered on the origin

+  </desc>
+  <g>
+    <ellipse major="85" minor="45"/>
+  </g>
+</svg>
diff --git a/result/SVG/flower2.xml b/result/SVG/flower2.xml
new file mode 100644
index 0000000..f8970db
--- /dev/null
+++ b/result/SVG/flower2.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="800px" height="800px">
+  <desc>This sample SVG file draws a flower</desc>
+  <g style="transform: matrix(1 0 0 -1 -25.88 798.60);

+     stroke: #000; stroke-width: 1">
+    <path style="fill: #1A5466" d="m 242.33 684.19

+          C 346.44 757.48 271.45 647.38 213.17 641.37

+          C 271.45 647.38 383.43 575.21 256.71 613.30

+          C 383.43 575.21 251.04 565.90 205.23 609.68

+          C 251.04 565.90 265.13 432.88 210.71 557.95

+          C 265.13 432.88 175.04 531.37 175.67 596.26

+          C 175.04 531.37 80.63  437.67 138.96 559.82

+          C  80.63 437.67 100.67 569.80 146.75 611.20

+          C 100.67 569.80 -31.14 585.98 95.49  617.49

+          C -31.14 585.98 83.94  652.25 140.24 643.26

+          C 83.94  652.25 13.98  766.12 113.04 687.55

+          C 13.98  766.12 137.45 716.63 161.05 668.30

+          C 137.45 716.63 182.02 842.45 178.39 717.23

+          C 182.02 842.45 220.90 714.46 193.51 667.46

+          C 220.90 714.46 346.44 757.48 242.33 684.19 z"/>
+    <path style="fill: #34AACD" d="M 235.33 691.19

+          C 339.44 764.48 264.45 654.38 206.17 648.37

+          C 264.45 654.38 376.43 582.21 249.71 620.30

+          C 376.43 582.21 244.04 572.90 198.23 616.68

+          C 244.04 572.90 258.13 439.88 203.71 564.95

+          C 258.13 439.88 168.04 538.37 168.67 603.26

+          C 168.04 538.37 73.63  444.67 131.96 566.82

+          C 73.63  444.67 93.67  576.80 139.75 618.20

+          C 93.67  576.80 -38.14 592.98  88.49 624.49

+          C -38.14 592.98 76.94  659.25 133.24 650.26

+          C 76.94  659.25 6.98   773.12 106.04 694.55

+          C 6.98   773.12 130.45 723.63 154.05 675.30

+          C 130.45 723.63 175.02 849.45 171.39 724.23

+          C 175.02 849.45 213.90 721.46 186.51 674.46

+          C 213.90 721.46 339.44 764.48 235.33 691.19 z"/>
+    <path style="fill: #F881BF" d="M 199.44 634.43

+          C 199.44 622.16 189.19 612.21 176.54 612.21

+          C 163.89 612.21 153.63 622.16 153.63 634.43

+          C 153.63 646.71 163.89 656.66 176.54 656.66

+          C 189.19 656.66 199.44 646.71 199.44 634.43 z"/>
+  </g>
+</svg>
diff --git a/result/SVG/gradient.xml b/result/SVG/gradient.xml
new file mode 100644
index 0000000..1905b60
--- /dev/null
+++ b/result/SVG/gradient.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Gradient example

+  </desc>
+  <g>
+    <defs>
+      <lineargradient id="MyGradient">
+        <gradientstop offset="0%" color="#F60"/>
+        <gradientstop offset="70%" color="#FF6"/>
+      </lineargradient>
+    </defs>
+    <rect style="fill: url(#MyGradient)" width="20" height="15.8"/>
+  </g>
+</svg>
diff --git a/result/SVG/group01.xml b/result/SVG/group01.xml
new file mode 100644
index 0000000..f39ad88
--- /dev/null
+++ b/result/SVG/group01.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Two groups, each of two rectangles

+  </desc>
+  <g style="fillcolor:red">
+    <rect x="100" y="100" width="100" height="100"/>
+    <rect x="300" y="100" width="100" height="100"/>
+  </g>
+  <g style="fillcolor:blue">
+    <rect x="100" y="300" width="100" height="100"/>
+    <rect x="300" y="300" width="100" height="100"/>
+  </g>
+</svg>
diff --git a/result/SVG/group02.xml b/result/SVG/group02.xml
new file mode 100644
index 0000000..85e1f52
--- /dev/null
+++ b/result/SVG/group02.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Two named groups

+  </desc>
+  <g id="OBJECT1">
+    <rect x="100" y="100" width="100" height="100"/>
+  </g>
+  <g id="OBJECT2">
+    <circle cx="150" cy="300" r="25"/>
+  </g>
+</svg>
diff --git a/result/SVG/group03.xml b/result/SVG/group03.xml
new file mode 100644
index 0000000..20d75ad
--- /dev/null
+++ b/result/SVG/group03.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Groups can nest

+  </desc>
+  <g>
+    <g>
+      <g/>
+    </g>
+  </g>
+</svg>
diff --git a/result/SVG/image-valid.xml b/result/SVG/image-valid.xml
new file mode 100644
index 0000000..d45d229
--- /dev/null
+++ b/result/SVG/image-valid.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This graphic links to an external image

+  </desc>
+  <image x="200" y="200" style="width: 100px; height: 100px" href="myimage.png">
+    <title>My image</title>
+  </image>
+</svg>
diff --git a/result/SVG/image-wf.xml b/result/SVG/image-wf.xml
new file mode 100644
index 0000000..54c8df1
--- /dev/null
+++ b/result/SVG/image-wf.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc>This links to an external image

+  </desc>
+  <image x="200" y="200" style="width: 100px; height: 100px" link="simple" show="embed" actuate="auto" href="myimage.png">
+    <title>My image</title>
+  </image>
+</svg>
diff --git a/result/SVG/lin-gradient.xml b/result/SVG/lin-gradient.xml
new file mode 100644
index 0000000..645bdce
--- /dev/null
+++ b/result/SVG/lin-gradient.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Linear gradient example

+  </desc>
+  <g>
+    <defs>
+      <lineargradient id="MyGradient">
+        <gradientstop offset="0%" color="#F60"/>
+        <gradientstop offset="70%" color="#FF6"/>
+      </lineargradient>
+    </defs>
+    <rect style="fill: url(#MyGradient)" width="20" height="15.8"/>
+  </g>
+</svg>
diff --git a/result/SVG/marker.xml b/result/SVG/marker.xml
new file mode 100644
index 0000000..013c5cd
--- /dev/null
+++ b/result/SVG/marker.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <symbol id="Triangle" min-x="0" min-y="0" max-x="100" max-y="100" ref-x="0" ref-y="50">
+      <path d="M 0 0 L 0 100 L 100 50 z"/>
+    </symbol>
+  </defs>
+  <desc>An double-headed arrow example using markers

+  </desc>
+  <path d="M0 0">
+    <marker href="#Triangle" width="200" height="200" style="text-transform: rotate(180)"/>
+    <data d="M 2000 2000"/>
+    <marker href=""/>
+    <data d="L 4000 2000 L 4000 4000"/>
+    <marker href="#Triangle" width="200" height="200"/>
+    <data d="L 6000 4000"/>
+  </path>
+</svg>
diff --git a/result/SVG/mask.xml b/result/SVG/mask.xml
new file mode 100644
index 0000000..1204e06
--- /dev/null
+++ b/result/SVG/mask.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Example of using a mask

+  </desc>
+  <g>
+    <defs>
+      <image id="MyMask" href="transp.png"/>
+    </defs>
+    <rect style="mask: url(#MyMask)" width="12.5" height="30"/>
+  </g>
+</svg>
diff --git a/result/SVG/mathswitch.xml b/result/SVG/mathswitch.xml
new file mode 100644
index 0000000..8f4e539
--- /dev/null
+++ b/result/SVG/mathswitch.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc>This example uses the switch element to provide a 

+  fallback graphical representation of an equation, if 

+  MathML is not supported.

+  </desc>
+  <switch>
+    <foreignobject system-required="http://www.w3.org/TR/REC-MathML-19980407" width="100" height="50"/>
+    <g>
+      <rect style="fill: red"/>
+      <text>Formula goes here</text>
+    </g>
+  </switch>
+</svg>
diff --git a/result/SVG/parentns.xml b/result/SVG/parentns.xml
new file mode 100644
index 0000000..b204637
--- /dev/null
+++ b/result/SVG/parentns.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<ABC xmlns="http://parent.name.space" xmlns:svg="http://www.w3.org/Graphics/SVG/1.0">
+  <svg:svg width="40%" height="40%">
+    <svg:rectangle width="43.6" height="31.5"/>
+  </svg:svg>
+</ABC>
diff --git a/result/SVG/path01.xml b/result/SVG/path01.xml
new file mode 100644
index 0000000..646940b
--- /dev/null
+++ b/result/SVG/path01.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <path d="M 100 100 L 140 100 L 120 140 z"/>
+</svg>
diff --git a/result/SVG/path02.xml b/result/SVG/path02.xml
new file mode 100644
index 0000000..b74f975
--- /dev/null
+++ b/result/SVG/path02.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <path d="M 100 100">
+    <data d="L 140 100"/>
+    <data d="L 120 140"/>
+    <data d="z"/>
+  </path>
+</svg>
diff --git a/result/SVG/patternfill.xml b/result/SVG/patternfill.xml
new file mode 100644
index 0000000..425b361
--- /dev/null
+++ b/result/SVG/patternfill.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <symbol id="fourstar"/>
+  </defs>
+  <ellipse style="fill: url(#fourstar)" major="40" minor="27"/>
+</svg>
diff --git a/result/SVG/polyline.xml b/result/SVG/polyline.xml
new file mode 100644
index 0000000..9fa4071
--- /dev/null
+++ b/result/SVG/polyline.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>A sample polyline, and equivalent path

+  </desc>
+  <polyline verts="20,20 50,100 200,80 70,300"/>
+  <path d="M20,20 L50,100 L200,80 L70,300"/>
+</svg>
diff --git a/result/SVG/private.xml b/result/SVG/private.xml
new file mode 100644
index 0000000..e69fc46
--- /dev/null
+++ b/result/SVG/private.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <defs>
+    <private xmlns:myapp="http://mycompany/mapapp">
+      <myapp:piechart title="Sales by Region">
+        <myapp:piece label="Northern Region" value="1.23"/>
+        <myapp:piece label="Eastern Region" value="2.53"/>
+        <myapp:piece label="Southern Region" value="3.89"/>
+        <myapp:piece label="Western Region" value="2.04"/>
+      </myapp:piechart>
+    </private>
+  </defs>
+  <desc>This chart includes private data in another namespace

+  </desc>
+</svg>
diff --git a/result/SVG/rad-gradient.xml b/result/SVG/rad-gradient.xml
new file mode 100644
index 0000000..d5aadf0
--- /dev/null
+++ b/result/SVG/rad-gradient.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Radial gradient example with three gradient stops

+  </desc>
+  <g>
+    <defs>
+      <radialgradient id="MyGradient">
+        <gradientstop offset="0%" color="white"/>
+        <gradientstop offset="50%" color="red"/>
+        <gradientstop offset="100%" color="black"/>
+      </radialgradient>
+    </defs>
+    <circle style="fill: url(#MyGradient)" r="42"/>
+  </g>
+</svg>
diff --git a/result/SVG/rectangle.xml b/result/SVG/rectangle.xml
new file mode 100644
index 0000000..919cd23
--- /dev/null
+++ b/result/SVG/rectangle.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This is a rectangle

+  </desc>
+  <g>
+    <rect x="20" y="30" width="100" height="80"/>
+  </g>
+</svg>
diff --git a/result/SVG/richdesc.xml b/result/SVG/richdesc.xml
new file mode 100644
index 0000000..e2a15d9
--- /dev/null
+++ b/result/SVG/richdesc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc xmlns:mydoc="http://foo.org/mydoc">
+    <mydoc:title>This is an example SVG file</mydoc:title>
+    <mydoc:para>The global description uses markup from the 

+        
+      <mydoc:emph>mydoc</mydoc:emph>
+ namespace.    </mydoc:para>
+  </desc>
+  <g/>
+</svg>
diff --git a/result/SVG/script.xml b/result/SVG/script.xml
new file mode 100644
index 0000000..133c0a0
--- /dev/null
+++ b/result/SVG/script.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <script>

+      /* Beep on mouseclick */

+      MouseClickHandler() { beep(); }

+     &gt;

+    </script>
+  </defs>
+  <circle onclick="MouseClickHandler()" r="85"/>
+</svg>
diff --git a/result/SVG/structure01.xml b/result/SVG/structure01.xml
new file mode 100644
index 0000000..a60174a
--- /dev/null
+++ b/result/SVG/structure01.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>
+<parent xmlns="http://someplace.org" xmlns:svg="http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+  <svg:svg width="5cm" height="8cm">
+    <svg:ellipse major="200" minor="130"/>
+  </svg:svg>
+</parent>
diff --git a/result/SVG/style.xml b/result/SVG/style.xml
new file mode 100644
index 0000000..80dfa42
--- /dev/null
+++ b/result/SVG/style.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <style>

+      .TitleText { font-size: 16; font-family: Helvetica } &gt;

+    </style>
+  </defs>
+  <text class="TitleText">Here is my title</text>
+</svg>
diff --git a/result/SVG/switch.xml b/result/SVG/switch.xml
new file mode 100644
index 0000000..383a47f
--- /dev/null
+++ b/result/SVG/switch.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="yes"?>
+<smil>
+  <body>
+    <switch>
+      <ref system-required="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" type="image/svg" src="drawing.svg"/>
+      <img src="alternate_image.jpg"/>
+    </switch>
+  </body>
+</smil>
diff --git a/result/SVG/symbol-use.xml b/result/SVG/symbol-use.xml
new file mode 100644
index 0000000..9265a66
--- /dev/null
+++ b/result/SVG/symbol-use.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <symbol id="TemplateObject01"/>
+  </defs>
+  <desc>Examples of inline and referenced content

+  </desc>
+  <g/>
+  <use href="#TemplateObject01"/>
+  <g>
+    <use href="#TemplateObject01"/>
+  </g>
+</svg>
diff --git a/result/SVG/template.xml b/result/SVG/template.xml
new file mode 100644
index 0000000..f844b48
--- /dev/null
+++ b/result/SVG/template.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc>This well formed svg document contains a hyperlink

+  </desc>
+  <a link="simple" show="replace" actuate="user" href="http://www.w3.org">
+    <p d="M 0 0 L 200 0 L 100 200 Z"/>
+  </a>
+</svg>
diff --git a/result/SVG/text01.xml b/result/SVG/text01.xml
new file mode 100644
index 0000000..0e2b44b
--- /dev/null
+++ b/result/SVG/text01.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <text id="TextToUse">XYZ</text>
+  </defs>
+  <text>ABC</text>
+  <text>
+    <src href="#TextToUse"/>
+  </text>
+</svg>
diff --git a/result/SVG/text02.xml b/result/SVG/text02.xml
new file mode 100644
index 0000000..9656ea5
--- /dev/null
+++ b/result/SVG/text02.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <defs>
+    <textflow id="TF1">
+      <t href="#T1"/>
+      <t href="#T3"/>
+    </textflow>
+    <textflow id="TF2">
+      <t href="#T2"/>
+      <t href="#T4"/>
+    </textflow>
+  </defs>
+  <text x="100" y="100" id="T1">
+    <tf href="#TF1">123</tf>
+  </text>
+  <text x="100" y="200" id="T2">
+    <tf href="#TF2">ABC</tf>
+  </text>
+  <text x="150" y="100" id="T3">
+    <tf href="#TF1">456</tf>
+  </text>
+  <text x="150" y="200" id="T4">
+    <tf href="#TF2">DEF</tf>
+  </text>
+</svg>
diff --git a/result/SVG/text03.xml b/result/SVG/text03.xml
new file mode 100644
index 0000000..be92031
--- /dev/null
+++ b/result/SVG/text03.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <textflow id="TF1">
+    <text x="100" y="100">123</text>
+    <text>456</text>
+  </textflow>
+</svg>
diff --git a/result/SVG/toap01.xml b/result/SVG/toap01.xml
new file mode 100644
index 0000000..778d92f
--- /dev/null
+++ b/result/SVG/toap01.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Simple text on a path

+  </desc>
+  <path id="MyPath" style="visibility: hidden" d="M 100 100 C 125 125 175 125 200 100"/>
+  <text>
+    <textpath href="#MyPath"/>
+Text on path  </text>
+</svg>
diff --git a/result/SVG/toap02.xml b/result/SVG/toap02.xml
new file mode 100644
index 0000000..c62aa04
--- /dev/null
+++ b/result/SVG/toap02.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <defs>
+    <symbol id="Triangle1" min-x="0" min-y="0" max-x="300" max-y="200">
+      <path d="M 50 0 L  50 200 L 250 0 z"/>
+    </symbol>
+    <symbol id="Triangle2" min-x="0" min-y="0" max-x="300" max-y="200">
+      <path d="M 50 0 L 250 200 L 250 0 z"/>
+    </symbol>
+  </defs>
+  <desc>General graphics on a path

+  </desc>
+  <text>
+    <textpath href="#MyPath"/>
+    <use href="#Triangle1"/>
+    <use href="#Triangle2"/>
+    <use href="#Triangle1"/>
+    <use href="#Triangle2"/>
+    <use href="#Triangle1"/>
+    <use href="#Triangle2"/>
+    <use href="#Triangle1"/>
+    <use href="#Triangle2"/>
+    <use href="#Triangle1"/>
+    <use href="#Triangle2"/>
+  </text>
+</svg>
diff --git a/result/SVG/transform.xml b/result/SVG/transform.xml
new file mode 100644
index 0000000..65712ac
--- /dev/null
+++ b/result/SVG/transform.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Demonstration of coordinate transforms

+  </desc>
+  <text style="font-size: 12">This prints 12 pixels high.</text>
+  <text style="font-size: 12px">This prints 12 pixels high.</text>
+  <g style="transform: scale(2)">
+    <text style="font-size: 12">This prints 24 pixels high.</text>
+    <text style="font-size: 12px">This prints 12 pixels high.</text>
+  </g>
+</svg>
diff --git a/result/SVG/trivial.xml b/result/SVG/trivial.xml
new file mode 100644
index 0000000..2ff9a37
--- /dev/null
+++ b/result/SVG/trivial.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in"/>
diff --git a/result/SVG/twin-gradients.xml b/result/SVG/twin-gradients.xml
new file mode 100644
index 0000000..5ce25cc
--- /dev/null
+++ b/result/SVG/twin-gradients.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>Gradients apply to leaf nodes

+  </desc>
+  <g>
+    <defs>
+      <lineargradient id="MyGradient">
+        <gradientstop offset="0%" color="#F60"/>
+        <gradientstop offset="70%" color="#FF6"/>
+      </lineargradient>
+    </defs>
+    <g style="fill: url(#MyGradient)">
+      <rect width="20" height="15.8"/>
+      <rect width="35" height="8"/>
+    </g>
+  </g>
+</svg>
diff --git a/result/SVG/v-template.xml b/result/SVG/v-template.xml
new file mode 100644
index 0000000..20d19fc
--- /dev/null
+++ b/result/SVG/v-template.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc/>
+  <g/>
+</svg>
diff --git a/result/SVG/viewport-nest.xml b/result/SVG/viewport-nest.xml
new file mode 100644
index 0000000..c742635
--- /dev/null
+++ b/result/SVG/viewport-nest.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="4in" height="3in">
+  <desc>This SVG drawing embeds another one,

+    thus establishing a new viewport

+  </desc>
+  <svg style="left: 25%; top: 25%" width="50%" height="50%"/>
+</svg>
diff --git a/result/SVG/viewport-transform.xml b/result/SVG/viewport-transform.xml
new file mode 100644
index 0000000..5acbc4c
--- /dev/null
+++ b/result/SVG/viewport-transform.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="300px" height="3oopx">
+  <desc>Transformation with establishment of a new viewport

+  </desc>
+  <text style="font-size: 12">This prints 12 pixels high.</text>
+  <text style="font-size: 12px">This prints 12 pixels high.</text>
+  <g style="transform: scale(2)">
+    <text style="font-size: 12">This prints 24 pixels high.</text>
+    <text style="font-size: 12px">This prints 12 pixels high.</text>
+  </g>
+  <g style="transform: scale(3)">
+    <svg style="left:0; top:0; right:100; bottom:100" width="100%" height="100%">
+      <text style="font-size: 12">This prints 36 pixels high.</text>
+      <text style="font-size: 12px">This prints 36 pixels high.</text>
+    </svg>
+  </g>
+</svg>
diff --git a/result/SVG/viewport.xml b/result/SVG/viewport.xml
new file mode 100644
index 0000000..26bb86c
--- /dev/null
+++ b/result/SVG/viewport.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>
+<parent xmlns="http://some.url">
+  <svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="100px" height="200px">
+    <path d="M100,100 Q200,400,300,100"/>
+  </svg>
+</parent>
diff --git a/result/SVG/wf-template.xml b/result/SVG/wf-template.xml
new file mode 100644
index 0000000..d30d8de
--- /dev/null
+++ b/result/SVG/wf-template.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" standalone="yes"?>
+<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
+  <desc/>
+</svg>
diff --git a/result/dia1 b/result/dia1
new file mode 100644
index 0000000..207bd73
--- /dev/null
+++ b/result/dia1
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+  <dia:diagramdata>
+    <dia:attribute name="background">
+      <dia:color val="#ffffff"/>
+    </dia:attribute>
+  </dia:diagramdata>
+  <dia:layer name="Background" visible="true">
+    <dia:object type="Standard - Line" version="0" id="O0">
+      <dia:attribute name="obj_pos">
+        <dia:point val="1.95,6.85"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="1.9,6.8;11,8.55"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="1.95,6.85"/>
+        <dia:point val="10.95,8.5"/>
+      </dia:attribute>
+      <dia:attribute name="line_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="start_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="1" to="O2" connection="3"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O1">
+      <dia:attribute name="obj_pos">
+        <dia:point val="4.8,4.75"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string val="sdfsdfg"/>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="1"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="4.8,4.75"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Box" version="0" id="O2">
+      <dia:attribute name="obj_pos">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.9,7.45;13.05,9.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="2.05"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+    </dia:object>
+  </dia:layer>
+</dia:diagram>
diff --git a/result/dia2 b/result/dia2
new file mode 100644
index 0000000..207bd73
--- /dev/null
+++ b/result/dia2
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+  <dia:diagramdata>
+    <dia:attribute name="background">
+      <dia:color val="#ffffff"/>
+    </dia:attribute>
+  </dia:diagramdata>
+  <dia:layer name="Background" visible="true">
+    <dia:object type="Standard - Line" version="0" id="O0">
+      <dia:attribute name="obj_pos">
+        <dia:point val="1.95,6.85"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="1.9,6.8;11,8.55"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="1.95,6.85"/>
+        <dia:point val="10.95,8.5"/>
+      </dia:attribute>
+      <dia:attribute name="line_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="start_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="1" to="O2" connection="3"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O1">
+      <dia:attribute name="obj_pos">
+        <dia:point val="4.8,4.75"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string val="sdfsdfg"/>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="1"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="4.8,4.75"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Box" version="0" id="O2">
+      <dia:attribute name="obj_pos">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.9,7.45;13.05,9.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="2.05"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+    </dia:object>
+  </dia:layer>
+</dia:diagram>
diff --git a/result/dtd10 b/result/dtd10
new file mode 100644
index 0000000..82ac138
--- /dev/null
+++ b/result/dtd10
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b)+ , c , d)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc>
+  <b>This</b>
+  <c> is a</c>
+  <d> valid document</d>
+</doc>
diff --git a/result/dtd11 b/result/dtd11
new file mode 100644
index 0000000..e0df8af
--- /dev/null
+++ b/result/dtd11
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc val CDATA #IMPLIED>
+]>
+<doc val="v1"/>
diff --git a/result/dtd2 b/result/dtd2
new file mode 100644
index 0000000..921fd94
--- /dev/null
+++ b/result/dtd2
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>This is a valid document !</doc>
diff --git a/result/dtd3 b/result/dtd3
new file mode 100644
index 0000000..6681ef7
--- /dev/null
+++ b/result/dtd3
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc ANY>
+]>
+<doc>This is a valid document !</doc>
diff --git a/result/dtd4 b/result/dtd4
new file mode 100644
index 0000000..6cf2444
--- /dev/null
+++ b/result/dtd4
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc EMPTY>
+]>
+<doc/>
diff --git a/result/dtd5 b/result/dtd5
new file mode 100644
index 0000000..4c0a0c5
--- /dev/null
+++ b/result/dtd5
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA | a | b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc>
+  <a>This</a>
+ is a   <b>valid</b>
+ document</doc>
diff --git a/result/dtd6 b/result/dtd6
new file mode 100644
index 0000000..8b3875e
--- /dev/null
+++ b/result/dtd6
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (a | b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc>
+  <a>This</a>
+  <b> is a valid</b>
+  <a> document</a>
+</doc>
diff --git a/result/dtd7 b/result/dtd7
new file mode 100644
index 0000000..4da0ce6
--- /dev/null
+++ b/result/dtd7
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (a , b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc>
+  <a>This</a>
+  <b> is a valid document</b>
+</doc>
diff --git a/result/dtd8 b/result/dtd8
new file mode 100644
index 0000000..77ab642
--- /dev/null
+++ b/result/dtd8
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b) , (c | d))+>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc>
+  <b>This</b>
+  <c> is a valid document</c>
+</doc>
diff --git a/result/dtd9 b/result/dtd9
new file mode 100644
index 0000000..020ab72
--- /dev/null
+++ b/result/dtd9
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b | c) , d)?>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc>
+  <b>This</b>
+  <d> is a valid document</d>
+</doc>
diff --git a/result/ent2 b/result/ent2
index 670ce74..52e92f9 100644
--- a/result/ent2
+++ b/result/ent2
@@ -6,4 +6,6 @@
 ]>
 <EXAMPLE>
   &title;
-  This text is about XML, the &xml; and this is an embedded &image;</EXAMPLE>
+  This text is about XML, the &xml; and this is an embedded 
+  <IMG src="image"/>
+</EXAMPLE>
diff --git a/result/p3p b/result/p3p
index e69de29..b2ba102 100644
--- a/result/p3p
+++ b/result/p3p
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<RDF:RDF xmlns:RDF="http://www.w3.org/TR/WD-rdf-syntax#" p3p="http//www.w3.org/TR/1998/WD-P3P10-syntax#proposal.DTD">
+  <PROP realm="http://www.CoolCatalog.com/catalogue/" entity="CoolCatalog" agreeID="94df1293a3e519bb" assurance="http://www.TrustUs.org">
+    <USES>
+      <STATEMENT purp="2,3" recpnt="0" id="0" consq="a site with clothes you&apos;d appreciate.">
+        <WITH>
+          <PREFIX name="User.">
+            <REF name="Name.First"/>
+            <REF name="Bdate.Year" optional="1"/>
+            <REF name="Gender"/>
+          </PREFIX>
+        </WITH>
+      </STATEMENT>
+    </USES>
+    <USES>
+      <STATEMENT action="read&amp;write" purp="0" recpnt="0" id="1">
+        <REF name="User.Shipping."/>
+      </STATEMENT>
+    </USES>
+    <DISCLOSURE discURI="http://www.CoolCatalog.com/PrivacyPractice.html" access="3" other="0,1"/>
+  </PROP>
+</RDF:RDF>
diff --git a/result/svg1 b/result/svg1
new file mode 100644
index 0000000..6802e5c
--- /dev/null
+++ b/result/svg1
@@ -0,0 +1,161 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="242px" height="383px">
+  <g style="stroke: #000000"/>
+  <g style="fill: #f2cc99">
+    <polyline verts=" 69,18 82,8 99,3 118,5 135,12 149,21 156,13 165,9 177,13 183,28 180,50 164,91 155,107 154,114 151,121 141,127 139,136 155,206 157,251 126,342 133,357 128,376 83,376 75,368 67,350 61,350 53,369 4,369 2,361 5,354 12,342 16,321 4,257 4,244 7,218 9,179 26,127 43,93 32,77 30,70 24,67 16,49 17,35 18,23 30,12 40,7 53,7 62,12 69,18 69,18 69,18"/>
+  </g>
+  <g style="fill: #e5b27f">
+    <polyline verts=" 142,79 136,74 138,82 133,78 133,84 127,78 128,85 124,80 125,87 119,82 119,90 125,99 125,96 128,100 128,94 131,98 132,93 135,97 136,93 138,97 139,94 141,98 143,94 144,85 142,79 142,79 142,79"/>
+  </g>
+  <g style="fill: #eb8080">
+    <polyline verts=" 127,101 132,100 137,99 144,101 143,105 135,110 127,101 127,101 127,101"/>
+  </g>
+  <g style="fill: #f2cc99">
+    <polyline verts=" 178,229 157,248 139,296 126,349 137,356 158,357 183,342 212,332 235,288 235,261 228,252 212,250 188,251 178,229 178,229 178,229"/>
+  </g>
+  <g style="fill: #9c826b">
+    <polyline verts=" 56,229 48,241 48,250 57,281 63,325 71,338 81,315 76,321 79,311 83,301 75,308 80,298 73,303 76,296 71,298 74,292 69,293 74,284 78,278 71,278 74,274 68,273 70,268 66,267 68,261 60,266 62,259 65,253 57,258 59,251 55,254 55,248 60,237 54,240 58,234 54,236 56,229 56,229 56,229"/>
+    <polyline verts=" 74,363 79,368 81,368 85,362 89,363 92,370 96,373 101,372 108,361 110,371 113,373 116,371 120,358 122,363 123,371 126,371 129,367 132,357 135,361 130,376 127,377 94,378 84,376 76,371 74,363 74,363 74,363"/>
+    <polyline verts=" 212,250 219,251 228,258 236,270 235,287 225,304 205,332 177,343 171,352 158,357 166,352 168,346 168,339 165,333 155,327 155,323 161,320 165,316 169,316 167,312 171,313 168,308 173,309 170,306 177,306 175,308 177,311 174,311 176,316 171,315 174,319 168,320 168,323 175,327 179,332 183,326 184,332 189,323 190,328 194,320 194,325 199,316 201,320 204,313 206,316 208,310 211,305 219,298 226,288 229,279 228,266 224,259 217,253 212,250 212,250 212,250"/>
+    <polyline verts=" 151,205 151,238 149,252 141,268 128,282 121,301 130,300 126,313 118,324 116,337 120,346 133,352 133,340 137,333 145,329 156,327 153,319 153,291 157,271 170,259 178,277 193,250 174,216 151,205 151,205 151,205"/>
+    <polyline verts=" 78,127 90,142 95,155 108,164 125,167 139,175 150,206 152,191 141,140 121,148 100,136 78,127 78,127 78,127"/>
+    <polyline verts=" 21,58 35,63 38,68 32,69 42,74 40,79 47,80 54,83 45,94 34,81 32,73 24,66 21,58 21,58 21,58"/>
+    <polyline verts=" 71,34 67,34 66,27 59,24 54,17 48,17 39,22 30,26 28,31 31,39 38,46 29,45 36,54 41,61 41,70 50,69 54,71 55,58 67,52 76,43 76,39 68,44 71,34 71,34 71,34"/>
+    <polyline verts=" 139,74 141,83 143,89 144,104 148,104 155,106 154,86 157,77 155,72 150,77 144,77 139,74 139,74 139,74"/>
+    <polyline verts=" 105,44 102,53 108,58 111,62 112,55 105,44 105,44 105,44"/>
+    <polyline verts=" 141,48 141,54 144,58 139,62 137,66 136,59 137,52 141,48 141,48 141,48"/>
+    <polyline verts=" 98,135 104,130 105,134 108,132 108,135 112,134 113,137 116,136 116,139 119,139 124,141 128,140 133,138 140,133 139,140 126,146 104,144 98,135 98,135 98,135"/>
+    <polyline verts=" 97,116 103,119 103,116 111,118 116,117 122,114 127,107 135,111 142,107 141,114 145,118 149,121 145,125 140,124 127,121 113,125 100,124 97,116 97,116 97,116"/>
+    <polyline verts=" 147,33 152,35 157,34 153,31 160,31 156,28 161,28 159,24 163,25 163,21 165,22 170,23 167,17 172,21 174,18 175,23 176,22 177,28 177,33 174,37 176,39 174,44 171,49 168,53 164,57 159,68 156,70 154,60 150,51 146,43 144,35 147,33 147,33 147,33"/>
+    <polyline verts=" 85,72 89,74 93,75 100,76 105,75 102,79 94,79 88,76 85,72 85,72 85,72"/>
+    <polyline verts=" 86,214 79,221 76,232 82,225 78,239 82,234 78,245 81,243 79,255 84,250 84,267 87,254 90,271 90,257 95,271 93,256 95,249 92,252 93,243 89,253 89,241 86,250 87,236 83,245 87,231 82,231 90,219 84,221 86,214 86,214 86,214"/>
+  </g>
+  <g style="fill: #ffcc7f">
+    <polyline verts=" 93,68 96,72 100,73 106,72 108,66 105,63 100,62 93,68 93,68 93,68"/>
+    <polyline verts=" 144,64 142,68 142,73 146,74 150,73 154,64 149,62 144,64 144,64 144,64"/>
+  </g>
+  <g style="fill: #9c826b">
+    <polyline verts=" 57,91 42,111 52,105 41,117 53,112 46,120 53,116 50,124 57,119 55,127 61,122 60,130 67,126 66,134 71,129 72,136 77,130 76,137 80,133 82,138 86,135 96,135 94,129 86,124 83,117 77,123 79,117 73,120 75,112 68,116 71,111 65,114 69,107 63,110 68,102 61,107 66,98 61,103 63,97 57,99 57,91 57,91 57,91"/>
+    <polyline verts=" 83,79 76,79 67,82 75,83 65,88 76,87 65,92 76,91 68,96 77,95 70,99 80,98 72,104 80,102 76,108 85,103 92,101 87,98 93,96 86,94 91,93 85,91 93,89 99,89 105,93 107,85 102,82 92,80 83,79 83,79 83,79"/>
+    <polyline verts=" 109,77 111,83 109,89 113,94 117,90 117,81 114,78 109,77 109,77 109,77"/>
+    <polyline verts=" 122,128 127,126 134,127 136,129 134,130 130,128 124,129 122,128 122,128 122,128"/>
+    <polyline verts=" 78,27 82,32 80,33 82,36 78,37 82,40 78,42 81,46 76,47 78,49 74,50 82,52 87,50 83,48 91,46 86,45 91,42 88,40 92,37 86,34 90,31 86,29 89,26 78,27 78,27 78,27"/>
+    <polyline verts=" 82,17 92,20 79,21 90,25 81,25 94,28 93,26 101,30 101,26 107,33 108,28 111,40 113,34 115,45 117,39 119,54 121,46 124,58 126,47 129,59 130,49 134,58 133,44 137,48 133,37 137,40 133,32 126,20 135,26 132,19 138,23 135,17 142,18 132,11 116,6 94,6 78,11 92,12 80,14 90,16 82,17 82,17 82,17"/>
+    <polyline verts=" 142,234 132,227 124,223 115,220 110,225 118,224 127,229 135,236 122,234 115,237 113,242 121,238 139,243 121,245 111,254 95,254 102,244 104,235 110,229 100,231 104,224 113,216 122,215 132,217 141,224 145,230 149,240 142,234 142,234 142,234"/>
+    <polyline verts=" 115,252 125,248 137,249 143,258 134,255 125,254 115,252 115,252 115,252"/>
+    <polyline verts=" 114,212 130,213 140,219 147,225 144,214 137,209 128,207 114,212 114,212 114,212"/>
+    <polyline verts=" 102,263 108,258 117,257 131,258 116,260 109,265 102,263 102,263 102,263"/>
+    <polyline verts=" 51,241 35,224 40,238 23,224 31,242 19,239 28,247 17,246 25,250 37,254 39,263 44,271 47,294 48,317 51,328 60,351 60,323 53,262 47,246 51,241 51,241 51,241"/>
+    <polyline verts=" 2,364 9,367 14,366 18,355 20,364 26,366 31,357 35,364 39,364 42,357 47,363 53,360 59,357 54,369 7,373 2,364 2,364 2,364"/>
+    <polyline verts=" 7,349 19,345 25,339 18,341 23,333 28,326 23,326 27,320 23,316 25,311 20,298 15,277 12,264 9,249 10,223 3,248 5,261 15,307 17,326 11,343 7,349 7,349 7,349"/>
+    <polyline verts=" 11,226 15,231 25,236 18,227 11,226 11,226 11,226"/>
+    <polyline verts=" 13,214 19,217 32,227 23,214 16,208 15,190 24,148 31,121 24,137 14,170 8,189 13,214 13,214 13,214"/>
+    <polyline verts=" 202,254 195,258 199,260 193,263 197,263 190,268 196,268 191,273 188,282 200,272 194,272 201,266 197,265 204,262 200,258 204,256 202,254 202,254 202,254"/>
+  </g>
+  <g style="fill: #845433">
+    <polyline verts=" 151,213 165,212 179,225 189,246 187,262 179,275 176,263 177,247 171,233 163,230 165,251 157,264 146,298 145,321 133,326 143,285 154,260 153,240 151,213 151,213 151,213"/>
+    <polyline verts=" 91,132 95,145 97,154 104,148 107,155 109,150 111,158 115,152 118,159 120,153 125,161 126,155 133,164 132,154 137,163 137,152 142,163 147,186 152,192 148,167 141,143 124,145 105,143 91,132 91,132 91,132"/>
+  </g>
+  <g style="fill: #9c826b">
+    <polyline verts=" 31,57 23,52 26,51 20,44 23,42 21,36 22,29 25,23 24,32 30,43 26,41 30,50 26,48 31,57 31,57 31,57"/>
+    <polyline verts=" 147,21 149,28 155,21 161,16 167,14 175,15 173,11 161,9 147,21 147,21 147,21"/>
+    <polyline verts=" 181,39 175,51 169,57 171,65 165,68 165,75 160,76 162,91 171,71 180,51 181,39 181,39 181,39"/>
+    <polyline verts=" 132,346 139,348 141,346 142,341 147,342 143,355 133,350 132,346 132,346 132,346"/>
+    <polyline verts=" 146,355 151,352 155,348 157,343 160,349 151,356 147,357 146,355 146,355 146,355"/>
+    <polyline verts=" 99,266 100,281 94,305 86,322 78,332 72,346 73,331 91,291 99,266 99,266 99,266"/>
+    <polyline verts=" 20,347 32,342 45,340 54,345 45,350 42,353 38,350 31,353 29,356 23,350 19,353 15,349 20,347 20,347 20,347"/>
+    <polyline verts=" 78,344 86,344 92,349 88,358 84,352 78,344 78,344 78,344"/>
+    <polyline verts=" 93,347 104,344 117,345 124,354 121,357 116,351 112,351 108,355 102,351 93,347 93,347 93,347"/>
+  </g>
+  <g style="fill: #000000">
+    <polyline verts=" 105,12 111,18 113,24 113,29 119,34 116,23 112,16 105,12 105,12 105,12"/>
+    <polyline verts=" 122,27 125,34 127,43 128,34 125,29 122,27 122,27 122,27"/>
+    <polyline verts=" 115,13 122,19 122,15 113,10 115,13 115,13 115,13"/>
+  </g>
+  <g style="fill: #ffe5b2">
+    <polyline verts=" 116,172 107,182 98,193 98,183 90,199 89,189 84,207 88,206 87,215 95,206 93,219 91,230 98,216 97,226 104,214 112,209 104,208 113,202 126,200 139,207 132,198 142,203 134,192 142,195 134,187 140,185 130,181 136,177 126,177 125,171 116,180 116,172 116,172 116,172"/>
+    <polyline verts=" 74,220 67,230 67,221 59,235 63,233 60,248 70,232 65,249 71,243 67,256 73,250 69,262 73,259 71,267 76,262 72,271 78,270 76,275 82,274 78,290 86,279 86,289 92,274 88,275 87,264 82,270 82,258 77,257 78,247 73,246 77,233 72,236 74,220 74,220 74,220"/>
+    <polyline verts=" 133,230 147,242 148,250 145,254 138,247 129,246 142,245 138,241 128,237 137,238 133,230 133,230 133,230"/>
+    <polyline verts=" 133,261 125,261 116,263 111,267 125,265 133,261 133,261 133,261"/>
+    <polyline verts=" 121,271 109,273 103,279 99,305 92,316 85,327 83,335 89,340 97,341 94,336 101,336 96,331 103,330 97,327 108,325 99,322 109,321 100,318 110,317 105,314 110,312 107,310 113,308 105,306 114,303 105,301 115,298 107,295 115,294 108,293 117,291 109,289 117,286 109,286 118,283 112,281 118,279 114,278 119,276 115,274 121,271 121,271 121,271"/>
+    <polyline verts=" 79,364 74,359 74,353 76,347 80,351 83,356 82,360 79,364 79,364 79,364"/>
+    <polyline verts=" 91,363 93,356 97,353 103,355 105,360 103,366 99,371 94,368 91,363 91,363 91,363"/>
+    <polyline verts=" 110,355 114,353 118,357 117,363 113,369 111,362 110,355 110,355 110,355"/>
+    <polyline verts=" 126,354 123,358 124,367 126,369 129,361 129,357 126,354 126,354 126,354"/>
+    <polyline verts=" 30,154 24,166 20,182 23,194 29,208 37,218 41,210 41,223 46,214 46,227 52,216 52,227 61,216 59,225 68,213 73,219 70,207 77,212 69,200 77,202 70,194 78,197 68,187 76,182 64,182 58,175 58,185 53,177 50,186 46,171 44,182 39,167 36,172 36,162 30,166 30,154 30,154 30,154"/>
+    <polyline verts=" 44,130 41,137 45,136 43,150 48,142 48,157 53,150 52,164 60,156 61,169 64,165 66,175 70,167 74,176 77,168 80,183 85,172 90,182 93,174 98,181 99,173 104,175 105,169 114,168 102,163 95,157 94,166 90,154 87,162 82,149 75,159 72,148 68,155 67,143 62,148 62,138 58,145 56,133 52,142 52,128 49,134 47,125 44,130 44,130 44,130"/>
+    <polyline verts=" 13,216 19,219 36,231 22,223 16,222 22,227 12,224 13,220 16,220 13,216 13,216 13,216"/>
+    <polyline verts=" 10,231 14,236 25,239 27,237 19,234 10,231 10,231 10,231"/>
+    <polyline verts=" 9,245 14,242 25,245 13,245 9,245 9,245 9,245"/>
+    <polyline verts=" 33,255 26,253 18,254 25,256 18,258 27,260 18,263 27,265 19,267 29,270 21,272 29,276 21,278 30,281 22,283 31,287 24,288 32,292 23,293 34,298 26,299 37,303 32,305 39,309 33,309 39,314 34,314 40,318 34,317 40,321 34,321 41,326 33,326 40,330 33,332 39,333 33,337 42,337 54,341 49,337 52,335 47,330 50,330 45,325 49,325 45,321 48,321 45,316 46,306 45,286 43,274 36,261 33,255 33,255 33,255"/>
+    <polyline verts=" 7,358 9,351 14,351 17,359 11,364 7,358 7,358 7,358"/>
+    <polyline verts=" 44,354 49,351 52,355 49,361 44,354 44,354 44,354"/>
+    <polyline verts=" 32,357 37,353 40,358 36,361 32,357 32,357 32,357"/>
+    <polyline verts=" 139,334 145,330 154,330 158,334 154,341 152,348 145,350 149,340 147,336 141,339 139,345 136,342 136,339 139,334 139,334 139,334"/>
+    <polyline verts=" 208,259 215,259 212,255 220,259 224,263 225,274 224,283 220,292 208,300 206,308 203,304 199,315 197,309 195,318 193,313 190,322 190,316 185,325 182,318 180,325 172,321 178,320 176,313 186,312 180,307 188,307 184,303 191,302 186,299 195,294 187,290 197,288 192,286 201,283 194,280 203,277 198,275 207,271 200,269 209,265 204,265 212,262 208,259 208,259 208,259"/>
+    <polyline verts=" 106,126 106,131 109,132 111,134 115,132 115,135 119,133 118,137 123,137 128,137 133,134 136,130 136,127 132,124 118,128 112,128 106,126 106,126 106,126"/>
+    <polyline verts=" 107,114 101,110 98,102 105,97 111,98 119,102 121,108 118,112 113,115 107,114 107,114 107,114"/>
+    <polyline verts=" 148,106 145,110 146,116 150,118 152,111 151,107 148,106 148,106 148,106"/>
+    <polyline verts=" 80,55 70,52 75,58 63,57 72,61 57,61 67,66 57,67 62,69 54,71 61,73 54,77 63,78 53,85 60,84 56,90 69,84 63,82 75,76 70,75 77,72 72,71 78,69 72,66 81,67 78,64 82,63 80,60 86,62 80,55 80,55 80,55"/>
+    <polyline verts=" 87,56 91,52 96,50 102,56 98,56 92,60 87,56 87,56 87,56"/>
+    <polyline verts=" 85,68 89,73 98,76 106,74 96,73 91,70 85,68 85,68 85,68"/>
+    <polyline verts=" 115,57 114,64 111,64 115,75 122,81 122,74 126,79 126,74 131,78 130,72 133,77 131,68 126,61 119,57 115,57 115,57 115,57"/>
+    <polyline verts=" 145,48 143,53 147,59 151,59 150,55 145,48 145,48 145,48"/>
+    <polyline verts=" 26,22 34,15 43,10 52,10 59,16 47,15 32,22 26,22 26,22 26,22"/>
+    <polyline verts=" 160,19 152,26 149,34 154,33 152,30 157,30 155,26 158,27 157,23 161,23 160,19 160,19 160,19"/>
+  </g>
+  <g style="fill: #000000">
+    <polyline verts=" 98,117 105,122 109,122 105,117 113,120 121,120 130,112 128,108 123,103 123,99 128,101 132,106 135,109 142,105 142,101 145,101 145,91 148,101 145,105 136,112 135,116 143,124 148,120 150,122 142,128 133,122 121,125 112,126 103,125 100,129 96,124 98,117 98,117 98,117"/>
+    <polyline verts=" 146,118 152,118 152,115 149,115 146,118 146,118 146,118"/>
+    <polyline verts=" 148,112 154,111 154,109 149,109 148,112 148,112 148,112"/>
+    <polyline verts=" 106,112 108,115 114,116 118,114 106,112 106,112 106,112"/>
+    <polyline verts=" 108,108 111,110 116,110 119,108 108,108 108,108 108,108"/>
+    <polyline verts=" 106,104 109,105 117,106 115,104 106,104 106,104 106,104"/>
+    <polyline verts=" 50,25 41,26 34,33 39,43 49,58 36,51 47,68 55,69 54,59 61,57 74,46 60,52 67,42 57,48 61,40 54,45 60,36 59,29 48,38 52,30 47,32 50,25 50,25 50,25"/>
+    <polyline verts=" 147,34 152,41 155,49 161,53 157,47 164,47 158,43 168,44 159,40 164,37 169,37 164,33 169,34 165,28 170,30 170,25 173,29 175,27 176,32 173,36 175,39 172,42 172,46 168,49 170,55 162,57 158,63 155,58 153,50 149,46 147,34 147,34 147,34"/>
+    <polyline verts=" 155,71 159,80 157,93 157,102 155,108 150,101 149,93 154,101 152,91 151,83 155,79 155,71 155,71 155,71"/>
+    <polyline verts=" 112,78 115,81 114,91 112,87 113,82 112,78 112,78 112,78"/>
+    <polyline verts=" 78,28 64,17 58,11 47,9 36,10 28,16 21,26 18,41 20,51 23,61 33,65 28,68 37,74 36,81 43,87 48,90 43,100 40,98 39,90 31,80 30,72 22,71 17,61 14,46 16,28 23,17 33,9 45,6 54,6 65,12 78,28 78,28 78,28"/>
+    <polyline verts=" 67,18 76,9 87,5 101,2 118,3 135,8 149,20 149,26 144,19 132,12 121,9 105,7 89,8 76,14 70,20 67,18 67,18 67,18"/>
+    <polyline verts=" 56,98 48,106 56,103 47,112 56,110 52,115 57,113 52,121 62,115 58,123 65,119 63,125 69,121 68,127 74,125 74,129 79,128 83,132 94,135 93,129 85,127 81,122 76,126 75,121 71,124 71,117 66,121 66,117 62,117 64,112 60,113 60,110 57,111 61,105 57,107 60,101 55,102 56,98 56,98 56,98"/>
+    <polyline verts=" 101,132 103,138 106,134 106,139 112,136 111,142 115,139 114,143 119,142 125,145 131,142 135,138 140,134 140,129 143,135 145,149 150,171 149,184 145,165 141,150 136,147 132,151 131,149 126,152 125,150 121,152 117,148 111,152 110,148 105,149 104,145 98,150 96,138 94,132 94,130 98,132 101,132 101,132 101,132"/>
+    <polyline verts=" 41,94 32,110 23,132 12,163 6,190 7,217 5,236 3,247 9,230 12,211 12,185 18,160 26,134 35,110 43,99 41,94 41,94 41,94"/>
+    <polyline verts=" 32,246 41,250 50,257 52,267 53,295 53,323 59,350 54,363 51,365 44,366 42,360 40,372 54,372 59,366 62,353 71,352 75,335 73,330 66,318 68,302 64,294 67,288 63,286 63,279 59,275 58,267 56,262 50,247 42,235 44,246 32,236 35,244 32,246 32,246 32,246"/>
+    <polyline verts=" 134,324 146,320 159,322 173,327 179,337 179,349 172,355 158,357 170,350 174,343 170,333 163,328 152,326 134,329 134,324 134,324 134,324"/>
+    <polyline verts=" 173,339 183,334 184,338 191,329 194,332 199,323 202,325 206,318 209,320 213,309 221,303 228,296 232,289 234,279 233,269 230,262 225,256 219,253 208,252 198,252 210,249 223,250 232,257 237,265 238,277 238,291 232,305 221,323 218,335 212,342 200,349 178,348 173,339 173,339 173,339"/>
+    <polyline verts=" 165,296 158,301 156,310 156,323 162,324 159,318 162,308 162,304 165,296 165,296 165,296"/>
+    <polyline verts=" 99,252 105,244 107,234 115,228 121,228 131,235 122,233 113,235 109,246 121,239 133,243 121,243 110,251 99,252 99,252 99,252"/>
+    <polyline verts=" 117,252 124,247 134,249 136,253 126,252 117,252 117,252 117,252"/>
+    <polyline verts=" 117,218 132,224 144,233 140,225 132,219 117,218 117,218 117,218"/>
+    <polyline verts=" 122,212 134,214 143,221 141,213 132,210 122,212 122,212 122,212"/>
+    <polyline verts=" 69,352 70,363 76,373 86,378 97,379 108,379 120,377 128,378 132,373 135,361 133,358 132,366 127,375 121,374 121,362 119,367 117,374 110,376 110,362 107,357 106,371 104,375 97,376 90,375 90,368 86,362 83,364 86,369 85,373 78,370 73,362 71,351 69,352 69,352 69,352"/>
+    <polyline verts=" 100,360 96,363 99,369 102,364 100,360 100,360 100,360"/>
+    <polyline verts=" 115,360 112,363 114,369 117,364 115,360 115,360 115,360"/>
+    <polyline verts=" 127,362 125,364 126,369 128,365 127,362 127,362 127,362"/>
+    <polyline verts=" 5,255 7,276 11,304 15,320 13,334 6,348 2,353 0,363 5,372 12,374 25,372 38,372 44,369 42,367 36,368 31,369 30,360 27,368 20,370 16,361 15,368 10,369 3,366 3,359 6,352 11,348 17,331 19,316 12,291 9,274 5,255 5,255 5,255"/>
+    <polyline verts=" 10,358 7,362 10,366 11,362 10,358 10,358 10,358"/>
+    <polyline verts=" 25,357 22,360 24,366 27,360 25,357 25,357 25,357"/>
+    <polyline verts=" 37,357 34,361 36,365 38,361 37,357 37,357 37,357"/>
+    <polyline verts=" 49,356 46,359 47,364 50,360 49,356 49,356 49,356"/>
+    <polyline verts=" 130,101 132,102 135,101 139,102 143,103 142,101 137,100 133,100 130,101 130,101 130,101"/>
+    <polyline verts=" 106,48 105,52 108,56 109,52 106,48 106,48 106,48"/>
+    <polyline verts=" 139,52 139,56 140,60 142,58 141,56 139,52 139,52 139,52"/>
+    <polyline verts=" 25,349 29,351 30,355 33,350 37,348 42,351 45,347 49,345 44,343 36,345 25,349 25,349 25,349"/>
+    <polyline verts=" 98,347 105,351 107,354 109,349 115,349 120,353 118,349 113,346 104,346 98,347 98,347 98,347"/>
+    <polyline verts=" 83,348 87,352 87,357 89,351 87,348 83,348 83,348 83,348"/>
+    <polyline verts=" 155,107 163,107 170,107 186,108 175,109 155,109 155,107 155,107 155,107"/>
+    <polyline verts=" 153,114 162,113 175,112 192,114 173,114 154,115 153,114 153,114 153,114"/>
+    <polyline verts=" 152,118 164,120 180,123 197,129 169,123 151,120 152,118 152,118 152,118"/>
+    <polyline verts=" 68,109 87,106 107,106 106,108 88,108 68,109 68,109 68,109"/>
+    <polyline verts=" 105,111 95,112 79,114 71,116 85,115 102,113 105,111 105,111 105,111"/>
+    <polyline verts=" 108,101 98,99 87,99 78,99 93,100 105,102 108,101 108,101 108,101"/>
+    <polyline verts=" 85,63 91,63 97,60 104,60 108,62 111,69 112,75 110,74 108,71 103,73 106,69 105,65 103,64 103,67 102,70 99,70 97,66 94,67 97,72 88,67 84,66 85,63 85,63 85,63"/>
+    <polyline verts=" 140,74 141,66 144,61 150,61 156,62 153,70 150,73 152,65 150,65 151,68 149,71 146,71 144,66 143,70 143,74 140,74 140,74 140,74"/>
+    <polyline verts=" 146,20 156,11 163,9 172,9 178,14 182,18 184,32 182,42 182,52 177,58 176,67 171,76 165,90 157,105 160,92 164,85 168,78 167,73 173,66 172,62 175,59 174,55 177,53 180,46 181,29 179,21 173,13 166,11 159,13 153,18 148,23 146,20 146,20 146,20"/>
+    <polyline verts=" 150,187 148,211 150,233 153,247 148,267 135,283 125,299 136,292 131,313 122,328 122,345 129,352 133,359 133,367 137,359 148,356 140,350 131,347 129,340 132,332 140,328 137,322 140,304 154,265 157,244 155,223 161,220 175,229 186,247 185,260 176,275 178,287 185,277 188,261 196,253 189,236 174,213 150,187 150,187 150,187"/>
+    <polyline verts=" 147,338 142,341 143,345 141,354 147,343 147,338 147,338 147,338"/>
+    <polyline verts=" 157,342 156,349 150,356 157,353 163,346 162,342 157,342 157,342 157,342"/>
+    <polyline verts=" 99,265 96,284 92,299 73,339 73,333 87,300 99,265 99,265 99,265"/>
+  </g>
+</svg>
diff --git a/result/svg2 b/result/svg2
new file mode 100644
index 0000000..5e53829
--- /dev/null
+++ b/result/svg2
@@ -0,0 +1,54 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width="268px" height="207px">
+  <g style="stroke: #000000">
+    <path d=" M 29 28 "/>
+    <path d=" L 19 74 "/>
+  </g>
+  <g style="stroke: #800040">
+    <polyline verts=" 32,100 72,50 90,82 73,16 120,64 152,9 177,107"/>
+  </g>
+  <g style="stroke: #000000"/>
+  <g style="stroke: #0000ff">
+    <rect x="30" y="101" width="51" height="33"/>
+  </g>
+  <g style="fill: #0000ff">
+    <ellipse cx="182" cy="127" major="37" minor="31" angle="90"/>
+  </g>
+  <g style="fill: #ff0000">
+    <polyline verts=" 78,180 76,151 131,149 136,182 135,182 134,183 127,185 117,186 109,192 104,194 98,199 96,200 95,201 94,202 92,202 85,202 70,200 54,199 47,198 46,197 45,197 37,195 26,193 17,187 9,181 8,181 7,176 6,175 6,173 6,172 6,170 8,164 8,163 8,162 9,162 10,162 11,162 13,162 20,162 26,162 27,162 28,162 30,162 30,163 31,163 32,164 34,166 35,166 36,167 36,168 37,169 38,169 39,169 41,170 43,170 45,170 47,170 49,170 50,168 50,161 50,160 50,159 47,162 78,180"/>
+    <g>
+      <desc> Java Font definition:Dialog 0</desc>
+    </g>
+    <g>
+      <desc> Java Font definition:Helvetica 0</desc>
+    </g>
+  </g>
+  <g style="stroke: #000000">
+    <text x="188" y="36">this is text</text>
+  </g>
+  <g style="stroke: #000000">
+    <g>
+      <desc> Java Font definition:Dialog 0</desc>
+    </g>
+    <g>
+      <desc> Java Font definition:Helvetica 700</desc>
+    </g>
+  </g>
+  <g style="stroke: #008080">
+    <text x="176" y="85">sadfsadfsad</text>
+  </g>
+  <g style="stroke: #000000"/>
+  <g style="fill: #800040">
+    <ellipse cx="208" cy="180" major="45" minor="31" angle="0"/>
+  </g>
+  <g style="stroke: #000000"/>
+  <g style="fill: #ffffff">
+    <g>
+      <desc> Java Font definition:Dialog 700</desc>
+    </g>
+    <g>
+      <desc> Java Font definition:Dialog 700</desc>
+    </g>
+  </g>
+</svg>
diff --git a/result/xml1 b/result/xml1
new file mode 100644
index 0000000..d32f56c
--- /dev/null
+++ b/result/xml1
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE test [
+<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
+ numerically (&#38;#38;#38;) or with a general entity
+  (&amp;amp;).</p>">
+]>
+<test>&example;</test>
diff --git a/result/xml2 b/result/xml2
new file mode 100644
index 0000000..89abac1
--- /dev/null
+++ b/result/xml2
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE test [
+<!ENTITY % xx "&#37;zz;">
+<!ENTITY % zz '&#60;!ENTITY tricky "error-prone" >'>
+<!ENTITY tricky "error-prone">
+<!ELEMENT test (#PCDATA)>
+]>
+<test>This sample shows a &tricky; method.</test>
diff --git a/test/SVG/4rects.xml b/test/SVG/4rects.xml
new file mode 100755
index 0000000..b8d1a65
--- /dev/null
+++ b/test/SVG/4rects.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Four separate rectangles

+  </desc>

+    <rect width="20" height="60"/>

+    <rect width="30" height="70"/>

+    <rect width="40" height="80"/>

+    <rect width="50" height="90"/>

+</svg>

diff --git a/test/SVG/a-valid.xml b/test/SVG/a-valid.xml
new file mode 100755
index 0000000..233b78c
--- /dev/null
+++ b/test/SVG/a-valid.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This valid svg document draws a triangle which is a hyperlink

+  </desc>

+  <a href="http://www.w3.org">

+    <p d="M 0 0 L 200 0 L 100 200 Z"/>

+  </a>

+</svg>

diff --git a/test/SVG/a-wf.xml b/test/SVG/a-wf.xml
new file mode 100755
index 0000000..756e9c6
--- /dev/null
+++ b/test/SVG/a-wf.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <desc>This well formed svg document draws a triangle which is a hyperlink

+  </desc>

+  <a xml:link="simple" show="replace" actuate="user" href="http://www.w3.org">

+    <p d="M 0 0 L 200 0 L 100 200 Z"/>

+  </a>

+</svg>

diff --git a/test/SVG/bike.xml b/test/SVG/bike.xml
new file mode 100755
index 0000000..796b996
--- /dev/null
+++ b/test/SVG/bike.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<!--DOCTYPE svg SYSTEM "svg-19990412.dtd"-->

+<svg width="4in" height="3in">

+  <title>Kona Lavadome mountain bike

+  </title>

+  <desc>This picture shows a mountain bike, a human-propelled, 

+  multi-terrain vehicle. While it can be succesfully used on moorland, 

+  forest, roads, and large hills it is not actually suitable for going 

+  up mountains.

+  </desc>

+  <g id="bike">

+    <defs>

+     <symbol id="spoke"><desc>14/12 gauge double butted spoke</desc>

+     <!-- the path data goes here --></symbol>

+     

+     <symbol id="hub"><desc>black anodised low torsion hub</desc>

+     <!--the path data goes here --></symbol>

+     

+     <symbol id="rim"><desc>twin wall, eyeletted rim</desc>

+     <!-- the path data goes here--></symbol>

+     

+     <symbol id="cogs"><desc>8 speed, wide ratio gearing</desc>

+     <!--the path data goes here --></symbol>

+     

+     <symbol id="lacing"><desc>double cross lacing of 32 spokes</desc>

+     </symbol>

+    </defs>

+    <!-- the overall bike drawing goes here -->

+    <g id="frontwheel">

+    <title>Front wheel</title>

+    <desc>The front wheel provides grip, steering and some shock absorption</desc>

+    <use href="id(lacing)" style="rotation: 20deg; fillcolor: black"/>

+    </g>

+    <g id="backwheel">

+    </g>

+    <g id="frame"><!-- and so on -->

+    </g>

+  </g>

+</svg>

diff --git a/test/SVG/circle.xml b/test/SVG/circle.xml
new file mode 100755
index 0000000..44e70e7
--- /dev/null
+++ b/test/SVG/circle.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This is a blue circle with a red outline

+  </desc>

+  <g>

+    <circle style="fill: blue; stroke: red" 

+      cx="200" cy="200" r="100"/>

+  </g>

+</svg>

diff --git a/test/SVG/defs.xml b/test/SVG/defs.xml
new file mode 100755
index 0000000..0bf5f27
--- /dev/null
+++ b/test/SVG/defs.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <rect id="TemplateObject01" width="100" height="37.34"/>

+    <lineargradient id="Gradient01">

+      <gradientstop offset="30%" color="#39F"/>

+    </lineargradient>

+  </defs>

+  <desc>Defining things for later use

+  </desc>

+  <!-- SVG elements in here would reference/use 

+       the elements defined in the <defs> -->

+</svg>

diff --git a/test/SVG/desc.xml b/test/SVG/desc.xml
new file mode 100755
index 0000000..87838db
--- /dev/null
+++ b/test/SVG/desc.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg SYSTEM "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+<g>

+  <title>

+    Company sales by region

+  </title>

+  <desc>

+    This is a bar chart which shows 

+    company sales by region.

+  </desc>

+  <!-- Bar chart defined as vector data -->

+</g>

+</svg>

diff --git a/test/SVG/ellipse.xml b/test/SVG/ellipse.xml
new file mode 100755
index 0000000..2097ef5
--- /dev/null
+++ b/test/SVG/ellipse.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This is an ellipse, axis aligned and centered on the origin

+  </desc>

+  <g>

+    <ellipse major="85" minor="45"/>

+  </g>

+</svg>

diff --git a/test/SVG/flower2.xml b/test/SVG/flower2.xml
new file mode 100755
index 0000000..10064c9
--- /dev/null
+++ b/test/SVG/flower2.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="800px" height="800px">

+  <desc>This sample SVG file draws a flower</desc>

+  <g style="transform: matrix(1 0 0 -1 -25.88 798.60);

+     stroke: #000; stroke-width: 1" >

+   <path style="fill: #1A5466" d = "m 242.33 684.19

+          C 346.44 757.48 271.45 647.38 213.17 641.37

+          C 271.45 647.38 383.43 575.21 256.71 613.30

+          C 383.43 575.21 251.04 565.90 205.23 609.68

+          C 251.04 565.90 265.13 432.88 210.71 557.95

+          C 265.13 432.88 175.04 531.37 175.67 596.26

+          C 175.04 531.37 80.63  437.67 138.96 559.82

+          C  80.63 437.67 100.67 569.80 146.75 611.20

+          C 100.67 569.80 -31.14 585.98 95.49  617.49

+          C -31.14 585.98 83.94  652.25 140.24 643.26

+          C 83.94  652.25 13.98  766.12 113.04 687.55

+          C 13.98  766.12 137.45 716.63 161.05 668.30

+          C 137.45 716.63 182.02 842.45 178.39 717.23

+          C 182.02 842.45 220.90 714.46 193.51 667.46

+          C 220.90 714.46 346.44 757.48 242.33 684.19 z" />

+   <path style="fill: #34AACD" d = "M 235.33 691.19

+          C 339.44 764.48 264.45 654.38 206.17 648.37

+          C 264.45 654.38 376.43 582.21 249.71 620.30

+          C 376.43 582.21 244.04 572.90 198.23 616.68

+          C 244.04 572.90 258.13 439.88 203.71 564.95

+          C 258.13 439.88 168.04 538.37 168.67 603.26

+          C 168.04 538.37 73.63  444.67 131.96 566.82

+          C 73.63  444.67 93.67  576.80 139.75 618.20

+          C 93.67  576.80 -38.14 592.98  88.49 624.49

+          C -38.14 592.98 76.94  659.25 133.24 650.26

+          C 76.94  659.25 6.98   773.12 106.04 694.55

+          C 6.98   773.12 130.45 723.63 154.05 675.30

+          C 130.45 723.63 175.02 849.45 171.39 724.23

+          C 175.02 849.45 213.90 721.46 186.51 674.46

+          C 213.90 721.46 339.44 764.48 235.33 691.19 z" />

+   <path style="fill: #F881BF" d = "M 199.44 634.43

+          C 199.44 622.16 189.19 612.21 176.54 612.21

+          C 163.89 612.21 153.63 622.16 153.63 634.43

+          C 153.63 646.71 163.89 656.66 176.54 656.66

+          C 189.19 656.66 199.44 646.71 199.44 634.43 z"/>

+  </g>

+</svg>

diff --git a/test/SVG/gradient.xml b/test/SVG/gradient.xml
new file mode 100755
index 0000000..328d5e8
--- /dev/null
+++ b/test/SVG/gradient.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Gradient example

+  </desc>

+  <g>

+    <defs>

+      <lineargradient id="MyGradient">

+        <!-- Define linear gradient here -->

+        <gradientstop offset="0%" color="#F60"/>

+        <gradientstop offset="70%" color="#FF6"/>

+      </lineargradient>

+    </defs>

+    <rect style="fill: url(#MyGradient)" width="20" height="15.8"/>

+  </g>

+</svg>

diff --git a/test/SVG/group01.xml b/test/SVG/group01.xml
new file mode 100755
index 0000000..906a220
--- /dev/null
+++ b/test/SVG/group01.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Two groups, each of two rectangles

+  </desc>

+  <g style="fillcolor:red">

+    <rect x="100" y="100" width="100" height="100" />

+    <rect x="300" y="100" width="100" height="100" />

+  </g>

+  <g style="fillcolor:blue">

+    <rect x="100" y="300" width="100" height="100" />

+    <rect x="300" y="300" width="100" height="100" />

+  </g>

+</svg>

diff --git a/test/SVG/group02.xml b/test/SVG/group02.xml
new file mode 100755
index 0000000..082474a
--- /dev/null
+++ b/test/SVG/group02.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Two named groups

+  </desc>

+  <g id="OBJECT1">

+    <rect x="100" y="100" width="100" height="100" />

+  </g>

+  <g id="OBJECT2">

+    <circle cx="150" cy="300" r="25" />

+  </g>

+</svg>

diff --git a/test/SVG/group03.xml b/test/SVG/group03.xml
new file mode 100755
index 0000000..ad25e93
--- /dev/null
+++ b/test/SVG/group03.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Groups can nest

+  </desc>

+  <g>

+     <g>

+       <g>

+       </g>

+     </g>

+   </g>

+</svg>

diff --git a/test/SVG/image-valid.xml b/test/SVG/image-valid.xml
new file mode 100755
index 0000000..320e8d2
--- /dev/null
+++ b/test/SVG/image-valid.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This graphic links to an external image

+  </desc>

+  <image x="200" y="200" style="width: 100px; height: 100px" 

+  href="myimage.png">

+    <title>My image</title>

+  </image>

+</svg>

diff --git a/test/SVG/image-wf.xml b/test/SVG/image-wf.xml
new file mode 100755
index 0000000..6d13b33
--- /dev/null
+++ b/test/SVG/image-wf.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns='http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <desc>This links to an external image

+  </desc>

+  <image x="200" y="200" style="width: 100px; height: 100px"

+   xml:link = 'simple' show = 'embed' actuate = 'auto'

+  href="myimage.png">

+    <title>My image</title>

+  </image>

+</svg>

diff --git a/test/SVG/lin-gradient.xml b/test/SVG/lin-gradient.xml
new file mode 100755
index 0000000..8ace2b4
--- /dev/null
+++ b/test/SVG/lin-gradient.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Linear gradient example

+  </desc>

+  <g>

+    <defs>

+      <lineargradient id="MyGradient">

+        <gradientstop offset="0%" color="#F60"/>

+        <gradientstop offset="70%" color="#FF6"/>

+      </lineargradient>

+    </defs>

+    <rect style="fill: url(#MyGradient)" width="20" height="15.8"/>

+  </g>

+</svg>

diff --git a/test/SVG/marker.xml b/test/SVG/marker.xml
new file mode 100755
index 0000000..62716a2
--- /dev/null
+++ b/test/SVG/marker.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <symbol id="Triangle" min-x="0" min-y="0" max-x="100" 

+      max-y="100" ref-x="0" ref-y="50">

+      <path d="M 0 0 L 0 100 L 100 50 z"/>

+     </symbol>

+   </defs>

+  <desc>An double-headed arrow example using markers

+  </desc>

+  <path d="M0 0">

+    <!-- Place an arrowhead rotated 180 degrees at the 

+         beginning of the path -->

+    <marker href="#Triangle" width="200" height="200" 

+          style="text-transform: rotate(180)"/>

+    <data d="M 2000 2000"/>

+

+    <!-- Turn off markers in the middle of the path -->

+    <marker href=""/>

+    <data d="L 4000 2000 L 4000 4000"/>

+

+    <!-- Place an arrowhead at the end of the path-->

+    <marker href="#Triangle" width="200" height="200"/>

+    <data d="L 6000 4000"/>

+  </path>

+</svg>

diff --git a/test/SVG/mask.xml b/test/SVG/mask.xml
new file mode 100755
index 0000000..f81aca1
--- /dev/null
+++ b/test/SVG/mask.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Example of using a mask

+  </desc>

+  <g>

+    <defs>

+      <image id="MyMask" href="transp.png"></image>

+    </defs>

+    <rect style="mask: url(#MyMask)" width="12.5" height="30" />

+  </g>

+</svg>

diff --git a/test/SVG/mathswitch.xml b/test/SVG/mathswitch.xml
new file mode 100755
index 0000000..4d28f33
--- /dev/null
+++ b/test/SVG/mathswitch.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <desc>This example uses the switch element to provide a 

+  fallback graphical representation of an equation, if 

+  MathML is not supported.

+  </desc>

+  <!-- The <switch> element will process the first child element

+       whose testing attributes evaluate to true.-->

+  <switch>

+

+    <!-- Process the MathML if the system-required attribute

+         evaluates to true (i.e., the user agent supports MathML

+         embedded within SVG). -->

+    <foreignobject 

+       system-required="http://www.w3.org/TR/REC-MathML-19980407" 

+       width="100" height="50">

+      <!-- MathML content goes here -->

+    </foreignobject>

+

+    <!-- Else, process the following alternate SVG.

+         Note that there are no testing attributes on the <g> element.

+         If no testing attributes are provided, it is as if there

+         were testing attributes and they evaluated to true.-->

+    <g>

+      <!-- Draw a red rectangle with a text string on top. -->

+      <rect style="fill: red"/>

+      <text>Formula goes here</text>

+    </g>

+

+  </switch>

+</svg>

diff --git a/test/SVG/parentns.xml b/test/SVG/parentns.xml
new file mode 100755
index 0000000..ba410e1
--- /dev/null
+++ b/test/SVG/parentns.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>

+<ABC xmlns="http://parent.name.space"

+     xmlns:svg="http://www.w3.org/Graphics/SVG/1.0">

+  <!-- document in the parent namespace -->

+  <svg:svg width="40%" height="40%">

+     <svg:rectangle width="43.6" height="31.5"/>

+     <!-- svg graphic continues -->

+   </svg:svg>

+   <!-- document in parent namespace continues -->

+</ABC>

+

+

diff --git a/test/SVG/path01.xml b/test/SVG/path01.xml
new file mode 100755
index 0000000..4590b6c
--- /dev/null
+++ b/test/SVG/path01.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+<path d="M 100 100 L 140 100 L 120 140 z"/>

+</svg>

diff --git a/test/SVG/path02.xml b/test/SVG/path02.xml
new file mode 100755
index 0000000..a91aa61
--- /dev/null
+++ b/test/SVG/path02.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <path d="M 100 100">

+    <data d="L 140 100"/>

+    <data d="L 120 140"/>

+    <data d="z"/>

+  </path>

+</svg>

diff --git a/test/SVG/patternfill.xml b/test/SVG/patternfill.xml
new file mode 100755
index 0000000..292f4f7
--- /dev/null
+++ b/test/SVG/patternfill.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <symbol id="fourstar">

+      <!-- Define the pattern using standard graphics elements

+           such as paths, images, text and shapes -->

+    </symbol>

+  </defs>

+  <ellipse style="fill: url(#fourstar)" major="40" minor="27" />

+</svg>

diff --git a/test/SVG/polyline.xml b/test/SVG/polyline.xml
new file mode 100755
index 0000000..e6f7b62
--- /dev/null
+++ b/test/SVG/polyline.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>A sample polyline, and equivalent path

+  </desc>

+  <polyline verts="20,20 50,100 200,80 70,300"/>

+  <path d="M20,20 L50,100 L200,80 L70,300"/>

+</svg>

diff --git a/test/SVG/private.xml b/test/SVG/private.xml
new file mode 100755
index 0000000..3601365
--- /dev/null
+++ b/test/SVG/private.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <defs>

+    <private xmlns:myapp="http://mycompany/mapapp" >

+      <myapp:piechart title="Sales by Region">

+        <myapp:piece label="Northern Region" value="1.23"/>

+        <myapp:piece label="Eastern Region" value="2.53"/>

+        <myapp:piece label="Southern Region" value="3.89"/>

+        <myapp:piece label="Western Region" value="2.04"/>

+        <!-- Other private data goes here -->

+      </myapp:piechart>

+    </private>

+  </defs>

+    <desc>This chart includes private data in another namespace

+  </desc>

+  <!-- In here would be the actual graphics elements which

+       draw the pie chart -->

+</svg>

diff --git a/test/SVG/rad-gradient.xml b/test/SVG/rad-gradient.xml
new file mode 100755
index 0000000..9ad7683
--- /dev/null
+++ b/test/SVG/rad-gradient.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Radial gradient example with three gradient stops

+  </desc>

+  <g>

+    <defs>

+      <radialgradient id="MyGradient">

+         <gradientstop offset="0%" color="white"/>

+         <gradientstop offset="50%" color="red"/>

+         <gradientstop offset="100%" color="black"/>

+      </radialgradient>

+    </defs>

+    <circle style="fill: url(#MyGradient)" r="42"/>

+  </g>

+</svg>

diff --git a/test/SVG/rectangle.xml b/test/SVG/rectangle.xml
new file mode 100755
index 0000000..e6cdeea
--- /dev/null
+++ b/test/SVG/rectangle.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This is a rectangle

+  </desc>

+  <g>

+    <rect x="20" y="30" width="100" height="80"/>

+  </g>

+</svg>

diff --git a/test/SVG/richdesc.xml b/test/SVG/richdesc.xml
new file mode 100755
index 0000000..ccf8c8d
--- /dev/null
+++ b/test/SVG/richdesc.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in" 

+ xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+   <desc xmlns:mydoc="http://foo.org/mydoc">

+      <mydoc:title>This is an example SVG file</mydoc:title>

+      <mydoc:para>The global description uses markup from the 

+        <mydoc:emph>mydoc</mydoc:emph> namespace.</mydoc:para>

+   </desc>

+   <g>

+   <!-- the picture goes here -->

+   </g>

+</svg>

diff --git a/test/SVG/script.xml b/test/SVG/script.xml
new file mode 100755
index 0000000..600365e
--- /dev/null
+++ b/test/SVG/script.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <script><![CDATA[

+      /* Beep on mouseclick */

+      MouseClickHandler() { beep(); }

+     ]]>

+    </script>

+  </defs>

+  <circle onclick="MouseClickHandler()" r="85"/>

+</svg>

diff --git a/test/SVG/structure01.xml b/test/SVG/structure01.xml
new file mode 100755
index 0000000..dec9143
--- /dev/null
+++ b/test/SVG/structure01.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="yes"?>

+<parent xmlns="http://someplace.org"

+       xmlns:svg="http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+   <!-- parent stuff here -->

+   <svg:svg width="5cm" height="8cm">

+      <svg:ellipse major="200" minor="130" />

+   </svg:svg>

+   <!-- ... -->

+</parent>

+

diff --git a/test/SVG/style.xml b/test/SVG/style.xml
new file mode 100755
index 0000000..ba15041
--- /dev/null
+++ b/test/SVG/style.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <style><![CDATA[

+      .TitleText { font-size: 16; font-family: Helvetica } ]]>

+    </style>

+  </defs>

+  <text class="TitleText">Here is my title</text>

+</svg>

diff --git a/test/SVG/switch.xml b/test/SVG/switch.xml
new file mode 100755
index 0000000..18955c9
--- /dev/null
+++ b/test/SVG/switch.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" standalone="yes"?>

+<smil>

+  <body>

+    <!-- The SMIL <switch> element will process the

+         first child element which tests true and skip

+         past all others. -->

+    <switch>

+

+      <!-- The system-required attribute tests to see if

+           the user agent supports SVG. If true, then

+           render the file drawing.svg. -->

+      <ref system-required="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" 

+           type="image/svg" src="drawing.svg" />

+

+      <!-- Else, render the alternate image. -->

+      <img src="alternate_image.jpg" />

+    </switch>

+  </body>

+</smil>

+

+

diff --git a/test/SVG/symbol-use.xml b/test/SVG/symbol-use.xml
new file mode 100755
index 0000000..83bc458
--- /dev/null
+++ b/test/SVG/symbol-use.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <symbol id="TemplateObject01">

+      <!-- symbol definition here -->

+    </symbol>

+  </defs>

+

+  <desc>Examples of inline and referenced content

+  </desc>

+  

+  <!-- <g> with inline content -->

+  <g>

+    <!-- Inline content goes here -->

+  </g>

+

+  <!-- referenced content -->

+  <use href="#TemplateObject01" />

+

+  <!-- <g> with both referenced and inline content -->

+  <g>

+    <use href="#TemplateObject01" />

+    <!-- Inline content goes here -->

+  </g>

+

+</svg>

diff --git a/test/SVG/template.xml b/test/SVG/template.xml
new file mode 100755
index 0000000..0a9fee7
--- /dev/null
+++ b/test/SVG/template.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <desc>This well formed svg document contains a hyperlink

+  </desc>

+  <a xml:link="simple" show="replace" actuate="user" href="http://www.w3.org">

+    <p d="M 0 0 L 200 0 L 100 200 Z"/>

+  </a>

+</svg>

diff --git a/test/SVG/text01.xml b/test/SVG/text01.xml
new file mode 100755
index 0000000..395bafb
--- /dev/null
+++ b/test/SVG/text01.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <text id="TextToUse">XYZ</text>

+  </defs>

+  <text>ABC</text>

+  <text>

+    <src href="#TextToUse"/>

+  </text>

+</svg>

diff --git a/test/SVG/text02.xml b/test/SVG/text02.xml
new file mode 100755
index 0000000..7b95292
--- /dev/null
+++ b/test/SVG/text02.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <defs>

+    <textflow id="TF1">

+      <t href="#T1"/>

+      <t href="#T3"/>

+    </textflow>

+    <textflow id="TF2">

+      <t href="#T2"/>

+      <t href="#T4"/>

+    </textflow>

+  </defs>

+  <text x="100" y="100" id="T1"><tf href="#TF1">123</tf></text>

+  <text x="100" y="200" id="T2"><tf href="#TF2">ABC</tf></text>

+  <text x="150" y="100" id="T3"><tf href="#TF1">456</tf></text>

+  <text x="150" y="200" id="T4"><tf href="#TF2">DEF</tf></text></svg>

diff --git a/test/SVG/text03.xml b/test/SVG/text03.xml
new file mode 100755
index 0000000..fae9af1
--- /dev/null
+++ b/test/SVG/text03.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <textflow id="TF1">

+    <text x="100" y="100">123</text>

+    <text>456</text>

+  </textflow>

+</svg>

diff --git a/test/SVG/toap01.xml b/test/SVG/toap01.xml
new file mode 100755
index 0000000..32e16e6
--- /dev/null
+++ b/test/SVG/toap01.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Simple text on a path

+  </desc>

+  <path id="MyPath" style="visibility: hidden"

+        d="M 100 100 C 125 125 175 125 200 100" />

+  <text><textpath href="#MyPath"/>Text on path</text>

+</svg>

diff --git a/test/SVG/toap02.xml b/test/SVG/toap02.xml
new file mode 100755
index 0000000..6898093
--- /dev/null
+++ b/test/SVG/toap02.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <defs>

+    <symbol id="Triangle1" 

+       min-x="0" min-y="0" max-x="300" max-y="200">

+      <path d="M 50 0 L  50 200 L 250 0 z"/>

+    </symbol>

+    <symbol id="Triangle2" 

+         min-x="0" min-y="0" max-x="300" max-y="200">

+      <path d="M 50 0 L 250 200 L 250 0 z"/>

+    </symbol>

+  </defs>

+  

+  <desc>General graphics on a path

+  </desc>

+  

+  <text>

+    <textpath href="#MyPath"/>

+    <use href="#Triangle1"/>

+    <use href="#Triangle2"/>

+    <use href="#Triangle1"/>

+    <use href="#Triangle2"/>

+    <use href="#Triangle1"/>

+    <use href="#Triangle2"/>

+    <use href="#Triangle1"/>

+    <use href="#Triangle2"/>

+    <use href="#Triangle1"/>

+    <use href="#Triangle2"/>

+  </text>

+

+</svg>

diff --git a/test/SVG/transform.xml b/test/SVG/transform.xml
new file mode 100755
index 0000000..13075ee
--- /dev/null
+++ b/test/SVG/transform.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Demonstration of coordinate transforms

+  </desc>

+  <!-- The following two text elements will both draw with a 

+        font height of 12 pixels -->

+   <text style="font-size: 12">This prints 12 pixels high.</text>

+   <text style="font-size: 12px">This prints 12 pixels high.</text>

+

+   <!-- Now scale the coordinate system by 2. -->

+   <g style="transform: scale(2)">

+

+      <!-- The following text will actually draw 24 pixels high

+           because each unit in the new coordinate system equals

+           2 units in the previous coordinate system. -->

+      <text style="font-size: 12">This prints 24 pixels high.</text>

+

+      <!-- The following text will actually still draw 12 pixels high

+           because the CSS unit specifier has been provided. -->

+      <text style="font-size: 12px">This prints 12 pixels high.</text>

+

+   </g>

+

+</svg>

diff --git a/test/SVG/trivial.xml b/test/SVG/trivial.xml
new file mode 100755
index 0000000..b6122be
--- /dev/null
+++ b/test/SVG/trivial.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+ <!-- Insert drawing elements here -->

+</svg>

+

diff --git a/test/SVG/twin-gradients.xml b/test/SVG/twin-gradients.xml
new file mode 100755
index 0000000..6213f1b
--- /dev/null
+++ b/test/SVG/twin-gradients.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>Gradients apply to leaf nodes

+  </desc>

+  <g>

+    <defs>

+      <lineargradient id="MyGradient">

+        <gradientstop offset="0%" color="#F60"/>

+        <gradientstop offset="70%" color="#FF6"/>

+      </lineargradient>

+    </defs>

+    <g style="fill: url(#MyGradient)">

+      <rect width="20" height="15.8"/>

+      <rect width="35" height="8"/>

+   </g>

+  </g>

+</svg>

diff --git a/test/SVG/v-template.xml b/test/SVG/v-template.xml
new file mode 100755
index 0000000..d8643d7
--- /dev/null
+++ b/test/SVG/v-template.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>

+  </desc>

+  <g>

+  </g>

+</svg>

diff --git a/test/SVG/viewport-nest.xml b/test/SVG/viewport-nest.xml
new file mode 100755
index 0000000..981a7ac
--- /dev/null
+++ b/test/SVG/viewport-nest.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="4in" height="3in">

+  <desc>This SVG drawing embeds another one,

+    thus establishing a new viewport

+  </desc>

+  <!-- The following statement establishing a new viewport

+       and renders SVG drawing B into that viewport -->

+  <svg style="left: 25%; top: 25%" width="50%" height="50%">

+     <!-- drawing B goes here -->

+  </svg>

+</svg>

diff --git a/test/SVG/viewport-transform.xml b/test/SVG/viewport-transform.xml
new file mode 100755
index 0000000..e2434bd
--- /dev/null
+++ b/test/SVG/viewport-transform.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 

+  "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">

+<svg width="300px" height="3oopx">

+  <desc>Transformation with establishment of a new viewport

+  </desc>

+  <!-- The following two text elements will both draw with a 

+        font height of 12 pixels -->

+   <text style="font-size: 12">This prints 12 pixels high.</text>

+   <text style="font-size: 12px">This prints 12 pixels high.</text>

+

+   <!-- Now scale the coordinate system by 2. -->

+   <g style="transform: scale(2)">

+

+      <!-- The following text will actually draw 24 pixels high

+           because each unit in the new coordinate system equals

+           2 units in the previous coordinate system. -->

+      <text style="font-size: 12">This prints 24 pixels high.</text>

+

+      <!-- The following text will actually still draw 12 pixels high

+           because the CSS unit specifier has been provided. -->

+      <text style="font-size: 12px">This prints 12 pixels high.</text>

+   </g>

+

+   <!-- This time, scale the coordinate system by 3. -->

+   <g style="transform: scale(3)">

+

+      <!-- Establish a new viewport and thus change the meaning of

+           some CSS unit specifiers. -->

+      <svg style="left:0; top:0; right:100; bottom:100" 

+           width="100%" height="100%">

+

+         <!-- The following two text elements will both draw with a 

+              font height of 36 screen pixels. The first text element

+              defines its height in user coordinates, which have been

+              scaled by 3. The second text element defines its height

+              in CSS px units, which have been redefined to be three times

+              as big as screen pixels due the <svg> element establishing

+              a new viewport. -->

+         <text style="font-size: 12">This prints 36 pixels high.</text>

+         <text style="font-size: 12px">This prints 36 pixels high.</text>

+

+      </svg>

+   </g>

+

+</svg>

diff --git a/test/SVG/viewport.xml b/test/SVG/viewport.xml
new file mode 100755
index 0000000..0923fae
--- /dev/null
+++ b/test/SVG/viewport.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="yes"?>

+<parent xmlns="http://some.url">

+   

+   <!-- SVG graphic -->

+   <svg xmlns='http://www.w3.org/Graphics/SVG/svg-19990412.dtd'

+      width="100px" height="200px">

+      <path d="M100,100 Q200,400,300,100"/>

+      <!-- rest of SVG graphic would go here -->

+   </svg>   

+   

+</parent>

diff --git a/test/SVG/wf-template.xml b/test/SVG/wf-template.xml
new file mode 100755
index 0000000..f1cad85
--- /dev/null
+++ b/test/SVG/wf-template.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="yes"?>

+<svg width="4in" height="3in"

+ xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>

+  <desc>

+  </desc>

+

+</svg>

diff --git a/test/dav1 b/test/dav1
index 6a6474c..cbfd4c4 100644
--- a/test/dav1
+++ b/test/dav1
@@ -1,24 +1,25 @@
-<?XML version="1.0"?>
-<?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?>
-<?namespace href = "http://www.foo.bar/boxschema" AS = "R"?>
-<D:multistatus>
- <D:response>
-      <D:prop>
-	   <R:bigbox>
-		<R:BoxType>Box type A</R:BoxType>
-	   </R:bigbox>
-	   <R:author>
-		<R:Name>J.J. Dingleheimerschmidt</R:Name>
-	   </R:author>
-      </D:prop>
-      <D:status>HTTP/1.1 200 OK</D:status>
- </D:response>
- <D:response>
-      <D:prop><R:DingALing/><R:Random/></D:prop>
-      <D:status>HTTP/1.1 403 Forbidden</D:status>
-      <D:responsedescription> The user does not have access to the DingALing property.
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/" xmlns:R="http://www.foo.bar/boxschema">
+  <D:response>
+    <D:prop>
+      <R:bigbox>
+        <R:BoxType>Box type A</R:BoxType>
+      </R:bigbox>
+      <R:author>
+        <R:Name>J.J. Dingleheimerschmidt</R:Name>
+      </R:author>
+    </D:prop>
+    <D:status>HTTP/1.1 200 OK</D:status>
+  </D:response>
+  <D:response>
+    <D:prop>
+      <R:DingALing/>
+      <R:Random/>
+    </D:prop>
+    <D:status>HTTP/1.1 403 Forbidden</D:status>
+    <D:responsedescription> The user does not have access to the DingALing property.
       </D:responsedescription>
- </D:response>
- <D:responsedescription> There has been an access violation error.
+  </D:response>
+  <D:responsedescription> There has been an access violation error.
  </D:responsedescription>
 </D:multistatus>
diff --git a/test/dav10 b/test/dav10
index 536112c..4b00da4 100644
--- a/test/dav10
+++ b/test/dav10
@@ -1,5 +1,4 @@
-<?XML version="1.0"?>
-<?namespace href="http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:owner>
+<?xml version="1.0"?>
+<D:owner xmlns:D="http://www.ietf.org/standards/dav/">
   <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href>
 </D:owner>
diff --git a/test/dav11 b/test/dav11
index 16ee59a..8ac23d6 100644
--- a/test/dav11
+++ b/test/dav11
@@ -1,22 +1,21 @@
-<?XML version="1.0"?>
-<?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:prop>
- <D:lockdiscovery>
-      <D:activelock>
-	   <D:locktype>write</D:locktype>
-	   <D:lockscope>exclusive</D:lockscope>
-	   <D:addlocks/>
-	   <D:owner>
-		<D:href>
+<?xml version="1.0"?>
+<D:prop xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:lockdiscovery>
+    <D:activelock>
+      <D:locktype>write</D:locktype>
+      <D:lockscope>exclusive</D:lockscope>
+      <D:addlocks/>
+      <D:owner>
+        <D:href>
 		http://www.ics.uci.edu/~ejw/contact.html
 		</D:href>
-	   </D:owner>
-	   <D:timeout>Second-604800</D:timeout>
-	   <D:locktoken>
-		<D:href>
+      </D:owner>
+      <D:timeout>Second-604800</D:timeout>
+      <D:locktoken>
+        <D:href>
 	   opaquelocktoken:xyz122393481230912asdfa09s8df09s7df
 		</D:href>
-	   </D:locktoken>
-      </D:activelock>
- </D:lockdiscovery>
+      </D:locktoken>
+    </D:activelock>
+  </D:lockdiscovery>
 </D:prop>
diff --git a/test/dav12 b/test/dav12
index 87ac0bf..d8d03fe 100644
--- a/test/dav12
+++ b/test/dav12
@@ -1,3 +1,2 @@
-<?XML version="1.0"?>
-<?namespace href="http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href>
+<?xml version="1.0"?>
+<D:href xmlns:D="http://www.ietf.org/standards/dav/">http://www.ics.uci.edu/~ejw/contact.html</D:href>
diff --git a/test/dav13 b/test/dav13
index ccb786d..f44ae38 100644
--- a/test/dav13
+++ b/test/dav13
@@ -1,17 +1,16 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:multistatus>
- <D:response>
-      <D:href>
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:response>
+    <D:href>
 	   http://webdav.sb.aol.com/workspace/webdav/proposal.doc
       </D:href>
-      <D:href>
+    <D:href>
 	   http://webdav.sb.aol.com/workspace/webdav/
       </D:href>
-      <D:status>HTTP/1.1 202 Accepted</D:status>
- </D:response>
- <D:response>
-      <D:href>http://foo.bar/blah</D:href>
-      <D:status>HTTP/1.1 403 Forbidden</D:status>
- </D:response>
+    <D:status>HTTP/1.1 202 Accepted</D:status>
+  </D:response>
+  <D:response>
+    <D:href>http://foo.bar/blah</D:href>
+    <D:status>HTTP/1.1 403 Forbidden</D:status>
+  </D:response>
 </D:multistatus>
diff --git a/test/dav15 b/test/dav15
index 603d6af..b80802e 100644
--- a/test/dav15
+++ b/test/dav15
@@ -1,22 +1,20 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<?namespace href = "http://www.foocorp.com/Project/" AS = "F"?>
-<D:prop>
- <D:Source>
-      <D:link>
-	   <F:projfiles>Source</F:projfiles>
-	   <D:src>http://foo.bar/program</D:src>
-	   <D:dst>http://foo.bar/src/main.c</D:dst>
-      </D:link>
-      <D:link>
-	   <F:projfiles>Library</F:projfiles>
-	   <D:src>http://foo.bar/program</D:src>
-	   <D:dst>http://foo.bar/src/main.lib</D:dst>
-      </D:link>
-      <D:link>
-	   <F:projfiles>Makefile</F:projfiles>
-	   <D:src>http://foo.bar/program</D:src>
-	   <D:dst>http://foo.bar/src/makefile</D:dst>
-      </D:link>
- </D:Source>
+<?xml version="1.0"?>
+<D:prop xmlns:D="http://www.ietf.org/standards/dav/" xmlns:F="http://www.foocorp.com/Project/">
+  <D:Source>
+    <D:link>
+      <F:projfiles>Source</F:projfiles>
+      <D:src>http://foo.bar/program</D:src>
+      <D:dst>http://foo.bar/src/main.c</D:dst>
+    </D:link>
+    <D:link>
+      <F:projfiles>Library</F:projfiles>
+      <D:src>http://foo.bar/program</D:src>
+      <D:dst>http://foo.bar/src/main.lib</D:dst>
+    </D:link>
+    <D:link>
+      <F:projfiles>Makefile</F:projfiles>
+      <D:src>http://foo.bar/program</D:src>
+      <D:dst>http://foo.bar/src/makefile</D:dst>
+    </D:link>
+  </D:Source>
 </D:prop>
diff --git a/test/dav16 b/test/dav16
index f9bb41d..9a7dc36 100644
--- a/test/dav16
+++ b/test/dav16
@@ -1,5 +1,6 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:propfind>
- <D:prop><lockdiscovery/></D:prop>
+<?xml version="1.0"?>
+<D:propfind xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:prop>
+    <lockdiscovery/>
+  </D:prop>
 </D:propfind>
diff --git a/test/dav17 b/test/dav17
index 1d1eabe..1137662 100644
--- a/test/dav17
+++ b/test/dav17
@@ -1,23 +1,22 @@
-<?XML version="1.0"?>
-<?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:multistatus>
- <D:response>
-      <D:prop>
-	   <D:lockdiscovery>
-		<D:activelock>
-		     <D:locktype>write</D:locktype>
-		     <D:lockscope>exclusive</D:lockscope>
-		     <D:addlocks>
-			  <D:href>http://foo.com/doc/</D:href>
-		     </D:addlocks>
-		     <D:owner>Jane Smith</D:owner>
-		     <D:timeout>Infinite</D:timeout>
-		     <D:locktoken>
-			  <D:href>iamuri:unique!!!!!</D:href>
-		     </D:locktoken>
-		</D:activelock>
-	   </D:lockdiscovery>
-      </D:prop>
-      <D:status>HTTP/1.1 200 OK</D:status>
- </D:response>
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:response>
+    <D:prop>
+      <D:lockdiscovery>
+        <D:activelock>
+          <D:locktype>write</D:locktype>
+          <D:lockscope>exclusive</D:lockscope>
+          <D:addlocks>
+            <D:href>http://foo.com/doc/</D:href>
+          </D:addlocks>
+          <D:owner>Jane Smith</D:owner>
+          <D:timeout>Infinite</D:timeout>
+          <D:locktoken>
+            <D:href>iamuri:unique!!!!!</D:href>
+          </D:locktoken>
+        </D:activelock>
+      </D:lockdiscovery>
+    </D:prop>
+    <D:status>HTTP/1.1 200 OK</D:status>
+  </D:response>
 </D:multistatus>
diff --git a/test/dav18 b/test/dav18
index 0582163..3de1c19 100644
--- a/test/dav18
+++ b/test/dav18
@@ -1,5 +1,6 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:propfind>
- <D:prop><supportedlock/></D:prop>
+<?xml version="1.0"?>
+<D:propfind xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:prop>
+    <supportedlock/>
+  </D:prop>
 </D:propfind>
diff --git a/test/dav19 b/test/dav19
index 3adf64e..9535ffc 100644
--- a/test/dav19
+++ b/test/dav19
@@ -1,19 +1,18 @@
-<?XML version="1.0"?>
-<?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:multistatus>
- <D:response>
-      <D:prop>
-	   <D:supportedlock>
-		<D:LockEntry>
-		     <D:locktype>Write</D:locktype>
-		     <D:lockscope>Exclusive</D:lockscope>
-		</D:LockEntry>
-		<D:LockEntry>
-		     <D:locktype>Write</D:locktype>
-		     <D:lockscope>Shared</D:lockscope>
-		</D:LockEntry>
-	   </D:supportedlock>
-      </D:prop>
-      <D:status>HTTP/1.1 200 OK</D:status>
- </D:response>
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:response>
+    <D:prop>
+      <D:supportedlock>
+        <D:LockEntry>
+          <D:locktype>Write</D:locktype>
+          <D:lockscope>Exclusive</D:lockscope>
+        </D:LockEntry>
+        <D:LockEntry>
+          <D:locktype>Write</D:locktype>
+          <D:lockscope>Shared</D:lockscope>
+        </D:LockEntry>
+      </D:supportedlock>
+    </D:prop>
+    <D:status>HTTP/1.1 200 OK</D:status>
+  </D:response>
 </D:multistatus>
diff --git a/test/dav2 b/test/dav2
index 1942805..f831b4b 100644
--- a/test/dav2
+++ b/test/dav2
@@ -1,26 +1,24 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "S"?>
-<?namespace href = "http://www.foo.bar/boxschema/" AS = "R"?>
-<S:multistatus>
- <S:response>
-      <S:href>http://www.foo.bar/container/</S:href>
-      <S:prop>
-	   <R:bigbox>
-		<R:BoxType>Box type A</R:BoxType>
-	   </R:bigbox>
-	   <R:author>
-		<R:Name>Hadrian</R:Name>
-	   </R:author>
-      </S:prop>
-      <S:status>HTTP 1.1 200 OK</S:status>
- </S:response>
- <S:response>
-      <S:href>http://www.foo.bar/container/index.html</S:href>
-      <S:prop>
-	   <R:bigbox>
-		<R:BoxType>Box type B</R:BoxType>
-	   </R:bigbox>
-      </S:prop>
-      <S:status>HTTP 1.1 200 OK</S:status>
- </S:response>
+<?xml version="1.0"?>
+<S:multistatus xmlns:S="http://www.ietf.org/standards/dav/" xmlns:R="http://www.foo.bar/boxschema/">
+  <S:response>
+    <S:href>http://www.foo.bar/container/</S:href>
+    <S:prop>
+      <R:bigbox>
+        <R:BoxType>Box type A</R:BoxType>
+      </R:bigbox>
+      <R:author>
+        <R:Name>Hadrian</R:Name>
+      </R:author>
+    </S:prop>
+    <S:status>HTTP 1.1 200 OK</S:status>
+  </S:response>
+  <S:response>
+    <S:href>http://www.foo.bar/container/index.html</S:href>
+    <S:prop>
+      <R:bigbox>
+        <R:BoxType>Box type B</R:BoxType>
+      </R:bigbox>
+    </S:prop>
+    <S:status>HTTP 1.1 200 OK</S:status>
+  </S:response>
 </S:multistatus>
diff --git a/test/dav3 b/test/dav3
index 5602e7d..986b3fe 100644
--- a/test/dav3
+++ b/test/dav3
@@ -1,20 +1,18 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<?namespace href = "http://www.foo.bar/boxschema/" AS = "R"?>
-<D:multistatus>
- <D:response>
-      <D:href>http://www.foo.bar/container/</D:href>
-      <D:prop>
-	   <R:bigbox/>
-	   <R:author/>
-      </D:prop>
-      <D:status>HTTP 1.1 200 OK</D:status>
- </D:response>
- <D:response>
-      <D:href>http://www.foo.bar/container/index.html</D:href>
-      <D:prop>
-	   <R:bigbox/>
-      </D:prop>
-      <D:status>HTTP 1.1 200 OK</D:status>
- </D:response>
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/" xmlns:R="http://www.foo.bar/boxschema/">
+  <D:response>
+    <D:href>http://www.foo.bar/container/</D:href>
+    <D:prop>
+      <R:bigbox/>
+      <R:author/>
+    </D:prop>
+    <D:status>HTTP 1.1 200 OK</D:status>
+  </D:response>
+  <D:response>
+    <D:href>http://www.foo.bar/container/index.html</D:href>
+    <D:prop>
+      <R:bigbox/>
+    </D:prop>
+    <D:status>HTTP 1.1 200 OK</D:status>
+  </D:response>
 </D:multistatus>
diff --git a/test/dav4 b/test/dav4
index efca282..9ab7ceb 100644
--- a/test/dav4
+++ b/test/dav4
@@ -1,16 +1,16 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<?namespace href = "http://www.w3.com/standards/z39.50/" AS = "Z"?>
-<D:propertyupdate>
- <D:set>
-      <D:prop>
-	   <Z:authors>
-		<Z:Author>Jim Whitehead</Z:Author>
-		<Z:Author>Roy Fielding</Z:Author>
-	   </Z:authors>
-      </D:prop>
- </D:set>
- <D:remove>
-      <D:prop><Z:Copyright-Owner/></D:prop>
- </D:remove>
+<?xml version="1.0"?>
+<D:propertyupdate xmlns:D="http://www.ietf.org/standards/dav/" xmlns:Z="http://www.w3.com/standards/z39.50/">
+  <D:set>
+    <D:prop>
+      <Z:authors>
+        <Z:Author>Jim Whitehead</Z:Author>
+        <Z:Author>Roy Fielding</Z:Author>
+      </Z:authors>
+    </D:prop>
+  </D:set>
+  <D:remove>
+    <D:prop>
+      <Z:Copyright-Owner/>
+    </D:prop>
+  </D:remove>
 </D:propertyupdate>
diff --git a/test/dav5 b/test/dav5
index 8c13b4b..68ebab9 100644
--- a/test/dav5
+++ b/test/dav5
@@ -1,15 +1,17 @@
-<?XML version="1.0"?>
-<?namespace href="http://www.ietf.org/standards/dav/" AS = "D"?>
-<?namespace href="http://www.w3.com/standards/z39.50/" AS = "Z"?>
-<D:multistatus>
- <D:response>
-      <D:prop><Z:Authors/></D:prop>
-      <D:status>HTTP/1.1 420 Method Failure</D:status>
- </D:response>
- <D:response>
-      <D:prop><Z:Copyright-Owner/></D:prop>
-      <D:status>HTTP/1.1 409 Conflict</D:status>
- </D:response>
- <D:responsedescription> Copyright Owner can not be deleted or
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/" xmlns:Z="http://www.w3.com/standards/z39.50/">
+  <D:response>
+    <D:prop>
+      <Z:Authors/>
+    </D:prop>
+    <D:status>HTTP/1.1 420 Method Failure</D:status>
+  </D:response>
+  <D:response>
+    <D:prop>
+      <Z:Copyright-Owner/>
+    </D:prop>
+    <D:status>HTTP/1.1 409 Conflict</D:status>
+  </D:response>
+  <D:responsedescription> Copyright Owner can not be deleted or
 altered.</D:responsedescription>
 </D:multistatus>
diff --git a/test/dav6 b/test/dav6
index 045b4d4..3d0de24 100644
--- a/test/dav6
+++ b/test/dav6
@@ -1,23 +1,22 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?>
-<D:multistatus>
- <D:response>
-      <D:href>http://www.microsoft.com/user/yarong/dav_drafts/
+<?xml version="1.0"?>
+<D:multistatus xmlns:D="http://www.ietf.org/standards/dav/">
+  <D:response>
+    <D:href>http://www.microsoft.com/user/yarong/dav_drafts/
       </D:href>
-      <D:prop>
-	   <D:resourcetype>
-		<D:collection/>
-	   </D:resourcetype>
-      </D:prop>
-      <D:status>HTTP 1.1 200 OK</D:status>
- </D:response>
- <D:response>
-      <D:href>
+    <D:prop>
+      <D:resourcetype>
+        <D:collection/>
+      </D:resourcetype>
+    </D:prop>
+    <D:status>HTTP 1.1 200 OK</D:status>
+  </D:response>
+  <D:response>
+    <D:href>
       http://www.microsoft.com/user/yarong/dav_drafts/base
       </D:href>
-      <D:prop>
-	   <D:resourcetype/>
-      </D:prop>
-      <D:status>HTTP 1.1 200 OK</D:status>
- </D:response>
+    <D:prop>
+      <D:resourcetype/>
+    </D:prop>
+    <D:status>HTTP 1.1 200 OK</D:status>
+  </D:response>
 </D:multistatus>
diff --git a/test/dav7 b/test/dav7
index e8f6ba3..ec4a952 100644
--- a/test/dav7
+++ b/test/dav7
@@ -1,17 +1,16 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "d"?>
-<d:multistatus>
- <d:response>
-      <d:href>http://www.foo.bar/container/resource1</d:href>
-      <d:href>http://www.foo.bar/container/resource2</d:href>
-      <d:status>HTTP/1.1 200 OK</d:status>
- </d:response>
- <d:response>
-      <d:href>http://www.foo.bar/container/</d:href>
-      <d:status>HTTP/1.1 420 Method Failure</d:status>
- </d:response>
- <d:response>
-      <d:href>http://www.foo.bar/container/resource3</d:href>
-      <d:status>HTTP/1.1 412 Precondition Failed</d:status>
- </d:response>
+<?xml version="1.0"?>
+<d:multistatus xmlns:d="http://www.ietf.org/standards/dav/">
+  <d:response>
+    <d:href>http://www.foo.bar/container/resource1</d:href>
+    <d:href>http://www.foo.bar/container/resource2</d:href>
+    <d:status>HTTP/1.1 200 OK</d:status>
+  </d:response>
+  <d:response>
+    <d:href>http://www.foo.bar/container/</d:href>
+    <d:status>HTTP/1.1 420 Method Failure</d:status>
+  </d:response>
+  <d:response>
+    <d:href>http://www.foo.bar/container/resource3</d:href>
+    <d:status>HTTP/1.1 412 Precondition Failed</d:status>
+  </d:response>
 </d:multistatus>
diff --git a/test/dav8 b/test/dav8
index 03691f2..7f99baf 100644
--- a/test/dav8
+++ b/test/dav8
@@ -1,15 +1,14 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "d"?>
-<d:multistatus>
- <d:response>
-      <d:href>http://www.foo.bar/othercontainer/resource1</d:href>
-      <d:href>http://www.foo.bar/othercontainer/resource2</d:href>
-      <d:href>http://www.foo.bar/othercontainer/</d:href>
-      <d:href>http://www.foo.bar/othercontainer/R2/D2</d:href>
-      <d:status>HTTP/1.1 201 Created</d:status>
- </d:response>
- <d:response>
-      <d:href>http://www.foo.bar/othercontainer/R2/</d:href>
-      <d:status>HTTP/1.1 412 Precondition Failed</d:status>
- </d:response>
+<?xml version="1.0"?>
+<d:multistatus xmlns:d="http://www.ietf.org/standards/dav/">
+  <d:response>
+    <d:href>http://www.foo.bar/othercontainer/resource1</d:href>
+    <d:href>http://www.foo.bar/othercontainer/resource2</d:href>
+    <d:href>http://www.foo.bar/othercontainer/</d:href>
+    <d:href>http://www.foo.bar/othercontainer/R2/D2</d:href>
+    <d:status>HTTP/1.1 201 Created</d:status>
+  </d:response>
+  <d:response>
+    <d:href>http://www.foo.bar/othercontainer/R2/</d:href>
+    <d:status>HTTP/1.1 412 Precondition Failed</d:status>
+  </d:response>
 </d:multistatus>
diff --git a/test/dav9 b/test/dav9
index 233db8b..8ed63b8 100644
--- a/test/dav9
+++ b/test/dav9
@@ -1,19 +1,18 @@
-<?XML version="1.0"?>
-<?namespace href = "http://www.ietf.org/standards/dav/" AS = "d"?>
-<d:multistatus>
- <d:response>
-      <d:href>http://www.foo.bar/container/resource1</d:href>
-      <d:href>http://www.foo.bar/container/resource2</d:href>
-      <d:href>http://www.foo.bar/container/</d:href>
-      <d:href>http://www.foo.bar/container/C2/R2</d:href>
-      <d:status>HTTP/1.1 201 Created</d:status>
- </d:response>
- <d:response>
-      <d:href>http://www.foo.bar/container/C2</d:href>
-      <d:status>HTTP/1.1 420 Method Failure</d:status>
- </d:response>
- <d:response>
-      <d:href>http://www.foo.bar/othercontainer/C2</d:href>
-      <d:status>HTTP/1.1 409 Conflict</d:status>
- </d:response>
+<?xml version="1.0"?>
+<d:multistatus xmlns:d="http://www.ietf.org/standards/dav/">
+  <d:response>
+    <d:href>http://www.foo.bar/container/resource1</d:href>
+    <d:href>http://www.foo.bar/container/resource2</d:href>
+    <d:href>http://www.foo.bar/container/</d:href>
+    <d:href>http://www.foo.bar/container/C2/R2</d:href>
+    <d:status>HTTP/1.1 201 Created</d:status>
+  </d:response>
+  <d:response>
+    <d:href>http://www.foo.bar/container/C2</d:href>
+    <d:status>HTTP/1.1 420 Method Failure</d:status>
+  </d:response>
+  <d:response>
+    <d:href>http://www.foo.bar/othercontainer/C2</d:href>
+    <d:status>HTTP/1.1 409 Conflict</d:status>
+  </d:response>
 </d:multistatus>
diff --git a/test/dia1 b/test/dia1
new file mode 100644
index 0000000..207bd73
--- /dev/null
+++ b/test/dia1
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+  <dia:diagramdata>
+    <dia:attribute name="background">
+      <dia:color val="#ffffff"/>
+    </dia:attribute>
+  </dia:diagramdata>
+  <dia:layer name="Background" visible="true">
+    <dia:object type="Standard - Line" version="0" id="O0">
+      <dia:attribute name="obj_pos">
+        <dia:point val="1.95,6.85"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="1.9,6.8;11,8.55"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="1.95,6.85"/>
+        <dia:point val="10.95,8.5"/>
+      </dia:attribute>
+      <dia:attribute name="line_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="start_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="1" to="O2" connection="3"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O1">
+      <dia:attribute name="obj_pos">
+        <dia:point val="4.8,4.75"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string val="sdfsdfg"/>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="1"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="4.8,4.75"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Box" version="0" id="O2">
+      <dia:attribute name="obj_pos">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.9,7.45;13.05,9.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="2.05"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+    </dia:object>
+  </dia:layer>
+</dia:diagram>
diff --git a/test/dia2 b/test/dia2
new file mode 100644
index 0000000..207bd73
--- /dev/null
+++ b/test/dia2
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+  <dia:diagramdata>
+    <dia:attribute name="background">
+      <dia:color val="#ffffff"/>
+    </dia:attribute>
+  </dia:diagramdata>
+  <dia:layer name="Background" visible="true">
+    <dia:object type="Standard - Line" version="0" id="O0">
+      <dia:attribute name="obj_pos">
+        <dia:point val="1.95,6.85"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="1.9,6.8;11,8.55"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="1.95,6.85"/>
+        <dia:point val="10.95,8.5"/>
+      </dia:attribute>
+      <dia:attribute name="line_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="start_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="0"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="1" to="O2" connection="3"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O1">
+      <dia:attribute name="obj_pos">
+        <dia:point val="4.8,4.75"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="2.579,3.96359;7.021,4.96359"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string val="sdfsdfg"/>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="1"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="4.8,4.75"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Box" version="0" id="O2">
+      <dia:attribute name="obj_pos">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.9,7.45;13.05,9.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="10.95,7.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="2.05"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.1"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+      </dia:attribute>
+    </dia:object>
+  </dia:layer>
+</dia:diagram>
diff --git a/test/dtd10 b/test/dtd10
new file mode 100644
index 0000000..f5e49e7
--- /dev/null
+++ b/test/dtd10
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b)+ , c ,  d)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc><b>This</b><c> is a</c><d> valid document</d></doc>
diff --git a/test/dtd11 b/test/dtd11
new file mode 100644
index 0000000..b32675f
--- /dev/null
+++ b/test/dtd11
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc val CDATA #IMPLIED>
+]>
+<doc val="v1"></doc>
diff --git a/test/dtd2 b/test/dtd2
new file mode 100644
index 0000000..3bcc101
--- /dev/null
+++ b/test/dtd2
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>This is a valid document !</doc>
diff --git a/test/dtd3 b/test/dtd3
new file mode 100644
index 0000000..63f44a5
--- /dev/null
+++ b/test/dtd3
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ANY>
+]>
+<doc>This is a valid document !</doc>
+
diff --git a/test/dtd4 b/test/dtd4
new file mode 100644
index 0000000..5457b91
--- /dev/null
+++ b/test/dtd4
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc EMPTY>]>
+<doc/>
diff --git a/test/dtd5 b/test/dtd5
new file mode 100644
index 0000000..a33889b
--- /dev/null
+++ b/test/dtd5
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA | a | b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc><a>This</a> is a <b>valid</b> document</doc>
diff --git a/test/dtd6 b/test/dtd6
new file mode 100644
index 0000000..35e63fc
--- /dev/null
+++ b/test/dtd6
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a | b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc><a>This</a><b> is a valid</b><a> document</a></doc>
diff --git a/test/dtd7 b/test/dtd7
new file mode 100644
index 0000000..b151c21
--- /dev/null
+++ b/test/dtd7
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a , b)*>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+]>
+<doc><a>This</a><b> is a valid document</b></doc>
diff --git a/test/dtd8 b/test/dtd8
new file mode 100644
index 0000000..ce7a291
--- /dev/null
+++ b/test/dtd8
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b) , (c | d))+>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc><b>This</b><c> is a valid document</c></doc>
diff --git a/test/dtd9 b/test/dtd9
new file mode 100644
index 0000000..144b8c5
--- /dev/null
+++ b/test/dtd9
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b | c) , d)?>
+<!ELEMENT a (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT d (#PCDATA)>
+]>
+<doc><b>This</b><d> is a valid document</d></doc>
diff --git a/test/ent2 b/test/ent2
index 533f5a3..155e2d2 100644
--- a/test/ent2
+++ b/test/ent2
@@ -6,6 +6,6 @@
 ]>
 <EXAMPLE>
   &title;
-  This text is about XML, the &xml; and this is an embedded &image;
+  This text is about XML, the &xml; and this is an embedded <IMG src="image"/>
 </EXAMPLE>
 
diff --git a/test/p3p b/test/p3p
index d21325e..1e5fd07 100644
--- a/test/p3p
+++ b/test/p3p
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
-<?xml:namespace ns="http//www.w3.org/TR/1998/WD-P3P10-syntax#proposal.DTD" prefix="p3p"?>
-<?xml:namespace ns="http://www.w3.org/TR/WD-rdf-syntax#" prefix="RDF"?>
-<RDF:RDF><PROP realm="http://www.CoolCatalog.com/catalogue/" 
+<RDF:RDF xmlsn:p3p="http//www.w3.org/TR/1998/WD-P3P10-syntax#proposal.DTD"
+         xmlns:RDF="http://www.w3.org/TR/WD-rdf-syntax#">
+<PROP realm="http://www.CoolCatalog.com/catalogue/" 
  entity="CoolCatalog" agreeID="94df1293a3e519bb"
  assurance="http://www.TrustUs.org">
   <USES>
@@ -15,7 +15,7 @@
   </STATEMENT>
   </USES>
   <USES>
-  <STATEMENT action="read&write" purp="0" recpnt="0" id="1">
+  <STATEMENT action="read&amp;write" purp="0" recpnt="0" id="1">
     <REF name="User.Shipping."/>
   </STATEMENT>
   </USES>
diff --git a/test/rdf1 b/test/rdf1
index ea6763e..d44c3c6 100644
--- a/test/rdf1
+++ b/test/rdf1
@@ -1,8 +1,6 @@
-<?XML version="1.0"?>
-<?namespace href="http://www.rpm.org/" AS="RPM"?>
-<?namespace href="http://www.w3.org/TR/WD-rdf-syntax#" AS="RDF"?>
-<RDF:RDF>
-  <RDF:Description RDF:HREF="ftp://rufus.w3.org/linux/redhat/redhat-5.1/i386/RedHat/RPMS/rpm-2.5-2.i386.rpm">
+<?xml version="1.0"?>
+<RDF:RDF xmlns:RPM="http://www.rpm.org/" xmlns:RDF="http://www.w3.org/TR/WD-rdf-syntax#">
+  <RDF:Description HREF="ftp://rufus.w3.org/linux/redhat/redhat-5.1/i386/RedHat/RPMS/rpm-2.5-2.i386.rpm">
     <RPM:Name>rpm</RPM:Name>
     <RPM:Version>2.5</RPM:Version>
     <RPM:Release>2</RPM:Release>
diff --git a/test/svg1 b/test/svg1
new file mode 100644
index 0000000..53bf38f
--- /dev/null
+++ b/test/svg1
@@ -0,0 +1,163 @@
+<?xml version = "1.0" standalone = "yes"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN"
+ "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width = "242px" height="383px">
+<g style = "stroke: #000000" > 
+</g> 
+<g style = "fill: #f2cc99" > 
+   <polyline verts = " 69,18 82,8 99,3 118,5 135,12 149,21 156,13 165,9 177,13 183,28 180,50 164,91 155,107 154,114 151,121 141,127 139,136 155,206 157,251 126,342 133,357 128,376 83,376 75,368 67,350 61,350 53,369 4,369 2,361 5,354 12,342 16,321 4,257 4,244 7,218 9,179 26,127 43,93 32,77 30,70 24,67 16,49 17,35 18,23 30,12 40,7 53,7 62,12 69,18 69,18 69,18"/> 
+</g> 
+<g style = "fill: #e5b27f" > 
+   <polyline verts = " 142,79 136,74 138,82 133,78 133,84 127,78 128,85 124,80 125,87 119,82 119,90 125,99 125,96 128,100 128,94 131,98 132,93 135,97 136,93 138,97 139,94 141,98 143,94 144,85 142,79 142,79 142,79"/> 
+</g> 
+<g style = "fill: #eb8080" > 
+   <polyline verts = " 127,101 132,100 137,99 144,101 143,105 135,110 127,101 127,101 127,101"/> 
+</g> 
+<g style = "fill: #f2cc99" > 
+   <polyline verts = " 178,229 157,248 139,296 126,349 137,356 158,357 183,342 212,332 235,288 235,261 228,252 212,250 188,251 178,229 178,229 178,229"/> 
+</g> 
+<g style = "fill: #9c826b" > 
+   <polyline verts = " 56,229 48,241 48,250 57,281 63,325 71,338 81,315 76,321 79,311 83,301 75,308 80,298 73,303 76,296 71,298 74,292 69,293 74,284 78,278 71,278 74,274 68,273 70,268 66,267 68,261 60,266 62,259 65,253 57,258 59,251 55,254 55,248 60,237 54,240 58,234 54,236 56,229 56,229 56,229"/> 
+   <polyline verts = " 74,363 79,368 81,368 85,362 89,363 92,370 96,373 101,372 108,361 110,371 113,373 116,371 120,358 122,363 123,371 126,371 129,367 132,357 135,361 130,376 127,377 94,378 84,376 76,371 74,363 74,363 74,363"/> 
+   <polyline verts = " 212,250 219,251 228,258 236,270 235,287 225,304 205,332 177,343 171,352 158,357 166,352 168,346 168,339 165,333 155,327 155,323 161,320 165,316 169,316 167,312 171,313 168,308 173,309 170,306 177,306 175,308 177,311 174,311 176,316 171,315 174,319 168,320 168,323 175,327 179,332 183,326 184,332 189,323 190,328 194,320 194,325 199,316 201,320 204,313 206,316 208,310 211,305 219,298 226,288 229,279 228,266 224,259 217,253 212,250 212,250 212,250"/> 
+   <polyline verts = " 151,205 151,238 149,252 141,268 128,282 121,301 130,300 126,313 118,324 116,337 120,346 133,352 133,340 137,333 145,329 156,327 153,319 153,291 157,271 170,259 178,277 193,250 174,216 151,205 151,205 151,205"/> 
+   <polyline verts = " 78,127 90,142 95,155 108,164 125,167 139,175 150,206 152,191 141,140 121,148 100,136 78,127 78,127 78,127"/> 
+   <polyline verts = " 21,58 35,63 38,68 32,69 42,74 40,79 47,80 54,83 45,94 34,81 32,73 24,66 21,58 21,58 21,58"/> 
+   <polyline verts = " 71,34 67,34 66,27 59,24 54,17 48,17 39,22 30,26 28,31 31,39 38,46 29,45 36,54 41,61 41,70 50,69 54,71 55,58 67,52 76,43 76,39 68,44 71,34 71,34 71,34"/> 
+   <polyline verts = " 139,74 141,83 143,89 144,104 148,104 155,106 154,86 157,77 155,72 150,77 144,77 139,74 139,74 139,74"/> 
+   <polyline verts = " 105,44 102,53 108,58 111,62 112,55 105,44 105,44 105,44"/> 
+   <polyline verts = " 141,48 141,54 144,58 139,62 137,66 136,59 137,52 141,48 141,48 141,48"/> 
+   <polyline verts = " 98,135 104,130 105,134 108,132 108,135 112,134 113,137 116,136 116,139 119,139 124,141 128,140 133,138 140,133 139,140 126,146 104,144 98,135 98,135 98,135"/> 
+   <polyline verts = " 97,116 103,119 103,116 111,118 116,117 122,114 127,107 135,111 142,107 141,114 145,118 149,121 145,125 140,124 127,121 113,125 100,124 97,116 97,116 97,116"/> 
+   <polyline verts = " 147,33 152,35 157,34 153,31 160,31 156,28 161,28 159,24 163,25 163,21 165,22 170,23 167,17 172,21 174,18 175,23 176,22 177,28 177,33 174,37 176,39 174,44 171,49 168,53 164,57 159,68 156,70 154,60 150,51 146,43 144,35 147,33 147,33 147,33"/> 
+   <polyline verts = " 85,72 89,74 93,75 100,76 105,75 102,79 94,79 88,76 85,72 85,72 85,72"/> 
+   <polyline verts = " 86,214 79,221 76,232 82,225 78,239 82,234 78,245 81,243 79,255 84,250 84,267 87,254 90,271 90,257 95,271 93,256 95,249 92,252 93,243 89,253 89,241 86,250 87,236 83,245 87,231 82,231 90,219 84,221 86,214 86,214 86,214"/> 
+</g> 
+<g style = "fill: #ffcc7f" > 
+   <polyline verts = " 93,68 96,72 100,73 106,72 108,66 105,63 100,62 93,68 93,68 93,68"/> 
+   <polyline verts = " 144,64 142,68 142,73 146,74 150,73 154,64 149,62 144,64 144,64 144,64"/> 
+</g> 
+<g style = "fill: #9c826b" > 
+   <polyline verts = " 57,91 42,111 52,105 41,117 53,112 46,120 53,116 50,124 57,119 55,127 61,122 60,130 67,126 66,134 71,129 72,136 77,130 76,137 80,133 82,138 86,135 96,135 94,129 86,124 83,117 77,123 79,117 73,120 75,112 68,116 71,111 65,114 69,107 63,110 68,102 61,107 66,98 61,103 63,97 57,99 57,91 57,91 57,91"/> 
+   <polyline verts = " 83,79 76,79 67,82 75,83 65,88 76,87 65,92 76,91 68,96 77,95 70,99 80,98 72,104 80,102 76,108 85,103 92,101 87,98 93,96 86,94 91,93 85,91 93,89 99,89 105,93 107,85 102,82 92,80 83,79 83,79 83,79"/> 
+   <polyline verts = " 109,77 111,83 109,89 113,94 117,90 117,81 114,78 109,77 109,77 109,77"/> 
+   <polyline verts = " 122,128 127,126 134,127 136,129 134,130 130,128 124,129 122,128 122,128 122,128"/> 
+   <polyline verts = " 78,27 82,32 80,33 82,36 78,37 82,40 78,42 81,46 76,47 78,49 74,50 82,52 87,50 83,48 91,46 86,45 91,42 88,40 92,37 86,34 90,31 86,29 89,26 78,27 78,27 78,27"/> 
+   <polyline verts = " 82,17 92,20 79,21 90,25 81,25 94,28 93,26 101,30 101,26 107,33 108,28 111,40 113,34 115,45 117,39 119,54 121,46 124,58 126,47 129,59 130,49 134,58 133,44 137,48 133,37 137,40 133,32 126,20 135,26 132,19 138,23 135,17 142,18 132,11 116,6 94,6 78,11 92,12 80,14 90,16 82,17 82,17 82,17"/> 
+   <polyline verts = " 142,234 132,227 124,223 115,220 110,225 118,224 127,229 135,236 122,234 115,237 113,242 121,238 139,243 121,245 111,254 95,254 102,244 104,235 110,229 100,231 104,224 113,216 122,215 132,217 141,224 145,230 149,240 142,234 142,234 142,234"/> 
+   <polyline verts = " 115,252 125,248 137,249 143,258 134,255 125,254 115,252 115,252 115,252"/> 
+   <polyline verts = " 114,212 130,213 140,219 147,225 144,214 137,209 128,207 114,212 114,212 114,212"/> 
+   <polyline verts = " 102,263 108,258 117,257 131,258 116,260 109,265 102,263 102,263 102,263"/> 
+   <polyline verts = " 51,241 35,224 40,238 23,224 31,242 19,239 28,247 17,246 25,250 37,254 39,263 44,271 47,294 48,317 51,328 60,351 60,323 53,262 47,246 51,241 51,241 51,241"/> 
+   <polyline verts = " 2,364 9,367 14,366 18,355 20,364 26,366 31,357 35,364 39,364 42,357 47,363 53,360 59,357 54,369 7,373 2,364 2,364 2,364"/> 
+   <polyline verts = " 7,349 19,345 25,339 18,341 23,333 28,326 23,326 27,320 23,316 25,311 20,298 15,277 12,264 9,249 10,223 3,248 5,261 15,307 17,326 11,343 7,349 7,349 7,349"/> 
+   <polyline verts = " 11,226 15,231 25,236 18,227 11,226 11,226 11,226"/> 
+   <polyline verts = " 13,214 19,217 32,227 23,214 16,208 15,190 24,148 31,121 24,137 14,170 8,189 13,214 13,214 13,214"/> 
+   <polyline verts = " 202,254 195,258 199,260 193,263 197,263 190,268 196,268 191,273 188,282 200,272 194,272 201,266 197,265 204,262 200,258 204,256 202,254 202,254 202,254"/> 
+</g> 
+<g style = "fill: #845433" > 
+   <polyline verts = " 151,213 165,212 179,225 189,246 187,262 179,275 176,263 177,247 171,233 163,230 165,251 157,264 146,298 145,321 133,326 143,285 154,260 153,240 151,213 151,213 151,213"/> 
+   <polyline verts = " 91,132 95,145 97,154 104,148 107,155 109,150 111,158 115,152 118,159 120,153 125,161 126,155 133,164 132,154 137,163 137,152 142,163 147,186 152,192 148,167 141,143 124,145 105,143 91,132 91,132 91,132"/> 
+</g> 
+<g style = "fill: #9c826b" > 
+   <polyline verts = " 31,57 23,52 26,51 20,44 23,42 21,36 22,29 25,23 24,32 30,43 26,41 30,50 26,48 31,57 31,57 31,57"/> 
+   <polyline verts = " 147,21 149,28 155,21 161,16 167,14 175,15 173,11 161,9 147,21 147,21 147,21"/> 
+   <polyline verts = " 181,39 175,51 169,57 171,65 165,68 165,75 160,76 162,91 171,71 180,51 181,39 181,39 181,39"/> 
+   <polyline verts = " 132,346 139,348 141,346 142,341 147,342 143,355 133,350 132,346 132,346 132,346"/> 
+   <polyline verts = " 146,355 151,352 155,348 157,343 160,349 151,356 147,357 146,355 146,355 146,355"/> 
+   <polyline verts = " 99,266 100,281 94,305 86,322 78,332 72,346 73,331 91,291 99,266 99,266 99,266"/> 
+   <polyline verts = " 20,347 32,342 45,340 54,345 45,350 42,353 38,350 31,353 29,356 23,350 19,353 15,349 20,347 20,347 20,347"/> 
+   <polyline verts = " 78,344 86,344 92,349 88,358 84,352 78,344 78,344 78,344"/> 
+   <polyline verts = " 93,347 104,344 117,345 124,354 121,357 116,351 112,351 108,355 102,351 93,347 93,347 93,347"/> 
+</g> 
+<g style = "fill: #000000" > 
+   <polyline verts = " 105,12 111,18 113,24 113,29 119,34 116,23 112,16 105,12 105,12 105,12"/> 
+   <polyline verts = " 122,27 125,34 127,43 128,34 125,29 122,27 122,27 122,27"/> 
+   <polyline verts = " 115,13 122,19 122,15 113,10 115,13 115,13 115,13"/> 
+</g> 
+<g style = "fill: #ffe5b2" > 
+   <polyline verts = " 116,172 107,182 98,193 98,183 90,199 89,189 84,207 88,206 87,215 95,206 93,219 91,230 98,216 97,226 104,214 112,209 104,208 113,202 126,200 139,207 132,198 142,203 134,192 142,195 134,187 140,185 130,181 136,177 126,177 125,171 116,180 116,172 116,172 116,172"/> 
+   <polyline verts = " 74,220 67,230 67,221 59,235 63,233 60,248 70,232 65,249 71,243 67,256 73,250 69,262 73,259 71,267 76,262 72,271 78,270 76,275 82,274 78,290 86,279 86,289 92,274 88,275 87,264 82,270 82,258 77,257 78,247 73,246 77,233 72,236 74,220 74,220 74,220"/> 
+   <polyline verts = " 133,230 147,242 148,250 145,254 138,247 129,246 142,245 138,241 128,237 137,238 133,230 133,230 133,230"/> 
+   <polyline verts = " 133,261 125,261 116,263 111,267 125,265 133,261 133,261 133,261"/> 
+   <polyline verts = " 121,271 109,273 103,279 99,305 92,316 85,327 83,335 89,340 97,341 94,336 101,336 96,331 103,330 97,327 108,325 99,322 109,321 100,318 110,317 105,314 110,312 107,310 113,308 105,306 114,303 105,301 115,298 107,295 115,294 108,293 117,291 109,289 117,286 109,286 118,283 112,281 118,279 114,278 119,276 115,274 121,271 121,271 121,271"/> 
+   <polyline verts = " 79,364 74,359 74,353 76,347 80,351 83,356 82,360 79,364 79,364 79,364"/> 
+   <polyline verts = " 91,363 93,356 97,353 103,355 105,360 103,366 99,371 94,368 91,363 91,363 91,363"/> 
+   <polyline verts = " 110,355 114,353 118,357 117,363 113,369 111,362 110,355 110,355 110,355"/> 
+   <polyline verts = " 126,354 123,358 124,367 126,369 129,361 129,357 126,354 126,354 126,354"/> 
+   <polyline verts = " 30,154 24,166 20,182 23,194 29,208 37,218 41,210 41,223 46,214 46,227 52,216 52,227 61,216 59,225 68,213 73,219 70,207 77,212 69,200 77,202 70,194 78,197 68,187 76,182 64,182 58,175 58,185 53,177 50,186 46,171 44,182 39,167 36,172 36,162 30,166 30,154 30,154 30,154"/> 
+   <polyline verts = " 44,130 41,137 45,136 43,150 48,142 48,157 53,150 52,164 60,156 61,169 64,165 66,175 70,167 74,176 77,168 80,183 85,172 90,182 93,174 98,181 99,173 104,175 105,169 114,168 102,163 95,157 94,166 90,154 87,162 82,149 75,159 72,148 68,155 67,143 62,148 62,138 58,145 56,133 52,142 52,128 49,134 47,125 44,130 44,130 44,130"/> 
+   <polyline verts = " 13,216 19,219 36,231 22,223 16,222 22,227 12,224 13,220 16,220 13,216 13,216 13,216"/> 
+   <polyline verts = " 10,231 14,236 25,239 27,237 19,234 10,231 10,231 10,231"/> 
+   <polyline verts = " 9,245 14,242 25,245 13,245 9,245 9,245 9,245"/> 
+   <polyline verts = " 33,255 26,253 18,254 25,256 18,258 27,260 18,263 27,265 19,267 29,270 21,272 29,276 21,278 30,281 22,283 31,287 24,288 32,292 23,293 34,298 26,299 37,303 32,305 39,309 33,309 39,314 34,314 40,318 34,317 40,321 34,321 41,326 33,326 40,330 33,332 39,333 33,337 42,337 54,341 49,337 52,335 47,330 50,330 45,325 49,325 45,321 48,321 45,316 46,306 45,286 43,274 36,261 33,255 33,255 33,255"/> 
+   <polyline verts = " 7,358 9,351 14,351 17,359 11,364 7,358 7,358 7,358"/> 
+   <polyline verts = " 44,354 49,351 52,355 49,361 44,354 44,354 44,354"/> 
+   <polyline verts = " 32,357 37,353 40,358 36,361 32,357 32,357 32,357"/> 
+   <polyline verts = " 139,334 145,330 154,330 158,334 154,341 152,348 145,350 149,340 147,336 141,339 139,345 136,342 136,339 139,334 139,334 139,334"/> 
+   <polyline verts = " 208,259 215,259 212,255 220,259 224,263 225,274 224,283 220,292 208,300 206,308 203,304 199,315 197,309 195,318 193,313 190,322 190,316 185,325 182,318 180,325 172,321 178,320 176,313 186,312 180,307 188,307 184,303 191,302 186,299 195,294 187,290 197,288 192,286 201,283 194,280 203,277 198,275 207,271 200,269 209,265 204,265 212,262 208,259 208,259 208,259"/> 
+   <polyline verts = " 106,126 106,131 109,132 111,134 115,132 115,135 119,133 118,137 123,137 128,137 133,134 136,130 136,127 132,124 118,128 112,128 106,126 106,126 106,126"/> 
+   <polyline verts = " 107,114 101,110 98,102 105,97 111,98 119,102 121,108 118,112 113,115 107,114 107,114 107,114"/> 
+   <polyline verts = " 148,106 145,110 146,116 150,118 152,111 151,107 148,106 148,106 148,106"/> 
+   <polyline verts = " 80,55 70,52 75,58 63,57 72,61 57,61 67,66 57,67 62,69 54,71 61,73 54,77 63,78 53,85 60,84 56,90 69,84 63,82 75,76 70,75 77,72 72,71 78,69 72,66 81,67 78,64 82,63 80,60 86,62 80,55 80,55 80,55"/> 
+   <polyline verts = " 87,56 91,52 96,50 102,56 98,56 92,60 87,56 87,56 87,56"/> 
+   <polyline verts = " 85,68 89,73 98,76 106,74 96,73 91,70 85,68 85,68 85,68"/> 
+   <polyline verts = " 115,57 114,64 111,64 115,75 122,81 122,74 126,79 126,74 131,78 130,72 133,77 131,68 126,61 119,57 115,57 115,57 115,57"/> 
+   <polyline verts = " 145,48 143,53 147,59 151,59 150,55 145,48 145,48 145,48"/> 
+   <polyline verts = " 26,22 34,15 43,10 52,10 59,16 47,15 32,22 26,22 26,22 26,22"/> 
+   <polyline verts = " 160,19 152,26 149,34 154,33 152,30 157,30 155,26 158,27 157,23 161,23 160,19 160,19 160,19"/> 
+</g> 
+<g style = "fill: #000000" > 
+   <polyline verts = " 98,117 105,122 109,122 105,117 113,120 121,120 130,112 128,108 123,103 123,99 128,101 132,106 135,109 142,105 142,101 145,101 145,91 148,101 145,105 136,112 135,116 143,124 148,120 150,122 142,128 133,122 121,125 112,126 103,125 100,129 96,124 98,117 98,117 98,117"/> 
+   <polyline verts = " 146,118 152,118 152,115 149,115 146,118 146,118 146,118"/> 
+   <polyline verts = " 148,112 154,111 154,109 149,109 148,112 148,112 148,112"/> 
+   <polyline verts = " 106,112 108,115 114,116 118,114 106,112 106,112 106,112"/> 
+   <polyline verts = " 108,108 111,110 116,110 119,108 108,108 108,108 108,108"/> 
+   <polyline verts = " 106,104 109,105 117,106 115,104 106,104 106,104 106,104"/> 
+   <polyline verts = " 50,25 41,26 34,33 39,43 49,58 36,51 47,68 55,69 54,59 61,57 74,46 60,52 67,42 57,48 61,40 54,45 60,36 59,29 48,38 52,30 47,32 50,25 50,25 50,25"/> 
+   <polyline verts = " 147,34 152,41 155,49 161,53 157,47 164,47 158,43 168,44 159,40 164,37 169,37 164,33 169,34 165,28 170,30 170,25 173,29 175,27 176,32 173,36 175,39 172,42 172,46 168,49 170,55 162,57 158,63 155,58 153,50 149,46 147,34 147,34 147,34"/> 
+   <polyline verts = " 155,71 159,80 157,93 157,102 155,108 150,101 149,93 154,101 152,91 151,83 155,79 155,71 155,71 155,71"/> 
+   <polyline verts = " 112,78 115,81 114,91 112,87 113,82 112,78 112,78 112,78"/> 
+   <polyline verts = " 78,28 64,17 58,11 47,9 36,10 28,16 21,26 18,41 20,51 23,61 33,65 28,68 37,74 36,81 43,87 48,90 43,100 40,98 39,90 31,80 30,72 22,71 17,61 14,46 16,28 23,17 33,9 45,6 54,6 65,12 78,28 78,28 78,28"/> 
+   <polyline verts = " 67,18 76,9 87,5 101,2 118,3 135,8 149,20 149,26 144,19 132,12 121,9 105,7 89,8 76,14 70,20 67,18 67,18 67,18"/> 
+   <polyline verts = " 56,98 48,106 56,103 47,112 56,110 52,115 57,113 52,121 62,115 58,123 65,119 63,125 69,121 68,127 74,125 74,129 79,128 83,132 94,135 93,129 85,127 81,122 76,126 75,121 71,124 71,117 66,121 66,117 62,117 64,112 60,113 60,110 57,111 61,105 57,107 60,101 55,102 56,98 56,98 56,98"/> 
+   <polyline verts = " 101,132 103,138 106,134 106,139 112,136 111,142 115,139 114,143 119,142 125,145 131,142 135,138 140,134 140,129 143,135 145,149 150,171 149,184 145,165 141,150 136,147 132,151 131,149 126,152 125,150 121,152 117,148 111,152 110,148 105,149 104,145 98,150 96,138 94,132 94,130 98,132 101,132 101,132 101,132"/> 
+   <polyline verts = " 41,94 32,110 23,132 12,163 6,190 7,217 5,236 3,247 9,230 12,211 12,185 18,160 26,134 35,110 43,99 41,94 41,94 41,94"/> 
+   <polyline verts = " 32,246 41,250 50,257 52,267 53,295 53,323 59,350 54,363 51,365 44,366 42,360 40,372 54,372 59,366 62,353 71,352 75,335 73,330 66,318 68,302 64,294 67,288 63,286 63,279 59,275 58,267 56,262 50,247 42,235 44,246 32,236 35,244 32,246 32,246 32,246"/> 
+   <polyline verts = " 134,324 146,320 159,322 173,327 179,337 179,349 172,355 158,357 170,350 174,343 170,333 163,328 152,326 134,329 134,324 134,324 134,324"/> 
+   <polyline verts = " 173,339 183,334 184,338 191,329 194,332 199,323 202,325 206,318 209,320 213,309 221,303 228,296 232,289 234,279 233,269 230,262 225,256 219,253 208,252 198,252 210,249 223,250 232,257 237,265 238,277 238,291 232,305 221,323 218,335 212,342 200,349 178,348 173,339 173,339 173,339"/> 
+   <polyline verts = " 165,296 158,301 156,310 156,323 162,324 159,318 162,308 162,304 165,296 165,296 165,296"/> 
+   <polyline verts = " 99,252 105,244 107,234 115,228 121,228 131,235 122,233 113,235 109,246 121,239 133,243 121,243 110,251 99,252 99,252 99,252"/> 
+   <polyline verts = " 117,252 124,247 134,249 136,253 126,252 117,252 117,252 117,252"/> 
+   <polyline verts = " 117,218 132,224 144,233 140,225 132,219 117,218 117,218 117,218"/> 
+   <polyline verts = " 122,212 134,214 143,221 141,213 132,210 122,212 122,212 122,212"/> 
+   <polyline verts = " 69,352 70,363 76,373 86,378 97,379 108,379 120,377 128,378 132,373 135,361 133,358 132,366 127,375 121,374 121,362 119,367 117,374 110,376 110,362 107,357 106,371 104,375 97,376 90,375 90,368 86,362 83,364 86,369 85,373 78,370 73,362 71,351 69,352 69,352 69,352"/> 
+   <polyline verts = " 100,360 96,363 99,369 102,364 100,360 100,360 100,360"/> 
+   <polyline verts = " 115,360 112,363 114,369 117,364 115,360 115,360 115,360"/> 
+   <polyline verts = " 127,362 125,364 126,369 128,365 127,362 127,362 127,362"/> 
+   <polyline verts = " 5,255 7,276 11,304 15,320 13,334 6,348 2,353 0,363 5,372 12,374 25,372 38,372 44,369 42,367 36,368 31,369 30,360 27,368 20,370 16,361 15,368 10,369 3,366 3,359 6,352 11,348 17,331 19,316 12,291 9,274 5,255 5,255 5,255"/> 
+   <polyline verts = " 10,358 7,362 10,366 11,362 10,358 10,358 10,358"/> 
+   <polyline verts = " 25,357 22,360 24,366 27,360 25,357 25,357 25,357"/> 
+   <polyline verts = " 37,357 34,361 36,365 38,361 37,357 37,357 37,357"/> 
+   <polyline verts = " 49,356 46,359 47,364 50,360 49,356 49,356 49,356"/> 
+   <polyline verts = " 130,101 132,102 135,101 139,102 143,103 142,101 137,100 133,100 130,101 130,101 130,101"/> 
+   <polyline verts = " 106,48 105,52 108,56 109,52 106,48 106,48 106,48"/> 
+   <polyline verts = " 139,52 139,56 140,60 142,58 141,56 139,52 139,52 139,52"/> 
+   <polyline verts = " 25,349 29,351 30,355 33,350 37,348 42,351 45,347 49,345 44,343 36,345 25,349 25,349 25,349"/> 
+   <polyline verts = " 98,347 105,351 107,354 109,349 115,349 120,353 118,349 113,346 104,346 98,347 98,347 98,347"/> 
+   <polyline verts = " 83,348 87,352 87,357 89,351 87,348 83,348 83,348 83,348"/> 
+   <polyline verts = " 155,107 163,107 170,107 186,108 175,109 155,109 155,107 155,107 155,107"/> 
+   <polyline verts = " 153,114 162,113 175,112 192,114 173,114 154,115 153,114 153,114 153,114"/> 
+   <polyline verts = " 152,118 164,120 180,123 197,129 169,123 151,120 152,118 152,118 152,118"/> 
+   <polyline verts = " 68,109 87,106 107,106 106,108 88,108 68,109 68,109 68,109"/> 
+   <polyline verts = " 105,111 95,112 79,114 71,116 85,115 102,113 105,111 105,111 105,111"/> 
+   <polyline verts = " 108,101 98,99 87,99 78,99 93,100 105,102 108,101 108,101 108,101"/> 
+   <polyline verts = " 85,63 91,63 97,60 104,60 108,62 111,69 112,75 110,74 108,71 103,73 106,69 105,65 103,64 103,67 102,70 99,70 97,66 94,67 97,72 88,67 84,66 85,63 85,63 85,63"/> 
+   <polyline verts = " 140,74 141,66 144,61 150,61 156,62 153,70 150,73 152,65 150,65 151,68 149,71 146,71 144,66 143,70 143,74 140,74 140,74 140,74"/> 
+   <polyline verts = " 146,20 156,11 163,9 172,9 178,14 182,18 184,32 182,42 182,52 177,58 176,67 171,76 165,90 157,105 160,92 164,85 168,78 167,73 173,66 172,62 175,59 174,55 177,53 180,46 181,29 179,21 173,13 166,11 159,13 153,18 148,23 146,20 146,20 146,20"/> 
+   <polyline verts = " 150,187 148,211 150,233 153,247 148,267 135,283 125,299 136,292 131,313 122,328 122,345 129,352 133,359 133,367 137,359 148,356 140,350 131,347 129,340 132,332 140,328 137,322 140,304 154,265 157,244 155,223 161,220 175,229 186,247 185,260 176,275 178,287 185,277 188,261 196,253 189,236 174,213 150,187 150,187 150,187"/> 
+   <polyline verts = " 147,338 142,341 143,345 141,354 147,343 147,338 147,338 147,338"/> 
+   <polyline verts = " 157,342 156,349 150,356 157,353 163,346 162,342 157,342 157,342 157,342"/> 
+   <polyline verts = " 99,265 96,284 92,299 73,339 73,333 87,300 99,265 99,265 99,265"/> 
+</g></svg>
+

diff --git a/test/svg2 b/test/svg2
new file mode 100644
index 0000000..aa1adac
--- /dev/null
+++ b/test/svg2
@@ -0,0 +1,58 @@
+<?xml version = "1.0" standalone = "yes"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN"
+ "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+<svg width = "268px" height="207px">
+<g style = "stroke: #000000" > 
+   <path  d = " M 29 28 "/> 
+   <path  d = " L 19 74 "/> 
+</g> 
+<g style = "stroke: #800040" > 
+   <polyline verts = " 32,100 72,50 90,82 73,16 120,64 152,9 177,107"/> 
+</g> 
+<g style = "stroke: #000000" > 
+</g> 
+<g style = "stroke: #0000ff" > 
+   <rect x = "30" y = "101" width  = "51" height = "33"/>
+</g> 
+<g style = "fill: #0000ff" > 
+   <ellipse cx = "182" cy = "127" major  = "37" minor = "31" angle = "90"/>
+</g> 
+<g style = "fill: #ff0000" > 
+   <polyline verts = " 78,180 76,151 131,149 136,182 135,182 134,183 127,185 117,186 109,192 104,194 98,199 96,200 95,201 94,202 92,202 85,202 70,200 54,199 47,198 46,197 45,197 37,195 26,193 17,187 9,181 8,181 7,176 6,175 6,173 6,172 6,170 8,164 8,163 8,162 9,162 10,162 11,162 13,162 20,162 26,162 27,162 28,162 30,162 30,163 31,163 32,164 34,166 35,166 36,167 36,168 37,169 38,169 39,169 41,170 43,170 45,170 47,170 49,170 50,168 50,161 50,160 50,159 47,162 78,180"/> 
+   <g>
+     <desc> Java Font definition:Dialog 0</desc> 
+   </g>
+   <g>
+     <desc> Java Font definition:Helvetica 0</desc> 
+   </g>
+</g> 
+<g style = "stroke: #000000" > 
+   <text x = "188" y = "36" >this is text</text>
+</g> 
+<g style = "stroke: #000000" > 
+   <g>
+     <desc> Java Font definition:Dialog 0</desc> 
+   </g>
+   <g>
+     <desc> Java Font definition:Helvetica 700</desc> 
+   </g>
+</g> 
+<g style = "stroke: #008080" > 
+   <text x = "176" y = "85" >sadfsadfsad</text>
+</g> 
+<g style = "stroke: #000000" > 
+</g> 
+<g style = "fill: #800040" > 
+   <ellipse cx = "208" cy = "180" major  = "45" minor = "31" angle = "0"/>
+</g> 
+<g style = "stroke: #000000" > 
+</g> 
+<g style = "fill: #ffffff" > 
+   <g>
+     <desc> Java Font definition:Dialog 700</desc> 
+   </g>
+   <g>
+     <desc> Java Font definition:Dialog 700</desc> 
+   </g>
+</g></svg>
+

diff --git a/test/xml1 b/test/xml1
new file mode 100644
index 0000000..40df24a
--- /dev/null
+++ b/test/xml1
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE test [
+<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
+ numerically (&#38;#38;#38;) or with a general entity
+  (&amp;amp;).</p>" >
+]>
+<test>&example;</test>
diff --git a/test/xml2 b/test/xml2
new file mode 100644
index 0000000..922314b
--- /dev/null
+++ b/test/xml2
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!DOCTYPE test [
+<!ELEMENT test (#PCDATA) >
+<!ENTITY % xx '&#37;zz;'>
+<!ENTITY % zz '&#60;!ENTITY tricky "error-prone" >' >
+%xx;
+]>
+<test>This sample shows a &tricky; method.</test>
diff --git a/testSAX.c b/testSAX.c
index f742bce..8d64691 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -28,6 +28,7 @@
 #include <stdarg.h>
 
 #include "parser.h"
+#include "parserInternals.h" /* only for xmlNewInputFromFile() */
 #include "tree.h"
 #include "debugXML.h"
 
@@ -63,6 +64,7 @@
 };
 
 xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
+extern xmlSAXHandlerPtr debugSAXHandler;
 
 /*
  * Note: there is a couple of errors introduced on purpose.
@@ -148,8 +150,14 @@
 internalSubsetDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
 	       const CHAR *ExternalID, const CHAR *SystemID)
 {
+    xmlDtdPtr externalSubset;
+
     fprintf(stdout, "SAX.internalSubset(%s, %s, %s)\n",
             name, ExternalID, SystemID);
+
+    if ((ExternalID != NULL) || (SystemID != NULL)) {
+        externalSubset = xmlSAXParseDTD(debugSAXHandler, ExternalID, SystemID);
+    }
 }
 
 /**
@@ -171,6 +179,9 @@
 {
     fprintf(stdout, "SAX.resolveEntity(%s, %s)\n",
             (char *)publicId, (char *)systemId);
+    if (systemId != NULL) {
+        return(xmlNewInputFromFile(ctxt, systemId));
+    }
     return(NULL);
 }
 
diff --git a/tester.c b/tester.c
index 927eda2..f2a7cf1 100644
--- a/tester.c
+++ b/tester.c
@@ -33,6 +33,7 @@
 static int debug = 0;
 static int copy = 0;
 static int recovery = 0;
+static int noent = 0;
 
 /*
  * Note: there is a couple of errors introduced on purpose.
@@ -184,7 +185,11 @@
 	else if ((!strcmp(argv[i], "-recover")) ||
 	         (!strcmp(argv[i], "--recover")))
 	    recovery++;
+	else if ((!strcmp(argv[i], "-noent")) ||
+	         (!strcmp(argv[i], "--noent")))
+	    noent++;
     }
+    if (noent != 0) xmlSubstituteEntitiesDefault(1);
     for (i = 1; i < argc ; i++) {
 	if (argv[i][0] != '-') {
 	    parseAndPrintFile(argv[i]);
diff --git a/tree.c b/tree.c
index c1e1ebd..617264c 100644
--- a/tree.c
+++ b/tree.c
@@ -478,7 +478,7 @@
 	    while ((*cur != 0) && (cur - value < len) && (*cur != ';')) cur++;
 	    if ((*cur == 0) || (cur - value >= len)) {
 	        fprintf(stderr,
-		        "xmlStringGetNodeList: unterminated entity %30s\n", q);
+		    "xmlStringLenGetNodeList: unterminated entity %30s\n", q);
 	        return(ret);
 	    }
             if (cur != q) {
@@ -2292,7 +2292,7 @@
 
 /**
  * xmlBufferWriteChar:
- * @buf:  the XML buffer
+ * @buf:  the XML buffer output
  * @string:  the string to add
  *
  * routine which manage and grows an output buffer. This one add
@@ -2305,7 +2305,38 @@
 
 
 /**
+ * xmlBufferWriteQuotedString:
+ * @buf:  the XML buffer output
+ * @string:  the string to add
+ *
+ * routine which manage and grows an output buffer. This one writes
+ * a quoted or double quoted CHAR string, checking first if it holds
+ * quote or double-quotes internally
+ */
+void
+xmlBufferWriteQuotedString(xmlBufferPtr buf, const CHAR *string) {
+    /*
+     * TODO: fix strchr by xmlStrchr to work coreectly on UTF-8 !!!
+     */
+    if (strchr(string, '"')) {
+        if (strchr(string, '\'')) {
+	    fprintf(stderr,
+ "xmlBufferWriteQuotedString: string contains quote and double-quotes !\n");
+	}
+        xmlBufferCCat(buf, "'");
+        xmlBufferCat(buf, string);
+        xmlBufferCCat(buf, "'");
+    } else {
+        xmlBufferCCat(buf, "\"");
+        xmlBufferCat(buf, string);
+        xmlBufferCCat(buf, "\"");
+    }
+}
+
+
+/**
  * xmlGlobalNsDump:
+ * @buf:  the XML buffer output
  * @cur:  a namespace
  *
  * Dump a global Namespace, this is the old version based on PIs.
@@ -2319,14 +2350,12 @@
     if (cur->type == XML_GLOBAL_NAMESPACE) {
 	xmlBufferWriteChar(buf, "<?namespace");
 	if (cur->href != NULL) {
-	    xmlBufferWriteChar(buf, " href=\"");
-	    xmlBufferWriteCHAR(buf, cur->href);
-	    xmlBufferWriteChar(buf, "\"");
+	    xmlBufferWriteChar(buf, " href=");
+	    xmlBufferWriteQuotedString(buf, cur->href);
 	}
 	if (cur->prefix != NULL) {
-	    xmlBufferWriteChar(buf, " AS=\"");
-	    xmlBufferWriteCHAR(buf, cur->prefix);
-	    xmlBufferWriteChar(buf, "\"");
+	    xmlBufferWriteChar(buf, " AS=");
+	    xmlBufferWriteQuotedString(buf, cur->prefix);
 	}
 	xmlBufferWriteChar(buf, "?>\n");
     }
@@ -2334,6 +2363,7 @@
 
 /**
  * xmlGlobalNsListDump:
+ * @buf:  the XML buffer output
  * @cur:  the first namespace
  *
  * Dump a list of global Namespace, this is the old version based on PIs.
@@ -2348,6 +2378,7 @@
 
 /**
  * xmlNsDump:
+ * @buf:  the XML buffer output
  * @cur:  a namespace
  *
  * Dump a local Namespace definition.
@@ -2366,14 +2397,14 @@
 	    xmlBufferWriteCHAR(buf, cur->prefix);
 	} else
 	    xmlBufferWriteChar(buf, " xmlns");
-	xmlBufferWriteChar(buf, "=\"");
-	xmlBufferWriteCHAR(buf, cur->href);
-	xmlBufferWriteChar(buf, "\"");
+	xmlBufferWriteChar(buf, "=");
+	xmlBufferWriteQuotedString(buf, cur->href);
     }
 }
 
 /**
  * xmlNsListDump:
+ * @buf:  the XML buffer output
  * @cur:  the first namespace
  *
  * Dump a list of local Namespace definitions.
@@ -2389,6 +2420,7 @@
 
 /**
  * xmlDtdDump:
+ * @buf:  the XML buffer output
  * @doc:  the document
  * 
  * Dump the XML document DTD, if any.
@@ -2404,15 +2436,13 @@
     xmlBufferWriteChar(buf, "<!DOCTYPE ");
     xmlBufferWriteCHAR(buf, cur->name);
     if (cur->ExternalID != NULL) {
-	xmlBufferWriteChar(buf, " PUBLIC \"");
-	xmlBufferWriteCHAR(buf, cur->ExternalID);
-	xmlBufferWriteChar(buf, "\" \"");
-	xmlBufferWriteCHAR(buf, cur->SystemID);
-	xmlBufferWriteChar(buf, "\"");
+	xmlBufferWriteChar(buf, " PUBLIC ");
+	xmlBufferWriteQuotedString(buf, cur->ExternalID);
+	xmlBufferWriteChar(buf, " ");
+	xmlBufferWriteQuotedString(buf, cur->SystemID);
     }  else if (cur->SystemID != NULL) {
-	xmlBufferWriteChar(buf, " SYSTEM \"");
-	xmlBufferWriteCHAR(buf, cur->SystemID);
-	xmlBufferWriteChar(buf, "\"");
+	xmlBufferWriteChar(buf, " SYSTEM ");
+	xmlBufferWriteQuotedString(buf, cur->SystemID);
     }
     if ((cur->entities == NULL) && (cur->elements == NULL) &&
         (cur->attributes == NULL) && (cur->notations == NULL)) {
@@ -2436,6 +2466,7 @@
 
 /**
  * xmlAttrDump:
+ * @buf:  the XML buffer output
  * @doc:  the document
  * @cur:  the attribute pointer
  *
@@ -2453,9 +2484,8 @@
     xmlBufferWriteCHAR(buf, cur->name);
     value = xmlNodeListGetString(doc, cur->val, 0);
     if (value) {
-	xmlBufferWriteChar(buf, "=\"");
-	xmlBufferWriteCHAR(buf, value);
-	xmlBufferWriteChar(buf, "\"");
+	xmlBufferWriteChar(buf, "=");
+	xmlBufferWriteQuotedString(buf, value);
 	free(value);
     } else  {
 	xmlBufferWriteChar(buf, "=\"\"");
@@ -2464,6 +2494,7 @@
 
 /**
  * xmlAttrListDump:
+ * @buf:  the XML buffer output
  * @doc:  the document
  * @cur:  the first attribute pointer
  *
@@ -2486,6 +2517,7 @@
 xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level);
 /**
  * xmlNodeListDump:
+ * @buf:  the XML buffer output
  * @doc:  the document
  * @cur:  the first node
  * @level: the imbrication level for indenting
@@ -2518,6 +2550,7 @@
 
 /**
  * xmlNodeDump:
+ * @buf:  the XML buffer output
  * @doc:  the document
  * @cur:  the current node
  * @level: the imbrication level for indenting
@@ -2589,6 +2622,7 @@
 
 /**
  * xmlDocContentDump:
+ * @buf:  the XML buffer output
  * @cur:  the document
  *
  * Dump an XML document.
@@ -2596,15 +2630,13 @@
 static void
 xmlDocContentDump(xmlBufferPtr buf, xmlDocPtr cur) {
     if (oldXMLWDcompatibility)
-	xmlBufferWriteChar(buf, "<?XML version=\"");
+	xmlBufferWriteChar(buf, "<?XML version=");
     else 
-	xmlBufferWriteChar(buf, "<?xml version=\"");
-    xmlBufferWriteCHAR(buf, cur->version);
-    xmlBufferWriteChar(buf, "\"");
+	xmlBufferWriteChar(buf, "<?xml version=");
+    xmlBufferWriteQuotedString(buf, cur->version);
     if (cur->encoding != NULL) {
-        xmlBufferWriteChar(buf, " encoding=\"");
-	xmlBufferWriteCHAR(buf, cur->encoding);
-	xmlBufferWriteChar(buf, "\"");
+        xmlBufferWriteChar(buf, " encoding=");
+	xmlBufferWriteQuotedString(buf, cur->encoding);
     }
     switch (cur->standalone) {
         case 0:
diff --git a/tree.h b/tree.h
index ff6b55f..5907e24 100644
--- a/tree.h
+++ b/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
diff --git a/valid.c b/valid.c
index 409db5b..2165537 100644
--- a/valid.c
+++ b/valid.c
@@ -394,12 +394,10 @@
 
 /**
  * xmlDumpElementTable:
+ * @buf:  the XML buffer output
  * @table:  An element table
  *
  * This will dump the content of the element table as an XML DTD definition
- *
- * NOTE: TODO an extra parameter allowing a reentant implementation will
- *       be added.
  */
 void
 xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) {
@@ -755,12 +753,10 @@
 
 /**
  * xmlDumpAttributeTable:
+ * @buf:  the XML buffer output
  * @table:  An attribute table
  *
  * This will dump the content of the attribute table as an XML DTD definition
- *
- * NOTE: TODO an extra parameter allowing a reentant implementation will
- *       be added.
  */
 void
 xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
@@ -820,15 +816,13 @@
             case XML_ATTRIBUTE_IMPLIED:
 		xmlBufferWriteChar(buf, " #IMPLIED");
 		if (cur->defaultValue != NULL) {
-		    xmlBufferWriteChar(buf, " \"");
-		    xmlBufferWriteCHAR(buf, cur->defaultValue);
-		    xmlBufferWriteChar(buf, "\"");
+		    xmlBufferWriteChar(buf, " ");
+		    xmlBufferWriteQuotedString(buf, cur->defaultValue);
 		}
                 break;
             case XML_ATTRIBUTE_FIXED:
-		xmlBufferWriteChar(buf, " #FIXED \"");
-		xmlBufferWriteCHAR(buf, cur->defaultValue);
-		xmlBufferWriteChar(buf, "\"");
+		xmlBufferWriteChar(buf, " #FIXED ");
+		xmlBufferWriteQuotedString(buf, cur->defaultValue);
                 break;
 	    default:
 	        fprintf(stderr,
@@ -1053,12 +1047,10 @@
 
 /**
  * xmlDumpNotationTable:
+ * @buf:  the XML buffer output
  * @table:  A notation table
  *
  * This will dump the content of the notation table as an XML DTD definition
- *
- * NOTE: TODO an extra parameter allowing a reentant implementation will
- *       be added.
  */
 void
 xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
@@ -1072,9 +1064,8 @@
 	xmlBufferWriteChar(buf, "<!NOTATION ");
 	xmlBufferWriteCHAR(buf, cur->name);
 	if (cur->PublicID != NULL) {
-	    xmlBufferWriteChar(buf, " PUBLIC \"");
-	    xmlBufferWriteCHAR(buf, cur->PublicID);
-	    xmlBufferWriteChar(buf, "\"");
+	    xmlBufferWriteChar(buf, " PUBLIC ");
+	    xmlBufferWriteQuotedString(buf, cur->PublicID);
 	    if (cur->SystemID != NULL) {
 		xmlBufferWriteChar(buf, " ");
 		xmlBufferWriteCHAR(buf, cur->SystemID);