aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>1999-08-10 19:04:08 +0000
committerDaniel Veillard <veillard@src.gnome.org>1999-08-10 19:04:08 +0000
commitb05deb7f5fa01da1cbc54f65199eff1c5421ec00 (patch)
tree88b82954fb85467ffd1ddad2d7dcaba7349bc32d
parent6a6ccc1de6c19ff3c77c10491d5f8b65759cff4a (diff)
downloadandroid_external_libxml2-b05deb7f5fa01da1cbc54f65199eff1c5421ec00.tar.gz
android_external_libxml2-b05deb7f5fa01da1cbc54f65199eff1c5421ec00.tar.bz2
android_external_libxml2-b05deb7f5fa01da1cbc54f65199eff1c5421ec00.zip
Huge commit: 1.5.0, XML validation, Xpath, bugfixes, examples .... Daniel
-rw-r--r--ChangeLog11
-rw-r--r--HTMLparser.c14
-rw-r--r--Makefile.am205
-rw-r--r--SAX.c162
-rw-r--r--TODO2
-rw-r--r--acconfig.h3
-rw-r--r--config.h.in39
-rw-r--r--configure.in49
-rw-r--r--doc/html/gnome-xml-entities.html278
-rw-r--r--doc/html/gnome-xml-htmlparser.html214
-rw-r--r--doc/html/gnome-xml-htmltree.html42
-rw-r--r--doc/html/gnome-xml-parser.html700
-rw-r--r--doc/html/gnome-xml-parserinternals.html1176
-rw-r--r--doc/html/gnome-xml-tree.html882
-rw-r--r--doc/html/gnome-xml-valid.html2012
-rw-r--r--doc/html/gnome-xml-xml-error.html24
-rw-r--r--doc/html/gnome-xml-xpath.html68
-rw-r--r--doc/html/index.sgml26
-rw-r--r--doc/xml.html453
-rw-r--r--encoding.c10
-rw-r--r--entities.c82
-rw-r--r--entities.h1
-rw-r--r--error.c175
-rw-r--r--include/libxml/entities.h1
-rw-r--r--include/libxml/parser.h101
-rw-r--r--include/libxml/parserInternals.h39
-rw-r--r--include/libxml/tree.h9
-rw-r--r--include/libxml/valid.h55
-rw-r--r--include/libxml/xmlIO.h1
-rw-r--r--libxml.spec.in10
-rw-r--r--parser.c1927
-rw-r--r--parser.h101
-rw-r--r--parserInternals.h39
-rw-r--r--result/XPath/tests/chaptersbase17
-rw-r--r--result/XPath/tests/simpleabbr12
-rw-r--r--result/XPath/tests/simplebase12
-rw-r--r--test/HTML/fp40.htm166
-rw-r--r--test/VC/AttributeDefaultLegal12
-rw-r--r--test/VC/DuplicateType5
-rw-r--r--test/VC/ElementValid3
-rw-r--r--test/VC/ElementValid24
-rw-r--r--test/VC/ElementValid34
-rw-r--r--test/VC/ElementValid47
-rw-r--r--test/VC/ElementValid57
-rw-r--r--test/VC/ElementValid67
-rw-r--r--test/VC/ElementValid77
-rw-r--r--test/VC/Enumeration5
-rw-r--r--test/VC/OneID6
-rw-r--r--test/VC/OneID26
-rw-r--r--test/VC/OneID34
-rw-r--r--test/VC/PENesting2
-rw-r--r--test/VC/PENesting23
-rw-r--r--test/VC/UniqueElementTypeDeclaration7
-rw-r--r--test/VC/UniqueElementTypeDeclaration28
-rw-r--r--test/VC/dtds/a.dtd2
-rw-r--r--test/VC/dtds/doc.dtd2
-rw-r--r--test/WFC/ElemTypeMatch2
-rw-r--r--test/WFC/EntityDeclared2
-rw-r--r--test/WFC/EntityDeclared25
-rw-r--r--test/WFC/EntityDeclared33
-rw-r--r--test/WFC/EntityDeclared46
-rw-r--r--test/WFC/EntityDeclared56
-rw-r--r--test/WFC/LegalCharacter2
-rw-r--r--test/WFC/NoExternalEntityRef5
-rw-r--r--test/WFC/NoLtInAttValue5
-rw-r--r--test/WFC/NoRecursion7
-rw-r--r--test/WFC/PEintsubset6
-rw-r--r--test/WFC/UniqueAttSpec2
-rw-r--r--test/WFC/UniqueAttSpec22
-rw-r--r--test/XPath/tests/chaptersbase12
-rw-r--r--test/XPath/tests/simpleabbr4
-rw-r--r--test/XPath/tests/simplebase12
-rw-r--r--test/cdata3
-rw-r--r--test/dtd125
-rw-r--r--test/dtds/eve.dtd4
-rw-r--r--test/ent68
-rw-r--r--test/ent77
-rw-r--r--test/errors/dtd136
-rw-r--r--test/eve.xml6
-rw-r--r--test/valid/REC-xml-19980210.xml4197
-rw-r--r--test/valid/dia.xml160
-rwxr-xr-xtest/valid/dtds/spec.dtd972
-rw-r--r--test/valid/dtds/xmlspec.dtd1102
-rw-r--r--test/valid/xlink.xml529
-rw-r--r--test/warning/ent83
-rw-r--r--testSAX.c23
-rw-r--r--testXPath.c7
-rw-r--r--tester.c20
-rw-r--r--tree.c54
-rw-r--r--tree.h9
-rw-r--r--valid.c1402
-rw-r--r--valid.h55
-rw-r--r--xmlIO.c45
-rw-r--r--xmlIO.h1
-rw-r--r--xpath.c218
95 files changed, 15642 insertions, 2494 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e500e45..0882aa9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Tue Aug 10 20:28:09 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * configure.in: upgraded to version 1.4.0
+ * valid.[ch], SAX.c, parser.[ch] parserInternals.h ...
+ Big update, added a large part of the validation process,
+ it should be usable, but some parts are missing
+ * xpath.c: improved the implementation w.r.t. root.
+ * Makefile.am: added more tests
+ * test and result trees: added a lot of tests
+ * libxml.spec.in: export libxml.so.0 and libxml.so.1
+
Tue Aug 10 11:33:41 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* Added an HACKING file
diff --git a/HTMLparser.c b/HTMLparser.c
index 6b08a224..9b41542b 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -515,13 +515,11 @@ htmlEntityDesc html40EntitiesTable[] = {
{ 180, "acute","acute accent = spacing acute, U+00B4 ISOdia" },
{ 181, "micro","micro sign, U+00B5 ISOnum" },
{ 182, "para", "pilcrow sign = paragraph sign, U+00B6 ISOnum" },
-{ 183, "middot","middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum" },
+{ 183, "middot","middle dot = Georgian comma Greek middle dot, U+00B7 ISOnum" },
{ 184, "cedil","cedilla = spacing cedilla, U+00B8 ISOdia" },
{ 185, "sup1", "superscript one = superscript digit one, U+00B9 ISOnum" },
{ 186, "ordm", "masculine ordinal indicator, U+00BA ISOnum" },
-{ 187, "raquo","right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum" },
+{ 187, "raquo","right-pointing double angle quotation mark right pointing guillemet, U+00BB ISOnum" },
{ 188, "frac14","vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum" },
{ 189, "frac12","vulgar fraction one half = fraction one half, U+00BD ISOnum" },
{ 190, "frac34","vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum" },
@@ -550,7 +548,7 @@ htmlEntityDesc html40EntitiesTable[] = {
{ 213, "Otilde","latin capital letter O with tilde, U+00D5 ISOlat1" },
{ 214, "Ouml", "latin capital letter O with diaeresis, U+00D6 ISOlat1" },
{ 215, "times","multiplication sign, U+00D7 ISOnum" },
-{ 216, "Oslash","latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1" },
+{ 216, "Oslash","latin capital letter O with stroke latin capital letter O slash, U+00D8 ISOlat1" },
{ 217, "Ugrave","latin capital letter U with grave, U+00D9 ISOlat1" },
{ 218, "Uacute","latin capital letter U with acute, U+00DA ISOlat1" },
{ 219, "Ucirc","latin capital letter U with circumflex, U+00DB ISOlat1" },
@@ -657,8 +655,7 @@ htmlEntityDesc html40EntitiesTable[] = {
{ 8254, "oline","overline = spacing overscore, U+203E NEW" },
{ 8260, "frasl","fraction slash, U+2044 NEW" },
-{ 8472, "weierp","script capital P = power set
- = Weierstrass p, U+2118 ISOamso" },
+{ 8472, "weierp","script capital P = power set = Weierstrass p, U+2118 ISOamso" },
{ 8465, "image","blackletter capital I = imaginary part, U+2111 ISOamso" },
{ 8476, "real", "blackletter capital R = real part symbol, U+211C ISOamso" },
{ 8482, "trade","trade mark sign, U+2122 ISOnum" },
@@ -754,8 +751,7 @@ htmlEntityDesc html40EntitiesTable[] = {
{ 8225, "Dagger","double dagger, U+2021 ISOpub" },
{ 8240, "permil","per mille sign, U+2030 ISOtech" },
{ 8249, "lsaquo","single left-pointing angle quotation mark, U+2039 ISO proposed" },
-{ 8250, "rsaquo","single right-pointing angle quotation mark,
- U+203A ISO proposed" },
+{ 8250, "rsaquo","single right-pointing angle quotation mark, U+203A ISO proposed" },
{ 8364, "euro", "euro sign, U+20AC NEW" }
};
diff --git a/Makefile.am b/Makefile.am
index 08247e22..2b56ddd6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,7 +44,7 @@ xmlinc_HEADERS = \
valid.h
DEPS = $(top_builddir)/libxml.la
-LDADDS = $(top_builddir)/libxml.la @Z_LIBS@
+LDADDS = $(top_builddir)/libxml.la @Z_LIBS@ @M_LIBS@
tester_SOURCES=tester.c
tester_LDFLAGS =
@@ -68,108 +68,167 @@ testXPath_LDADD= $(LDADDS)
check-local: tests
-testall : tests SVGtests SAXtests XPathtests
+testall : tests SVGtests SAXtests XPathtests XMLenttests
+
+tests: XMLtests HTMLtests Validtests
-tests: HTMLtests XMLtests
HTMLtests : testHTML
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/HTML/* ; do \
+ @echo "##"
+ @echo "## HTML regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/HTML/* ; do \
+ name=`basename $$i`; \
if [ ! -d $$i ] ; then \
- if [ ! -f result/HTML/`basename $$i` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/testHTML $$i > result/HTML/`basename $$i` ; \
+ if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
+ echo New test file $$name ; \
+ testHTML $$i > $(srcdir)/result/HTML/$$name ; \
else \
- echo Testing `basename $$i` ; \
- $$DIR/testHTML $$i > result.`basename $$i` ; \
- diff result/HTML/`basename $$i` result.`basename $$i` ; \
- $$DIR/testHTML result.`basename $$i` > result2.`basename $$i` ; \
- diff result.`basename $$i` result2.`basename $$i` ; \
- rm result.`basename $$i` result2.`basename $$i` ; \
+ echo Testing $$name ; \
+ testHTML $$i > result.$$name ; \
+ diff $(srcdir)/result/HTML/$$name result.$$name ; \
+ testHTML result.$$name > result2.$$name ; \
+ diff result.$$name result2.$$name ; \
+ rm result.$$name result2.$$name ; \
fi ; fi ; done)
XMLtests : tester
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/* ; do \
+ @echo "##"
+ @echo "## XML regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/* ; do \
+ name=`basename $$i`; \
if [ ! -d $$i ] ; then \
- if [ ! -f result/`basename $$i` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/tester $$i > result/`basename $$i` ; \
+ if [ ! -f $(srcdir)/result/$$name ] ; then \
+ echo New test file $$name ; \
+ tester $$i > $(srcdir)/result/$$name ; \
else \
- 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` ; \
+ echo Testing $$name ; \
+ tester $$i > result.$$name ; \
+ diff $(srcdir)/result/$$name result.$$name ; \
+ tester result.$$name > result2.$$name ; \
+ diff result.$$name result2.$$name ; \
+ rm result.$$name result2.$$name ; \
fi ; fi ; done)
-SVGtests : tester
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/SVG/* ; do \
+XMLenttests : tester
+ @echo "##"
+ @echo "## XML entity subst regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/* ; do \
+ name=`basename $$i`; \
if [ ! -d $$i ] ; then \
- if [ ! -f result/SVG/`basename $$i` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/tester $$i > result/SVG/`basename $$i` ; \
+ if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
+ echo New test file $$name ; \
+ tester --noent $$i > $(srcdir)/result/noent/$$name ; \
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` ; \
+ echo Testing $$name ; \
+ tester --noent $$i > result.$$name ; \
+ diff $(srcdir)/result/noent/$$name result.$$name ; \
+ tester --noent result.$$name > result2.$$name ; \
+ diff result.$$name result2.$$name ; \
+ rm result.$$name result2.$$name ; \
fi ; fi ; done)
XPathtests : testXPath
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/XPath/expr/* ; do \
+ @echo "##"
+ @echo "## XPath regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/XPath/expr/* ; do \
+ name=`basename $$i`; \
if [ ! -d $$i ] ; then \
- if [ ! -f result/XPath/expr/`basename $$i` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/testXPath -f --expr $$i > result/XPath/expr/`basename $$i` ; \
+ if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
+ echo New test file $$name ; \
+ testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
else \
- echo Testing `basename $$i` ; \
- $$DIR/testXPath -f --expr $$i > result.`basename $$i` ; \
- diff result/XPath/expr/`basename $$i` result.`basename $$i` ; \
- rm result.`basename $$i` ; \
+ echo Testing $$name ; \
+ testXPath -f --expr $$i > result.$$name ; \
+ diff $(srcdir)/result/XPath/expr/$$name result.$$name ; \
+ rm result.$$name ; \
fi ; fi ; done)
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/XPath/docs/* ; do \
+ @(for i in $(srcdir)/test/XPath/docs/* ; do \
if [ ! -d $$i ] ; then \
- name=`basename $$i`; \
- for j in test/XPath/tests/$$name* ; do \
+ doc=`basename $$i`; \
+ for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
+ name=`basename $$j`; \
if [ ! -d $$j ] ; then \
- if [ ! -f result/XPath/tests/`basename $$j` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/testXPath -f -i $$i $$j > result/XPath/tests/`basename $$j` ; \
+ if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
+ echo New test file $$name ; \
+ testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
else \
- echo Testing `basename $$j` ; \
- $$DIR/testXPath -f -i $$i $$j > result.`basename $$j` ; \
- diff result/XPath/tests/`basename $$j` result.`basename $$j` ; \
- rm result.`basename $$j` ; \
+ echo Testing $$name ; \
+ testXPath -f -i $$i $$j > result.$$name ; \
+ diff $(srcdir)/result/XPath/tests/$$name result.$$name ; \
+ rm result.$$name ; \
fi ; fi ; done ; fi ; done)
-SAXtests : testSAX
- @(DIR=`pwd`; cd $(srcdir) ; \
- for i in test/* ; do \
+SVGtests : tester
+ @echo "##"
+ @echo "## SVG parsing regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/SVG/* ; do \
+ name=`basename $$i`; \
if [ ! -d $$i ] ; then \
- if [ ! -f SAXresult/`basename $$i` ] ; then \
- echo New test file `basename $$i` ; \
- $$DIR/testSAX $$i > SAXresult/`basename $$i` ; \
+ if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
+ echo New test file $$name ; \
+ tester $$i > $(srcdir)/result/SVG/$$name ; \
else \
- echo Testing `basename $$i` ; \
- $$DIR/testSAX $$i > result.`basename $$i` ; \
- diff SAXresult/`basename $$i` result.`basename $$i` ; \
- rm result.`basename $$i` ; \
+ echo Testing $$name ; \
+ tester $$i > result.$$name ; \
+ diff $(srcdir)/result/SVG/$$name result.$$name ; \
+ tester result.$$name > result2.$$name ; \
+ diff result.$$name result2.$$name ; \
+ rm result.$$name result2.$$name ; \
fi ; fi ; done)
-## Put `exec' in the name because this should be installed by
-## `install-exec', not `install-data'.
+SAXtests : testSAX
+ @echo "##"
+ @echo "## SAX callbacks regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/* ; do \
+ name=`basename $$i`; \
+ if [ ! -d $$i ] ; then \
+ if [ ! -f $(srcdir)/SAXresult/$$name ] ; then \
+ echo New test file $$name ; \
+ testSAX $$i > $(srcdir)/SAXresult/$$name ; \
+ else \
+ echo Testing $$name ; \
+ testSAX $$i > result.$$name ; \
+ diff $(srcdir)/SAXresult/$$name result.$$name ; \
+ rm result.$$name ; \
+ fi ; fi ; done)
-confexecdir=$(libdir)
-confexec_DATA = xmlConf.sh
-EXTRA_DIST = xmlConf.sh.in libxml.spec.in test result SAXresult example/Makefile.am \
- example/gjobread.c example/gjobs.xml
+Validtests : tester
+ @echo "##"
+ @echo "## Validity checking regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/VC/* ; do \
+ name=`basename $$i`; \
+ if [ ! -d $$i ] ; then \
+ if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
+ echo New test file $$name ; \
+ tester --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
+ else \
+ echo Testing $$name ; \
+ tester --noout --valid $$i 2> result.$$name ; \
+ diff $(srcdir)/result/VC/$$name result.$$name ; \
+ rm result.$$name ; \
+ fi ; fi ; done)
+ @echo "##"
+ @echo "## Valid documents regression tests"
+ @echo "##"
+ @(for i in $(srcdir)/test/valid/* ; do \
+ name=`basename $$i`; \
+ if [ ! -d $$i ] ; then \
+ if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
+ echo New test file $$name ; \
+ tester --valid $$i > $(srcdir)/result/valid/$$name ; \
+ else \
+ echo Testing $$name ; \
+ tester --valid $$i > result.$$name ; \
+ diff $(srcdir)/result/valid/$$name result.$$name ; \
+ rm result.$$name ; \
+ fi ; fi ; done)
dist-hook:
cp libxml.spec $(distdir)
diff --git a/SAX.c b/SAX.c
index 968021ad..28bf0c2f 100644
--- a/SAX.c
+++ b/SAX.c
@@ -132,7 +132,7 @@ hasExternalSubset(void *ctx)
}
/**
- * hasInternalSubset:
+ * internalSubset:
* @ctx: the user data (XML parser context)
*
* Does this document has an internal subset
@@ -141,15 +141,72 @@ void
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);
+ if (((ExternalID != NULL) || (SystemID != NULL)) &&
+ (ctxt->validate && ctxt->wellFormed && ctxt->myDoc)) {
+ /*
+ * Try to fetch and parse the external subset.
+ */
+ xmlDtdPtr ret = NULL;
+ xmlParserCtxtPtr dtdCtxt;
+ xmlParserInputPtr input = NULL;
+ xmlCharEncoding enc;
+
+ dtdCtxt = xmlNewParserCtxt();
+ if (dtdCtxt == NULL) return;
+
+ /*
+ * Ask the Entity resolver to load the damn thing
+ */
+ if ((ctxt->directory != NULL) && (dtdCtxt->directory == NULL))
+ dtdCtxt->directory = xmlStrdup(ctxt->directory);
+
+ if ((dtdCtxt->sax != NULL) && (dtdCtxt->sax->resolveEntity != NULL))
+ input = dtdCtxt->sax->resolveEntity(dtdCtxt->userData, ExternalID,
+ SystemID);
+ if (input == NULL) {
+ xmlFreeParserCtxt(dtdCtxt);
+ return;
+ }
+
+ /*
+ * plug some encoding conversion routines here. !!!
+ */
+ xmlPushInput(dtdCtxt, input);
+ enc = xmlDetectCharEncoding(dtdCtxt->input->cur);
+ xmlSwitchEncoding(dtdCtxt, enc);
+
+ if (input->filename == NULL)
+ input->filename = xmlStrdup(SystemID);
+ input->line = 1;
+ input->col = 1;
+ input->base = dtdCtxt->input->cur;
+ input->cur = dtdCtxt->input->cur;
+ input->free = NULL;
+
+ /*
+ * let's parse that entity knowing it's an external subset.
+ */
+ xmlParseExternalSubset(dtdCtxt, ExternalID, SystemID);
+
+ if (dtdCtxt->myDoc != NULL) {
+ if (dtdCtxt->wellFormed) {
+ ret = dtdCtxt->myDoc->intSubset;
+ dtdCtxt->myDoc->intSubset = NULL;
+ } else {
+ ret = NULL;
+ }
+ xmlFreeDoc(dtdCtxt->myDoc);
+ dtdCtxt->myDoc = NULL;
+ }
+ xmlFreeParserCtxt(dtdCtxt);
+
+ ctxt->myDoc->extSubset = ret;
}
}
@@ -214,6 +271,29 @@ getEntity(void *ctx, const CHAR *name)
return(ret);
}
+/**
+ * getParameterEntity:
+ * @ctx: the user data (XML parser context)
+ * @name: The entity name
+ *
+ * Get a parameter entity by name
+ *
+ * Returns the xmlEntityPtr if found.
+ */
+xmlEntityPtr
+getParameterEntity(void *ctx, const CHAR *name)
+{
+ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlEntityPtr ret;
+
+#ifdef DEBUG_SAX
+ fprintf(stderr, "SAX.getParameterEntity(%s)\n", name);
+#endif
+
+ ret = xmlGetParameterEntity(ctxt->myDoc, name);
+ return(ret);
+}
+
/**
* entityDecl:
@@ -256,13 +336,19 @@ attributeDecl(void *ctx, const CHAR *elem, const CHAR *name,
xmlEnumerationPtr tree)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlAttributePtr attr;
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
elem, name, type, def, defaultValue);
#endif
- xmlAddAttributeDecl(ctxt->myDoc->intSubset, elem, name, type, def,
- defaultValue, tree);
+ attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
+ name, type, def, defaultValue, tree);
+ if (attr == 0) ctxt->valid = 0;
+ if (ctxt->validate && ctxt->wellFormed &&
+ ctxt->myDoc && ctxt->myDoc->intSubset)
+ ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
+ attr);
}
/**
@@ -281,12 +367,19 @@ elementDecl(void *ctx, const CHAR *name, int type,
xmlElementContentPtr content)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlElementPtr elem;
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.elementDecl(%s, %d, ...)\n",
name, type);
#endif
- xmlAddElementDecl(ctxt->myDoc->intSubset, name, type, content);
+
+ elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
+ name, type, content);
+ if (elem == 0) ctxt->valid = 0;
+ if (ctxt->validate && ctxt->wellFormed &&
+ ctxt->myDoc && ctxt->myDoc->intSubset)
+ ctxt->valid &= xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
}
/**
@@ -304,10 +397,19 @@ notationDecl(void *ctx, const CHAR *name,
const CHAR *publicId, const CHAR *systemId)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlNotationPtr nota;
+
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.notationDecl(%s, %s, %s)\n", name, publicId, systemId);
#endif
- xmlAddNotationDecl(ctxt->myDoc->intSubset, name, publicId, systemId);
+
+ nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
+ publicId, systemId);
+ if (nota == 0) ctxt->valid = 0;
+ if (ctxt->validate && ctxt->wellFormed &&
+ ctxt->myDoc && ctxt->myDoc->intSubset)
+ ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
+ nota);
}
/**
@@ -442,8 +544,15 @@ attribute(void *ctx, const CHAR *fullname, const CHAR *value)
}
ret = xmlNewProp(ctxt->node, name, NULL);
+
if ((ret != NULL) && (ctxt->replaceEntities == 0))
ret->val = xmlStringGetNodeList(ctxt->myDoc, value);
+
+ if (ctxt->validate && ctxt->wellFormed &&
+ ctxt->myDoc && ctxt->myDoc->intSubset)
+ ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
+ ctxt->node, ret, value);
+
if (name != NULL)
free(name);
if (ns != NULL)
@@ -569,6 +678,12 @@ endElement(void *ctx, const CHAR *name)
xmlParserAddNodeInfo(ctxt, &node_info);
}
+ if (ctxt->validate && ctxt->wellFormed &&
+ ctxt->myDoc && ctxt->myDoc->intSubset)
+ ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
+ cur);
+
+
/*
* end of parsing of this node.
*/
@@ -821,6 +936,29 @@ comment(void *ctx, const CHAR *value)
#endif
ret = xmlNewDocComment(ctxt->myDoc, value);
xmlAddChild(ctxt->node, ret);
+ /* !!!!! merges */
+}
+
+/**
+ * cdataBlock:
+ * @ctx: the user data (XML parser context)
+ * @value: The pcdata content
+ * @len: the block length
+ *
+ * called when a pcdata block has been parsed
+ */
+void
+cdataBlock(void *ctx, const CHAR *value, int len)
+{
+ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlNodePtr ret;
+
+#ifdef DEBUG_SAX
+ fprintf(stderr, "SAX.pcdata(%s, %d)\n", name, len);
+#endif
+ ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
+ xmlAddChild(ctxt->node, ret);
+ /* !!!!! merges */
}
/*
@@ -851,6 +989,8 @@ xmlSAXHandler xmlDefaultSAXHandler = {
xmlParserWarning,
xmlParserError,
xmlParserError,
+ getParameterEntity,
+ cdataBlock,
};
/**
@@ -867,6 +1007,7 @@ xmlDefaultSAXHandlerInit(void)
xmlDefaultSAXHandler.hasExternalSubset = hasExternalSubset;
xmlDefaultSAXHandler.resolveEntity = resolveEntity;
xmlDefaultSAXHandler.getEntity = getEntity;
+ xmlDefaultSAXHandler.getParameterEntity = getParameterEntity;
xmlDefaultSAXHandler.entityDecl = entityDecl;
xmlDefaultSAXHandler.attributeDecl = attributeDecl;
xmlDefaultSAXHandler.elementDecl = elementDecl;
@@ -879,6 +1020,7 @@ xmlDefaultSAXHandlerInit(void)
xmlDefaultSAXHandler.endElement = endElement;
xmlDefaultSAXHandler.reference = reference;
xmlDefaultSAXHandler.characters = characters;
+ xmlDefaultSAXHandler.cdataBlock = cdataBlock;
xmlDefaultSAXHandler.ignorableWhitespace = ignorableWhitespace;
xmlDefaultSAXHandler.processingInstruction = processingInstruction;
xmlDefaultSAXHandler.comment = comment;
@@ -915,6 +1057,8 @@ xmlSAXHandler htmlDefaultSAXHandler = {
xmlParserWarning,
xmlParserError,
xmlParserError,
+ getParameterEntity,
+ NULL,
};
/**
@@ -931,6 +1075,7 @@ htmlDefaultSAXHandlerInit(void)
htmlDefaultSAXHandler.hasExternalSubset = NULL;
htmlDefaultSAXHandler.resolveEntity = NULL;
htmlDefaultSAXHandler.getEntity = getEntity;
+ htmlDefaultSAXHandler.getParameterEntity = NULL;
htmlDefaultSAXHandler.entityDecl = NULL;
htmlDefaultSAXHandler.attributeDecl = NULL;
htmlDefaultSAXHandler.elementDecl = NULL;
@@ -943,6 +1088,7 @@ htmlDefaultSAXHandlerInit(void)
htmlDefaultSAXHandler.endElement = endElement;
htmlDefaultSAXHandler.reference = NULL;
htmlDefaultSAXHandler.characters = characters;
+ htmlDefaultSAXHandler.cdataBlock = NULL;
htmlDefaultSAXHandler.ignorableWhitespace = ignorableWhitespace;
htmlDefaultSAXHandler.processingInstruction = NULL;
htmlDefaultSAXHandler.comment = comment;
diff --git a/TODO b/TODO
index 84167631..f3ab844d 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,8 @@
TODO for the XML parser:
+- use libunicode !
+- finish XPath, then XPointer, Xlink
- Support for UTF-8 and UTF-16 encoding (Urgent !!!).
- progressive parsing. The entity support is a first step toward
asbtraction of an input stream. A large part of the context is still
diff --git a/acconfig.h b/acconfig.h
index e89b2af3..6d79490b 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,3 +1,6 @@
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
+#undef HAVE_LIBM
+#undef HAVE_ISINF
+#undef HAVE_ISNAN
diff --git a/config.h.in b/config.h.in
index 6778ed02..97a7bd12 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,6 +9,30 @@
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
+#undef HAVE_LIBM
+#undef HAVE_ISINF
+#undef HAVE_ISNAN
+
+/* Define if you have the class function. */
+#undef HAVE_CLASS
+
+/* Define if you have the finite function. */
+#undef HAVE_FINITE
+
+/* Define if you have the fp_class function. */
+#undef HAVE_FP_CLASS
+
+/* Define if you have the fpclass function. */
+#undef HAVE_FPCLASS
+
+/* Define if you have the isinf function. */
+#undef HAVE_ISINF
+
+/* Define if you have the isnan function. */
+#undef HAVE_ISNAN
+
+/* Define if you have the isnand function. */
+#undef HAVE_ISNAND
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
@@ -34,9 +58,24 @@
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define if you have the <fp_class.h> header file. */
+#undef HAVE_FP_CLASS_H
+
+/* Define if you have the <ieeefp.h> header file. */
+#undef HAVE_IEEEFP_H
+
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
+/* Define if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define if you have the <nan.h> header file. */
+#undef HAVE_NAN_H
+
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
diff --git a/configure.in b/configure.in
index 93328050..35294a6c 100644
--- a/configure.in
+++ b/configure.in
@@ -4,7 +4,7 @@ AC_INIT(entities.h)
AM_CONFIG_HEADER(config.h)
LIBXML_MAJOR_VERSION=1
-LIBXML_MINOR_VERSION=4
+LIBXML_MINOR_VERSION=5
LIBXML_MICRO_VERSION=0
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -39,11 +39,13 @@ AC_CHECK_LIB(z, inflate,
AC_CHECK_HEADER(zlib.h,
Z_LIBS="-lz"; AC_DEFINE(HAVE_LIBZ)))
+
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h zlib.h)
+AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
dnl Specific dir for HTML output ?
if test "x$with_html_dir" = "x" ; then
@@ -54,15 +56,6 @@ fi
AC_SUBST(HTML_DIR)
-XML_LIBDIR='-L${libdir}'
-XML_INCLUDEDIR='-I${includedir}/gnome-xml'
-XML_LIBS="-lxml $Z_LIBS"
-
-AC_SUBST(XML_LIBDIR)
-AC_SUBST(XML_LIBS)
-AC_SUBST(XML_INCLUDEDIR)
-AC_SUBST(HTML_DIR)
-
AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
dnl
@@ -75,7 +68,41 @@ AC_SUBST(CORBA_CFLAGS)
dnl Checks for library functions.
AC_FUNC_STRFTIME
-AC_CHECK_FUNCS(strdup strndup strerror snprintf )
+AC_CHECK_FUNCS(strdup strndup strerror snprintf)
+AC_CHECK_FUNCS(finite isinf isnan isnand fp_class class fpclass finite)
+
+dnl Checks for isnan in libm if not in libc
+M_LIBS=
+if test "$ac_cv_func_isnan" != "yes"
+then
+AC_CHECK_LIB(m, isnan,
+ M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN))
+fi
+
+dnl Checks for isinf in libm if not in libc
+if test "$ac_cv_func_isinf" != "yes"
+then
+M2_LIBS=""
+AC_CHECK_LIB(m, isinf,
+ M2_LIBS="-lm"; AC_DEFINE(HAVE_ISINF))
+if test "$M2_LIBS" != ""
+then
+ M_LIBS="$M2_LIBS"
+fi
+fi
+
+XML_LIBDIR='-L${libdir}'
+XML_INCLUDEDIR='-I${includedir}/gnome-xml'
+XML_LIBS="-lxml $Z_LIBS $M_LIBS"
+
+AC_SUBST(XML_LIBDIR)
+AC_SUBST(XML_LIBS)
+AC_SUBST(XML_INCLUDEDIR)
+AC_SUBST(HTML_DIR)
+AC_SUBST(HAVE_ISNAN)
+AC_SUBST(HAVE_ISINF)
+
AC_SUBST(Z_LIBS)
+AC_SUBST(M_LIBS)
AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xml-config)
diff --git a/doc/html/gnome-xml-entities.html b/doc/html/gnome-xml-entities.html
index 0a27454b..2ebcc419 100644
--- a/doc/html/gnome-xml-entities.html
+++ b/doc/html/gnome-xml-entities.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN3699"
+NAME="AEN3763"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN3699"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN3702"
+NAME="AEN3766"
></A
><H2
>Synopsis</H2
@@ -260,6 +260,20 @@ HREF="gnome-xml-tree.html#XMLDOCPTR"
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *name);
+<A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> <A
+HREF="gnome-xml-entities.html#XMLGETPARAMETERENTITY"
+>xmlGetParameterEntity</A
+> (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);
const <A
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
@@ -330,7 +344,7 @@ HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN3755"
+NAME="AEN3823"
></A
><H2
>Description</H2
@@ -340,14 +354,14 @@ NAME="AEN3755"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN3758"
+NAME="AEN3826"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3760"
+NAME="AEN3828"
></A
><H3
><A
@@ -363,7 +377,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_INTERNAL_GENERAL_ENTITY 1</PRE
+>#define XML_INTERNAL_GENERAL_ENTITY</PRE
></TD
></TR
></TABLE
@@ -373,7 +387,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3765"
+NAME="AEN3833"
></A
><H3
><A
@@ -389,7 +403,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_EXTERNAL_GENERAL_PARSED_ENTITY 2</PRE
+>#define XML_EXTERNAL_GENERAL_PARSED_ENTITY</PRE
></TD
></TR
></TABLE
@@ -399,7 +413,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3770"
+NAME="AEN3838"
></A
><H3
><A
@@ -415,7 +429,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY 3</PRE
+>#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY</PRE
></TD
></TR
></TABLE
@@ -425,7 +439,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3775"
+NAME="AEN3843"
></A
><H3
><A
@@ -441,7 +455,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_INTERNAL_PARAMETER_ENTITY 4</PRE
+>#define XML_INTERNAL_PARAMETER_ENTITY</PRE
></TD
></TR
></TABLE
@@ -451,7 +465,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3780"
+NAME="AEN3848"
></A
><H3
><A
@@ -467,7 +481,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_EXTERNAL_PARAMETER_ENTITY 5</PRE
+>#define XML_EXTERNAL_PARAMETER_ENTITY</PRE
></TD
></TR
></TABLE
@@ -477,7 +491,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3785"
+NAME="AEN3853"
></A
><H3
><A
@@ -493,7 +507,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_INTERNAL_PREDEFINED_ENTITY 6</PRE
+>#define XML_INTERNAL_PREDEFINED_ENTITY</PRE
></TD
></TR
></TABLE
@@ -503,33 +517,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3790"
+NAME="AEN3858"
></A
><H3
><A
NAME="XMLENTITYPTR"
></A
>xmlEntityPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlEntity *xmlEntityPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3795"
+NAME="AEN3862"
></A
><H3
><A
@@ -545,7 +546,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_MIN_ENTITIES_TABLE 32</PRE
+>#define XML_MIN_ENTITIES_TABLE</PRE
></TD
></TR
></TABLE
@@ -555,33 +556,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3800"
+NAME="AEN3867"
></A
><H3
><A
NAME="XMLENTITIESTABLEPTR"
></A
>xmlEntitiesTablePtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlEntitiesTable *xmlEntitiesTablePtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3805"
+NAME="AEN3871"
></A
><H3
><A
@@ -651,7 +639,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -668,7 +656,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -685,7 +673,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity type XML_xxx_yyy_ENTITY</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -702,7 +690,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity external ID if available</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -719,7 +707,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity system ID if available</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -736,7 +724,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity content</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -746,7 +734,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3845"
+NAME="AEN3911"
></A
><H3
><A
@@ -816,7 +804,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -833,7 +821,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -850,7 +838,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity type XML_xxx_yyy_ENTITY</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -867,7 +855,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity external ID if available</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -884,7 +872,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity system ID if available</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -901,7 +889,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity content</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -911,7 +899,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3885"
+NAME="AEN3951"
></A
><H3
><A
@@ -967,7 +955,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -982,7 +970,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->NULL if not, othervise the entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -992,7 +980,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3906"
+NAME="AEN3972"
></A
><H3
><A
@@ -1054,7 +1042,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document referencing the entity</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1071,7 +1059,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1086,7 +1074,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->A pointer to the entity structure or NULL if not found.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1096,7 +1084,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3932"
+NAME="AEN3998"
></A
><H3
><A
@@ -1157,7 +1145,110 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document referencing the entity</TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4024"
+></A
+><H3
+><A
+NAME="XMLGETPARAMETERENTITY"
+></A
+>xmlGetParameterEntity ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> xmlGetParameterEntity (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Do an entity lookup in the internal and external subsets and
+returns the corresponding parameter entity, if found.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1174,7 +1265,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1189,7 +1280,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->A pointer to the entity structure or NULL if not found.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1199,7 +1290,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3958"
+NAME="AEN4050"
></A
><H3
><A
@@ -1233,13 +1324,10 @@ HREF="gnome-xml-tree.html#CHAR"
>Do a global encoding of a string, replacing the predefined entities
and non ASCII values with their entities and CharRef counterparts.</P
><P
->TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
-get erroneous.</P
-><P
->TODO This routine is not reentrant, the interface
-should not be modified though.</P
+>TODO: remove this, once we are not afraid of breaking binary compatibility</P
><P
->People must migrate their code to xmlEncodeEntitiesReentrant !</P
+>People must migrate their code to xmlEncodeEntitiesReentrant !
+This routine will issue a warning when encountered.</P
><P
></P
><DIV
@@ -1268,7 +1356,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document containing the string</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1285,7 +1373,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> A string to convert to XML.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1300,7 +1388,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->A newly allocated string with the substitution done.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1310,7 +1398,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3987"
+NAME="AEN4078"
></A
><H3
><A
@@ -1376,7 +1464,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document containing the string</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1393,7 +1481,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> A string to convert to XML.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1408,7 +1496,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->A newly allocated string with the substitution done.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1418,7 +1506,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4014"
+NAME="AEN4105"
></A
><H3
><A
@@ -1469,7 +1557,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlEntitiesTablePtr just created or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1479,7 +1567,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4030"
+NAME="AEN4121"
></A
><H3
><A
@@ -1535,7 +1623,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An entity table</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1550,7 +1638,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new xmlEntitiesTablePtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1560,7 +1648,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4051"
+NAME="AEN4142"
></A
><H3
><A
@@ -1613,7 +1701,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An entity table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1623,7 +1711,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4067"
+NAME="AEN4158"
></A
><H3
><A
@@ -1680,7 +1768,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An XML buffer.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1697,7 +1785,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An entity table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-htmlparser.html b/doc/html/gnome-xml-htmlparser.html
index 119e226d..ebf2e9ba 100644
--- a/doc/html/gnome-xml-htmlparser.html
+++ b/doc/html/gnome-xml-htmlparser.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN6506"
+NAME="AEN7224"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN6506"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN6509"
+NAME="AEN7227"
></A
><H2
>Synopsis</H2
@@ -277,7 +277,7 @@ HREF="gnome-xml-htmlparser.html#HTMLPARSEFILE"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6547"
+NAME="AEN7265"
></A
><H2
>Description</H2
@@ -287,248 +287,131 @@ NAME="AEN6547"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6550"
+NAME="AEN7268"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6552"
+NAME="AEN7270"
></A
><H3
><A
NAME="HTMLPARSERCTXT"
></A
>htmlParserCtxt</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserCtxt htmlParserCtxt;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6557"
+NAME="AEN7274"
></A
><H3
><A
NAME="HTMLPARSERCTXTPTR"
></A
>htmlParserCtxtPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserCtxtPtr htmlParserCtxtPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6562"
+NAME="AEN7278"
></A
><H3
><A
NAME="HTMLPARSERNODEINFO"
></A
>htmlParserNodeInfo</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserNodeInfo htmlParserNodeInfo;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6567"
+NAME="AEN7282"
></A
><H3
><A
NAME="HTMLSAXHANDLER"
></A
>htmlSAXHandler</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlSAXHandler htmlSAXHandler;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6572"
+NAME="AEN7286"
></A
><H3
><A
NAME="HTMLSAXHANDLERPTR"
></A
>htmlSAXHandlerPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6577"
+NAME="AEN7290"
></A
><H3
><A
NAME="HTMLPARSERINPUT"
></A
>htmlParserInput</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserInput htmlParserInput;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6582"
+NAME="AEN7294"
></A
><H3
><A
NAME="HTMLPARSERINPUTPTR"
></A
>htmlParserInputPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserInputPtr htmlParserInputPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6587"
+NAME="AEN7298"
></A
><H3
><A
NAME="HTMLDOCPTR"
></A
>htmlDocPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlDocPtr htmlDocPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6592"
+NAME="AEN7302"
></A
><H3
><A
NAME="HTMLNODEPTR"
></A
>htmlNodePtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlNodePtr htmlNodePtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6597"
+NAME="AEN7306"
></A
><H3
><A
@@ -584,7 +467,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> The tag name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -599,7 +482,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the related htmlElemDescPtr or NULL if not found.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -609,7 +492,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6618"
+NAME="AEN7327"
></A
><H3
><A
@@ -667,7 +550,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -682,7 +565,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the associated htmlEntityDescPtr if found, NULL otherwise.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -692,7 +575,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6640"
+NAME="AEN7349"
></A
><H3
><A
@@ -754,7 +637,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an HTML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -771,7 +654,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> location to store the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -786,8 +669,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the associated htmlEntityDescPtr if found, or NULL otherwise,
-if non-NULL *str will have to be freed by the caller.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -797,7 +679,7 @@ if non-NULL *str will have to be freed by the caller.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6667"
+NAME="AEN7376"
></A
><H3
><A
@@ -856,7 +738,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an HTML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -871,7 +753,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the value parsed (as an int)</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -881,7 +763,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6689"
+NAME="AEN7398"
></A
><H3
><A
@@ -938,7 +820,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an HTML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -948,7 +830,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6707"
+NAME="AEN7416"
></A
><H3
><A
@@ -1012,7 +894,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1029,7 +911,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a free form C string describing the HTML document encoding, or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1046,7 +928,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1063,7 +945,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if using SAX, this pointer will be provided on callbacks. </TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1078,7 +960,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1088,7 +970,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6741"
+NAME="AEN7450"
></A
><H3
><A
@@ -1145,7 +1027,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1162,7 +1044,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a free form C string describing the HTML document encoding, or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1177,7 +1059,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1187,7 +1069,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6766"
+NAME="AEN7475"
></A
><H3
><A
@@ -1249,7 +1131,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1266,7 +1148,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a free form C string describing the HTML document encoding, or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1283,7 +1165,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1300,7 +1182,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if using SAX, this pointer will be provided on callbacks. </TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1315,7 +1197,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1325,7 +1207,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6799"
+NAME="AEN7508"
></A
><H3
><A
@@ -1380,7 +1262,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1397,7 +1279,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a free form C string describing the HTML document encoding, or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1412,7 +1294,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-htmltree.html b/doc/html/gnome-xml-htmltree.html
index 9eee850e..249070b1 100644
--- a/doc/html/gnome-xml-htmltree.html
+++ b/doc/html/gnome-xml-htmltree.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN6828"
+NAME="AEN7537"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN6828"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN6831"
+NAME="AEN7540"
></A
><H2
>Synopsis</H2
@@ -188,7 +188,7 @@ HREF="gnome-xml-tree.html#XMLDOCPTR"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6845"
+NAME="AEN7554"
></A
><H2
>Description</H2
@@ -198,14 +198,14 @@ NAME="AEN6845"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6848"
+NAME="AEN7557"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6850"
+NAME="AEN7559"
></A
><H3
><A
@@ -221,7 +221,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define HTML_TEXT_NODE XML_TEXT_NODE</PRE
+>#define HTML_TEXT_NODE</PRE
></TD
></TR
></TABLE
@@ -231,7 +231,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6855"
+NAME="AEN7564"
></A
><H3
><A
@@ -247,7 +247,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE</PRE
+>#define HTML_ENTITY_REF_NODE</PRE
></TD
></TR
></TABLE
@@ -257,7 +257,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6860"
+NAME="AEN7569"
></A
><H3
><A
@@ -273,7 +273,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define HTML_COMMENT_NODE XML_COMMENT_NODE</PRE
+>#define HTML_COMMENT_NODE</PRE
></TD
></TR
></TABLE
@@ -283,7 +283,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6865"
+NAME="AEN7574"
></A
><H3
><A
@@ -342,7 +342,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -359,7 +359,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> OUT: the memory pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -376,7 +376,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> OUT: the memory lenght</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -386,7 +386,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6890"
+NAME="AEN7599"
></A
><H3
><A
@@ -443,7 +443,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the FILE*</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -460,7 +460,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -470,7 +470,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6911"
+NAME="AEN7620"
></A
><H3
><A
@@ -524,7 +524,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -541,7 +541,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -556,7 +556,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the number of byte written or -1 in case of failure.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-parser.html b/doc/html/gnome-xml-parser.html
index e3e998cd..2f4f348c 100644
--- a/doc/html/gnome-xml-parser.html
+++ b/doc/html/gnome-xml-parser.html
@@ -165,6 +165,10 @@ typedef <A
HREF="gnome-xml-parser.html#XMLPARSERNODEINFOSEQPTR"
>xmlParserNodeInfoSeqPtr</A
>;
+enum <A
+HREF="gnome-xml-parser.html#XMLPARSERINPUTSTATE"
+>xmlParserInputState</A
+>;
typedef <A
HREF="gnome-xml-parser.html#XMLPARSERCTXT"
>xmlParserCtxt</A
@@ -223,6 +227,17 @@ HREF="gnome-xml-parser.html#GETENTITYSAXFUNC"
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *name);
+<A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> (<A
+HREF="gnome-xml-parser.html#GETPARAMETERENTITYSAXFUNC"
+>*getParameterEntitySAXFunc</A
+>) (void *ctx,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);
void (<A
HREF="gnome-xml-parser.html#ENTITYDECLSAXFUNC"
>*entityDeclSAXFunc</A
@@ -410,6 +425,15 @@ HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *value);
void (<A
+HREF="gnome-xml-parser.html#CDATABLOCKSAXFUNC"
+>*cdataBlockSAXFunc</A
+>) (void *ctx,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *value,
+ int len);
+void (<A
HREF="gnome-xml-parser.html#WARNINGSAXFUNC"
>*warningSAXFunc</A
>) (void *ctx,
@@ -823,7 +847,7 @@ HREF="gnome-xml-parser.html#HTMLDEFAULTSAXHANDLERINIT"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN192"
+NAME="AEN198"
></A
><H2
>Description</H2
@@ -833,14 +857,14 @@ NAME="AEN192"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN195"
+NAME="AEN201"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN197"
+NAME="AEN203"
></A
><H3
><A
@@ -856,7 +880,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_DEFAULT_VERSION "1.0"</PRE
+>#define XML_DEFAULT_VERSION</PRE
></TD
></TR
></TABLE
@@ -866,7 +890,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN202"
+NAME="AEN208"
></A
><H3
><A
@@ -927,91 +951,65 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN217"
+NAME="AEN223"
></A
><H3
><A
NAME="XMLPARSERINPUTPTR"
></A
>xmlParserInputPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserInput *xmlParserInputPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN222"
+NAME="AEN227"
></A
><H3
><A
NAME="XMLPARSERNODEINFO"
></A
>xmlParserNodeInfo</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlParserNodeInfo xmlParserNodeInfo;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN227"
+NAME="AEN231"
></A
><H3
><A
NAME="XMLPARSERNODEINFOSEQ"
></A
>xmlParserNodeInfoSeq</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN232"
+NAME="AEN235"
></A
><H3
><A
NAME="XMLPARSERNODEINFOSEQPTR"
></A
>xmlParserNodeInfoSeqPtr</H3
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN239"
+></A
+><H3
+><A
+NAME="XMLPARSERINPUTSTATE"
+></A
+>enum xmlParserInputState</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -1021,7 +1019,18 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;</PRE
+>typedef enum xmlParserInputState {
+ XML_PARSER_EOF = 0,
+ XML_PARSER_PROLOG,
+ XML_PARSER_CONTENT,
+ XML_PARSER_ENTITY_DECL,
+ XML_PARSER_ENTITY_VALUE,
+ XML_PARSER_ATTRIBUTE_VALUE,
+ XML_PARSER_DTD,
+ XML_PARSER_EPILOG,
+ XML_PARSER_COMMENT,
+ XML_PARSER_CDATA_SECTION,
+} xmlParserInputState;</PRE
></TD
></TR
></TABLE
@@ -1031,111 +1040,59 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN237"
+NAME="AEN244"
></A
><H3
><A
NAME="XMLPARSERCTXT"
></A
>xmlParserCtxt</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlParserCtxt xmlParserCtxt;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN242"
+NAME="AEN248"
></A
><H3
><A
NAME="XMLPARSERCTXTPTR"
></A
>xmlParserCtxtPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlParserCtxt *xmlParserCtxtPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN247"
+NAME="AEN252"
></A
><H3
><A
NAME="XMLSAXLOCATOR"
></A
>xmlSAXLocator</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlSAXLocator xmlSAXLocator;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN252"
+NAME="AEN256"
></A
><H3
><A
NAME="XMLSAXLOCATORPTR"
></A
>xmlSAXLocatorPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlSAXLocator *xmlSAXLocatorPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN257"
+NAME="AEN260"
></A
><H3
><A
@@ -1253,7 +1210,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN286"
+NAME="AEN289"
></A
><H3
><A
@@ -1374,7 +1331,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN315"
+NAME="AEN318"
></A
><H3
><A
@@ -1471,7 +1428,104 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN339"
+NAME="AEN342"
+></A
+><H3
+><A
+NAME="GETPARAMETERENTITYSAXFUNC"
+></A
+>getParameterEntitySAXFunc ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-entities.html#XMLENTITYPTR"
+>xmlEntityPtr</A
+> (*getParameterEntitySAXFunc) (void *ctx,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN366"
></A
><H3
><A
@@ -1631,7 +1685,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN377"
+NAME="AEN404"
></A
><H3
><A
@@ -1752,7 +1806,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN406"
+NAME="AEN433"
></A
><H3
><A
@@ -1930,7 +1984,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN448"
+NAME="AEN475"
></A
><H3
><A
@@ -2048,7 +2102,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN476"
+NAME="AEN503"
></A
><H3
><A
@@ -2190,7 +2244,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN510"
+NAME="AEN537"
></A
><H3
><A
@@ -2269,7 +2323,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN529"
+NAME="AEN556"
></A
><H3
><A
@@ -2327,7 +2381,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN543"
+NAME="AEN570"
></A
><H3
><A
@@ -2385,7 +2439,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN557"
+NAME="AEN584"
></A
><H3
><A
@@ -2485,7 +2539,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN581"
+NAME="AEN608"
></A
><H3
><A
@@ -2564,7 +2618,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN600"
+NAME="AEN627"
></A
><H3
><A
@@ -2664,7 +2718,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN624"
+NAME="AEN651"
></A
><H3
><A
@@ -2743,7 +2797,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN643"
+NAME="AEN670"
></A
><H3
><A
@@ -2840,7 +2894,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN666"
+NAME="AEN693"
></A
><H3
><A
@@ -2937,7 +2991,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN689"
+NAME="AEN716"
></A
><H3
><A
@@ -3037,7 +3091,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN713"
+NAME="AEN740"
></A
><H3
><A
@@ -3116,7 +3170,104 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN732"
+NAME="AEN759"
+></A
+><H3
+><A
+NAME="CDATABLOCKSAXFUNC"
+></A
+>cdataBlockSAXFunc ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>void (*cdataBlockSAXFunc) (void *ctx,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *value,
+ int len);</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>value</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</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"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN782"
></A
><H3
><A
@@ -3210,7 +3361,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN754"
+NAME="AEN804"
></A
><H3
><A
@@ -3304,7 +3455,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN776"
+NAME="AEN826"
></A
><H3
><A
@@ -3398,7 +3549,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN798"
+NAME="AEN848"
></A
><H3
><A
@@ -3471,7 +3622,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN816"
+NAME="AEN866"
></A
><H3
><A
@@ -3544,7 +3695,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN834"
+NAME="AEN884"
></A
><H3
><A
@@ -3617,33 +3768,20 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN852"
+NAME="AEN902"
></A
><H3
><A
NAME="XMLSAXHANDLERPTR"
></A
>xmlSAXHandlerPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlSAXHandler *xmlSAXHandlerPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN857"
+NAME="AEN906"
></A
><H3
><A
@@ -3669,7 +3807,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN862"
+NAME="AEN911"
></A
><H3
><A
@@ -3695,7 +3833,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN867"
+NAME="AEN916"
></A
><H3
><A
@@ -3721,7 +3859,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN872"
+NAME="AEN921"
></A
><H3
><A
@@ -3747,7 +3885,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN877"
+NAME="AEN926"
></A
><H3
><A
@@ -3802,7 +3940,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser input</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3819,7 +3957,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an indicative size for the lookahead</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3834,8 +3972,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the number of CHARs read, or -1 in case of error, 0 indicate the
-end of this entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3845,7 +3982,7 @@ end of this entity</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN901"
+NAME="AEN950"
></A
><H3
><A
@@ -3900,7 +4037,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser input</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3917,7 +4054,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an indicative size for the lookahead</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3932,8 +4069,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the number of CHARs read, or -1 in case of error, 0 indicate the
-end of this entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3943,7 +4079,7 @@ end of this entity</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN925"
+NAME="AEN974"
></A
><H3
><A
@@ -3999,7 +4135,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the input CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4014,7 +4150,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new CHAR * or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4024,7 +4160,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN946"
+NAME="AEN995"
></A
><H3
><A
@@ -4081,7 +4217,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the input CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4098,12 +4234,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the len of <TT
-CLASS="PARAMETER"
-><I
->cur</I
-></TT
-></TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4118,7 +4249,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new CHAR * or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4128,7 +4259,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN972"
+NAME="AEN1020"
></A
><H3
><A
@@ -4186,7 +4317,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array (haystack)</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4203,7 +4334,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the index of the first char (zero based)</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4220,7 +4351,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the length of the substring</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4235,7 +4366,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the CHAR * for the first occurence or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4245,7 +4376,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1001"
+NAME="AEN1049"
></A
><H3
><A
@@ -4305,7 +4436,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4322,7 +4453,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR to search</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4337,7 +4468,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the CHAR * for the first occurence or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4347,7 +4478,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1027"
+NAME="AEN1075"
></A
><H3
><A
@@ -4407,7 +4538,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array (haystack)</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4424,7 +4555,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR to search (needle)</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4439,7 +4570,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the CHAR * for the first occurence or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4449,7 +4580,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1053"
+NAME="AEN1101"
></A
><H3
><A
@@ -4506,7 +4637,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4523,7 +4654,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the second CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4538,7 +4669,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the integer result of the comparison</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4548,7 +4679,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1078"
+NAME="AEN1126"
></A
><H3
><A
@@ -4606,7 +4737,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4623,7 +4754,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the second CHAR *</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4640,7 +4771,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the max comparison length</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4655,7 +4786,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the integer result of the comparison</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4665,7 +4796,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1107"
+NAME="AEN1155"
></A
><H3
><A
@@ -4718,7 +4849,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4733,7 +4864,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the number of CHAR contained in the ARRAY.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4743,7 +4874,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1127"
+NAME="AEN1175"
></A
><H3
><A
@@ -4803,7 +4934,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the original CHAR * array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4820,7 +4951,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array added</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4835,7 +4966,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new CHAR * containing the concatenated string.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4845,7 +4976,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1153"
+NAME="AEN1201"
></A
><H3
><A
@@ -4906,7 +5037,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the original CHAR * array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4923,7 +5054,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR * array added</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4940,12 +5071,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the length of <TT
-CLASS="PARAMETER"
-><I
->add</I
-></TT
-></TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4960,7 +5086,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new CHAR * containing the concatenated string.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4970,7 +5096,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1184"
+NAME="AEN1231"
></A
><H3
><A
@@ -5026,7 +5152,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5041,7 +5167,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5051,7 +5177,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1205"
+NAME="AEN1252"
></A
><H3
><A
@@ -5105,7 +5231,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an pointer to a char array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5122,7 +5248,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the size of the array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5137,7 +5263,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5147,7 +5273,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1229"
+NAME="AEN1276"
></A
><H3
><A
@@ -5201,7 +5327,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5216,7 +5342,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5226,7 +5352,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1249"
+NAME="AEN1296"
></A
><H3
><A
@@ -5284,7 +5410,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> int 0 or 1 </TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5299,7 +5425,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the last value for 0 for no substitution, 1 for substitution.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5309,7 +5435,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1269"
+NAME="AEN1316"
></A
><H3
><A
@@ -5366,7 +5492,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5381,7 +5507,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5391,7 +5517,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1290"
+NAME="AEN1337"
></A
><H3
><A
@@ -5446,7 +5572,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an pointer to a char array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5463,7 +5589,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the size of the array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5478,7 +5604,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5488,7 +5614,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1314"
+NAME="AEN1361"
></A
><H3
><A
@@ -5543,7 +5669,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5558,7 +5684,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5568,7 +5694,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1334"
+NAME="AEN1381"
></A
><H3
><A
@@ -5626,7 +5752,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5641,8 +5767,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->0, -1 in case of error. the parser context is augmented
-as a result of the parsing.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5652,7 +5777,7 @@ as a result of the parsing.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1356"
+NAME="AEN1403"
></A
><H3
><A
@@ -5715,7 +5840,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5732,7 +5857,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5749,8 +5874,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> work in recovery mode, i.e. tries to read no Well Formed
-documents</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5765,7 +5889,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5775,7 +5899,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1386"
+NAME="AEN1433"
></A
><H3
><A
@@ -5836,7 +5960,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5853,7 +5977,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an pointer to a char array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5870,7 +5994,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the siwe of the array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5887,8 +6011,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> work in recovery mode, i.e. tries to read no Well Formed
-documents</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5903,7 +6026,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5913,7 +6036,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1419"
+NAME="AEN1466"
></A
><H3
><A
@@ -5974,7 +6097,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5991,7 +6114,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6008,8 +6131,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> work in recovery mode, i.e. tries to read no Well Formed
-documents</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6024,7 +6146,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting document tree</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6034,7 +6156,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1448"
+NAME="AEN1495"
></A
><H3
><A
@@ -6094,7 +6216,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a NAME* containing the External ID of the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6111,7 +6233,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a NAME* containing the URL to the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6126,7 +6248,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting xmlDtdPtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6136,7 +6258,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1474"
+NAME="AEN1521"
></A
><H3
><A
@@ -6200,7 +6322,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the SAX handler block</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6217,7 +6339,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a NAME* containing the External ID of the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6234,7 +6356,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a NAME* containing the URL to the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6249,7 +6371,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the resulting xmlDtdPtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6259,7 +6381,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1505"
+NAME="AEN1552"
></A
><H3
><A
@@ -6312,7 +6434,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an HTML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6322,7 +6444,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1521"
+NAME="AEN1568"
></A
><H3
><A
@@ -6375,7 +6497,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6385,7 +6507,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1537"
+NAME="AEN1584"
></A
><H3
><A
@@ -6445,7 +6567,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6462,7 +6584,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a CHAR * buffer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6479,7 +6601,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a file name</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6489,7 +6611,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1562"
+NAME="AEN1609"
></A
><H3
><A
@@ -6550,7 +6672,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6567,7 +6689,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML node within the tree</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6582,7 +6704,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->an xmlParserNodeInfo block pointer or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6592,7 +6714,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1588"
+NAME="AEN1635"
></A
><H3
><A
@@ -6645,7 +6767,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a node info sequence pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6655,7 +6777,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1604"
+NAME="AEN1651"
></A
><H3
><A
@@ -6709,7 +6831,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a node info sequence pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6719,7 +6841,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1620"
+NAME="AEN1667"
></A
><H3
><A
@@ -6780,7 +6902,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a node info sequence pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6797,7 +6919,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML node pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6812,7 +6934,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a long indicating the position of the record</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6822,7 +6944,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1646"
+NAME="AEN1693"
></A
><H3
><A
@@ -6879,7 +7001,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6896,7 +7018,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a node info sequence pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6906,7 +7028,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1667"
+NAME="AEN1714"
></A
><H3
><A
@@ -6934,7 +7056,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1673"
+NAME="AEN1720"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-parserinternals.html b/doc/html/gnome-xml-parserinternals.html
index bf3cd988..944c4e95 100644
--- a/doc/html/gnome-xml-parserinternals.html
+++ b/doc/html/gnome-xml-parserinternals.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN4681"
+NAME="AEN5221"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN4681"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN4684"
+NAME="AEN5224"
></A
><H2
>Synopsis</H2
@@ -138,6 +138,18 @@ CELLPADDING="6"
CLASS="SYNOPSIS"
>&#13;
+typedef <A
+HREF="gnome-xml-parserinternals.html#CHARVAL"
+>CHARVAL</A
+>;
+#define <A
+HREF="gnome-xml-parserinternals.html#NEXTCHARVAL"
+>NEXTCHARVAL</A
+> (p)
+#define <A
+HREF="gnome-xml-parserinternals.html#SKIPCHARVAL"
+>SKIPCHARVAL</A
+> (p)
#define <A
HREF="gnome-xml-parserinternals.html#IS-CHAR"
>IS_CHAR</A
@@ -218,6 +230,24 @@ HREF="gnome-xml-parserinternals.html#XMLFREEPARSERCTXT"
HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>xmlParserCtxtPtr</A
> ctxt);
+<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> <A
+HREF="gnome-xml-parserinternals.html#XMLNEWPARSERCTXT"
+>xmlNewParserCtxt</A
+> ();
+void <A
+HREF="gnome-xml-parserinternals.html#XMLSWITCHENCODING"
+>xmlSwitchEncoding</A
+> (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+ <GTKDOCLINK
+HREF="XMLCHARENCODING"
+>xmlCharEncoding</GTKDOCLINK
+> enc);
void <A
HREF="gnome-xml-parserinternals.html#XMLHANDLEENTITY"
>xmlHandleEntity</A
@@ -351,6 +381,16 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
>* <A
+HREF="gnome-xml-parserinternals.html#XMLSCANNAME"
+>xmlScanName</A
+> (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt);
+<A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+>* <A
HREF="gnome-xml-parserinternals.html#XMLPARSENAME"
>xmlParseName</A
> (<A
@@ -739,6 +779,21 @@ HREF="gnome-xml-parserinternals.html#XMLPARSEMISC"
HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>xmlParserCtxtPtr</A
> ctxt);
+void <A
+HREF="gnome-xml-parserinternals.html#XMLPARSEEXTERNALSUBSET"
+>xmlParseExternalSubset</A
+> (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *ExternalID,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *SystemID);
#define <A
HREF="gnome-xml-parserinternals.html#XML-SUBSTITUTE-NONE"
>XML_SUBSTITUTE_NONE</A
@@ -828,7 +883,7 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4879"
+NAME="AEN5434"
></A
><H2
>Description</H2
@@ -838,14 +893,143 @@ NAME="AEN4879"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4882"
+NAME="AEN5437"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4884"
+NAME="AEN5439"
+></A
+><H3
+><A
+NAME="CHARVAL"
+></A
+>CHARVAL</H3
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5443"
+></A
+><H3
+><A
+NAME="NEXTCHARVAL"
+></A
+>NEXTCHARVAL()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define NEXTCHARVAL(p)</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>p</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5457"
+></A
+><H3
+><A
+NAME="SKIPCHARVAL"
+></A
+>SKIPCHARVAL()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define SKIPCHARVAL(p)</PRE
+></TD
+></TR
+></TABLE
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>p</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5471"
></A
><H3
><A
@@ -903,7 +1087,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4898"
+NAME="AEN5485"
></A
><H3
><A
@@ -961,7 +1145,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4912"
+NAME="AEN5499"
></A
><H3
><A
@@ -1019,7 +1203,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4926"
+NAME="AEN5513"
></A
><H3
><A
@@ -1077,7 +1261,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4940"
+NAME="AEN5527"
></A
><H3
><A
@@ -1135,7 +1319,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4954"
+NAME="AEN5541"
></A
><H3
><A
@@ -1193,7 +1377,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4968"
+NAME="AEN5555"
></A
><H3
><A
@@ -1251,7 +1435,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4982"
+NAME="AEN5569"
></A
><H3
><A
@@ -1309,7 +1493,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4996"
+NAME="AEN5583"
></A
><H3
><A
@@ -1367,7 +1551,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5010"
+NAME="AEN5597"
></A
><H3
><A
@@ -1425,7 +1609,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5024"
+NAME="AEN5611"
></A
><H3
><A
@@ -1483,7 +1667,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5038"
+NAME="AEN5625"
></A
><H3
><A
@@ -1541,7 +1725,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5052"
+NAME="AEN5639"
></A
><H3
><A
@@ -1597,7 +1781,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a pointer to an array of CHAR</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1612,7 +1796,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new parser context or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1622,7 +1806,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5073"
+NAME="AEN5660"
></A
><H3
><A
@@ -1677,7 +1861,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1692,7 +1876,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new parser context or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1702,7 +1886,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5093"
+NAME="AEN5680"
></A
><H3
><A
@@ -1756,7 +1940,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an pointer to a char array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1773,7 +1957,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the siwe of the array</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1788,7 +1972,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new parser context or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1798,7 +1982,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5117"
+NAME="AEN5704"
></A
><H3
><A
@@ -1852,7 +2036,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1862,7 +2046,153 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5133"
+NAME="AEN5720"
+></A
+><H3
+><A
+NAME="XMLNEWPARSERCTXT"
+></A
+>xmlNewParserCtxt ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> xmlNewParserCtxt ();</PRE
+></TD
+></TR
+></TABLE
+><P
+>Allocate and initialize a new parser context.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5736"
+></A
+><H3
+><A
+NAME="XMLSWITCHENCODING"
+></A
+>xmlSwitchEncoding ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>void xmlSwitchEncoding (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+ <GTKDOCLINK
+HREF="XMLCHARENCODING"
+>xmlCharEncoding</GTKDOCLINK
+> enc);</PRE
+></TD
+></TR
+></TABLE
+><P
+>change the input functions when discovering the character encoding
+of a given entity.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>enc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5757"
></A
><H3
><A
@@ -1891,8 +2221,9 @@ HREF="gnome-xml-entities.html#XMLENTITYPTR"
></TABLE
><P
>Default handling of defined entities, when should we define a new input
-stream ? When do we just handle that as a set of chars ?
-TODO: we should call the SAX handler here and have it resolve the issue</P
+stream ? When do we just handle that as a set of chars ?</P
+><P
+>OBSOLETE: to be removed at some point.</P
><P
></P
><DIV
@@ -1921,7 +2252,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1938,7 +2269,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML entity pointer.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1948,7 +2279,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5154"
+NAME="AEN5779"
></A
><H3
><A
@@ -2008,7 +2339,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2025,7 +2356,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an Entity pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2040,7 +2371,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new input stream</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2050,7 +2381,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5180"
+NAME="AEN5805"
></A
><H3
><A
@@ -2108,7 +2439,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2125,7 +2456,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser input fragment (entity, XML fragment ...).</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2135,7 +2466,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5201"
+NAME="AEN5826"
></A
><H3
><A
@@ -2165,8 +2496,6 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>xmlPopInput: the current input pointed by ctxt-&gt;input came to an end
pop it and return the next char.</P
><P
->TODO A deallocation of the popped Input structure is needed</P
-><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -2194,7 +2523,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2209,7 +2538,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the current CHAR in the parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2219,7 +2548,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5223"
+NAME="AEN5847"
></A
><H3
><A
@@ -2272,7 +2601,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an xmlParserInputPtr</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2282,7 +2611,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5239"
+NAME="AEN5863"
></A
><H3
><A
@@ -2339,7 +2668,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2356,7 +2685,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename to use as entity</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2371,7 +2700,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new input stream or NULL in case of error</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2381,7 +2710,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5264"
+NAME="AEN5888"
></A
><H3
><A
@@ -2447,7 +2776,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2464,7 +2793,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a CHAR ** </TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2479,8 +2808,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the function returns the local part, and prefix is updated
-to get the Prefix if any.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2490,7 +2818,7 @@ to get the Prefix if any.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5293"
+NAME="AEN5917"
></A
><H3
><A
@@ -2551,7 +2879,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2566,7 +2894,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the namespace name or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2576,7 +2904,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5316"
+NAME="AEN5940"
></A
><H3
><A
@@ -2642,7 +2970,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2659,7 +2987,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a CHAR ** </TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2674,8 +3002,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the function returns the local part, and prefix is updated
-to get the Prefix if any.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2685,7 +3012,7 @@ to get the Prefix if any.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5345"
+NAME="AEN5969"
></A
><H3
><A
@@ -2745,7 +3072,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2760,7 +3087,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the namespace name</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2770,7 +3097,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5368"
+NAME="AEN5992"
></A
><H3
><A
@@ -2797,7 +3124,8 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
></TR
></TABLE
><P
->[OLD] Parse and return a string between quotes or doublequotes</P
+>[OLD] Parse and return a string between quotes or doublequotes
+To be removed at next drop of binary compatibility</P
><P
></P
><DIV
@@ -2826,7 +3154,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2841,7 +3169,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the string parser or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2851,7 +3179,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5389"
+NAME="AEN6013"
></A
><H3
><A
@@ -2881,6 +3209,8 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
other stuff may still rely on it, so support is still here as
if ot was declared on the root of the Tree:-(</P
><P
+>To be removed at next drop of binary compatibility</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -2908,7 +3238,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2918,7 +3248,96 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5406"
+NAME="AEN6031"
+></A
+><H3
+><A
+NAME="XMLSCANNAME"
+></A
+>xmlScanName ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+>* xmlScanName (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Trickery: parse an XML name but without consuming the input flow
+Needed for rollback cases.</P
+><P
+>[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
+CombiningChar | Extender</P
+><P
+>[5] Name ::= (Letter | '_' | ':') (NameChar)*</P
+><P
+>[6] Names ::= Name (S Name)*</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN6055"
></A
><H3
><A
@@ -2981,7 +3400,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2996,7 +3415,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the Name parsed or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3006,7 +3425,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5430"
+NAME="AEN6079"
></A
><H3
><A
@@ -3066,7 +3485,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3081,7 +3500,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the Nmtoken parsed or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3091,7 +3510,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5453"
+NAME="AEN6102"
></A
><H3
><A
@@ -3154,7 +3573,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3171,7 +3590,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if non-NULL store a copy of the original entity value</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3186,7 +3605,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the EntityValue parsed with reference substitued or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3196,7 +3615,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5480"
+NAME="AEN6129"
></A
><H3
><A
@@ -3258,7 +3677,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3273,7 +3692,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the AttValue parsed or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3283,7 +3702,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5502"
+NAME="AEN6151"
></A
><H3
><A
@@ -3341,7 +3760,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3356,7 +3775,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the SystemLiteral parsed or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3366,7 +3785,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5524"
+NAME="AEN6173"
></A
><H3
><A
@@ -3424,7 +3843,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3439,7 +3858,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the PubidLiteral parsed or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3449,7 +3868,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5546"
+NAME="AEN6195"
></A
><H3
><A
@@ -3506,7 +3925,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3523,7 +3942,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> int indicating whether we are within a CDATA section</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3533,7 +3952,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5567"
+NAME="AEN6216"
></A
><H3
><A
@@ -3602,7 +4021,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3619,7 +4038,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a CHAR** receiving PubidLiteral</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3636,8 +4055,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> indicate whether we should restrict parsing to only
-production [75], see NOTE below</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3652,9 +4070,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the function returns SystemLiteral and in the second
-case publicID receives PubidLiteral, is strict is off
-it is possible to return NULL and have publicID set.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3664,7 +4080,7 @@ it is possible to return NULL and have publicID set.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5600"
+NAME="AEN6249"
></A
><H3
><A
@@ -3723,7 +4139,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3740,7 +4156,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> should we create a node, or just skip the content</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3750,7 +4166,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5621"
+NAME="AEN6270"
></A
><H3
><A
@@ -3808,7 +4224,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3823,7 +4239,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the PITarget name or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3833,7 +4249,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5643"
+NAME="AEN6292"
></A
><H3
><A
@@ -3890,7 +4306,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3900,7 +4316,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5661"
+NAME="AEN6310"
></A
><H3
><A
@@ -3965,7 +4381,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3975,7 +4391,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5681"
+NAME="AEN6330"
></A
><H3
><A
@@ -4013,6 +4429,9 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>[76] NDataDecl ::= S 'NDATA' S Name</P
><P
+>[ VC: Notation Declared ]
+TODO The Name must match the declared name of a notation.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4040,7 +4459,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4050,7 +4469,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5703"
+NAME="AEN6353"
></A
><H3
><A
@@ -4091,6 +4510,34 @@ HREF="FIXED"
>FIXED</GTKDOCLINK
>' S)? AttValue)</P
><P
+>[ VC: Required Attribute ]
+TODO if the default declaration is the keyword <GTKDOCLINK
+HREF="REQUIRED"
+>REQUIRED</GTKDOCLINK
+>, then the
+attribute must be specified for all elements of the type in the
+attribute-list declaration.</P
+><P
+>[ VC: Attribute Default Legal ]
+The declared default value must meet the lexical constraints of
+the declared attribute type c.f. <A
+HREF="gnome-xml-valid.html#XMLVALIDATEATTRIBUTEDECL"
+>xmlValidateAttributeDecl</A
+>()</P
+><P
+>[ VC: Fixed Attribute Default ]
+TODO if an attribute has a default value declared with the <GTKDOCLINK
+HREF="FIXED"
+>FIXED</GTKDOCLINK
+>
+keyword, instances of that attribute must match the default value. </P
+><P
+>[ WFC: No &lt; in Attribute Values ]
+handled in <A
+HREF="gnome-xml-parserinternals.html#XMLPARSEATTVALUE"
+>xmlParseAttValue</A
+>()</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4118,7 +4565,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4135,7 +4582,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> Receive a possible fixed default value for the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4150,8 +4597,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED
-or XML_ATTRIBUTE_FIXED. </TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4161,7 +4607,7 @@ or XML_ATTRIBUTE_FIXED. </TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5732"
+NAME="AEN6390"
></A
><H3
><A
@@ -4190,9 +4636,13 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>parse an Notation attribute type.</P
><P
+>Note: the leading 'NOTATION' S part has already being parsed...</P
+><P
>[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'</P
><P
->Note: the leading 'NOTATION' S part has already being parsed...</P
+>[ VC: Notation Attributes ]
+TODO Values of this type must match one of the notation names included
+in the declaration; all notation names in the declaration must be declared.</P
><P
></P
><DIV
@@ -4221,7 +4671,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4236,7 +4686,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the notation attribute tree built while parsing</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4246,7 +4696,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5755"
+NAME="AEN6414"
></A
><H3
><A
@@ -4277,6 +4727,10 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'</P
><P
+>[ VC: Enumeration ]
+TODO Values of this type must match one of the Nmtoken tokens in
+the declaration</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4304,7 +4758,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4319,7 +4773,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the enumeration attribute tree built while parsing</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4329,7 +4783,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5777"
+NAME="AEN6437"
></A
><H3
><A
@@ -4390,7 +4844,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4407,7 +4861,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the enumeration tree built while parsing</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4422,7 +4876,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4432,7 +4886,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5804"
+NAME="AEN6464"
></A
><H3
><A
@@ -4469,6 +4923,44 @@ HREF="gnome-xml-tree.html#XMLENUMERATIONPTR"
>[56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' |
'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'</P
><P
+>Validity constraints for attribute values syntax are checked in
+<GTKDOCLINK
+HREF="XMLVALIDATEATTRIBUTEVALUE"
+>xmlValidateAttributeValue</GTKDOCLINK
+>()</P
+><P
+>[ VC: ID ]
+Values of type ID must match the Name production. TODO A name must not
+appear more than once in an XML document as a value of this type;
+i.e., ID values must uniquely identify the elements which bear them.</P
+><P
+>[ VC: One ID per Element Type ]
+TODO No element type may have more than one ID attribute specified.</P
+><P
+>[ VC: ID Attribute Default ]
+TODO An ID attribute must have a declared default of <GTKDOCLINK
+HREF="IMPLIED"
+>IMPLIED</GTKDOCLINK
+> or <GTKDOCLINK
+HREF="REQUIRED"
+>REQUIRED</GTKDOCLINK
+>.</P
+><P
+>[ VC: IDREF ]
+Values of type IDREF must match the Name production, and values
+of type IDREFS must match Names; TODO each Name must match the value of
+an ID attribute on some element in the XML document; i.e. IDREF
+values must match the value of some ID attribute.</P
+><P
+>[ VC: Entity Name ]
+Values of type ENTITY must match the Name production, values
+of type ENTITIES must match Names; TODO each Name must match the name of
+an unparsed entity declared in the DTD. </P
+><P
+>[ VC: Name Token ]
+Values of type NMTOKEN must match the Nmtoken production; values
+of type NMTOKENS must match Nmtokens.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4496,7 +4988,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4513,7 +5005,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the enumeration tree built while parsing</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4528,7 +5020,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the attribute type</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4538,7 +5030,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5832"
+NAME="AEN6502"
></A
><H3
><A
@@ -4595,7 +5087,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4605,7 +5097,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5850"
+NAME="AEN6520"
></A
><H3
><A
@@ -4645,6 +5137,12 @@ HREF="PCDATA"
>PCDATA</GTKDOCLINK
>' S? ')'</P
><P
+>[ VC: Proper Group/PE Nesting ] applies to [51] too (see [49])</P
+><P
+>[ VC: No Duplicate Types ]
+TODO The same name must not appear more than once in a single
+mixed-content declaration.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4672,7 +5170,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4687,7 +5185,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the list of the xmlElementContentPtr describing the element choices</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4697,7 +5195,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5874"
+NAME="AEN6546"
></A
><H3
><A
@@ -4736,6 +5234,17 @@ The leading '(' and spaces have been skipped in xmlParseElementContentDecl</P
><P
>[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'</P
><P
+>[ VC: Proper Group/PE Nesting ] applies to [49] and [50]
+TODO Parameter-entity replacement text must be properly nested
+with parenthetized groups. That is to say, if either of the
+opening or closing parentheses in a choice, seq, or Mixed
+construct is contained in the replacement text for a parameter
+entity, both must be contained in the same replacement text. For
+interoperability, if a parameter-entity reference appears in a
+choice, seq, or Mixed construct, its replacement text should not
+be empty, and neither the first nor last non-blank character of
+the replacement text should be a connector (| or ,).</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -4763,7 +5272,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4778,8 +5287,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the tree of xmlElementContentPtr describing the element
-hierarchy.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4789,7 +5297,7 @@ hierarchy.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5899"
+NAME="AEN6572"
></A
><H3
><A
@@ -4853,7 +5361,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4870,7 +5378,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the name of the element being defined.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4887,7 +5395,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the Element Content pointer will be stored here if any</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4902,7 +5410,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the type of element content XML_ELEMENT_TYPE_xxx</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4912,7 +5420,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5930"
+NAME="AEN6603"
></A
><H3
><A
@@ -4940,7 +5448,8 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>[45] elementdecl ::= '&lt;!ELEMENT' S Name S contentspec S? '&gt;'</P
><P
->TODO There is a check [ VC: Unique Element Type Declaration ]</P
+>[ VC: Unique Element Type Declaration ]
+TODO No element type may be declared more than once</P
><P
></P
><DIV
@@ -4969,7 +5478,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4984,7 +5493,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the type of the element, or -1 in case of error</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4994,7 +5503,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5952"
+NAME="AEN6625"
></A
><H3
><A
@@ -5023,7 +5532,18 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>[29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl |
NotationDecl | PI | Comment</P
><P
->TODO There is a check [ VC: Proper Declaration/PE Nesting ]</P
+>[ VC: Proper Declaration/PE Nesting ]
+TODO Parameter-entity replacement text must be properly nested with
+markup declarations. That is to say, if either the first character
+or the last character of a markup declaration (markupdecl above) is
+contained in the replacement text for a parameter-entity reference,
+both must be contained in the same replacement text.</P
+><P
+>[ WFC: PEs in Internal Subset ]
+In the internal DTD subset, parameter-entity references can occur
+only where markup declarations can occur, not within markup declarations.
+(This does not apply to references that occur in external parameter
+entities or to the external subset.)</P
><P
></P
><DIV
@@ -5052,7 +5572,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5062,7 +5582,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5970"
+NAME="AEN6644"
></A
><H3
><A
@@ -5094,6 +5614,10 @@ HREF="X"
>x</GTKDOCLINK
>' [0-9a-fA-F]+ ';'</P
><P
+>[ WFC: Legal Character ]
+Characters referred to using character references must match the
+production for Char.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -5121,7 +5645,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5136,7 +5660,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the value parsed (as an int)</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5146,7 +5670,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5992"
+NAME="AEN6667"
></A
><H3
><A
@@ -5177,6 +5701,24 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>[68] EntityRef ::= '&amp;' Name ';'</P
><P
+>[ WFC: Entity Declared ]
+In a document without any DTD, a document with only an internal DTD
+subset which contains no parameter entity references, or a document
+with "standalone='yes'", the Name given in the entity reference
+must match that in an entity declaration, except that well-formed
+documents need not declare any of the following entities: amp, lt,
+gt, apos, quot. The declaration of a parameter entity must precede
+any reference to it. Similarly, the declaration of a general entity
+must precede any reference to it which appears in a default value in an
+attribute-list declaration. Note that if entities are declared in the
+external subset or in external parameter entities, a non-validating
+processor is not obligated to read and process their declarations;
+for such documents, the rule that an entity must be declared is a
+well-formedness constraint only if standalone='yes'.</P
+><P
+>[ WFC: Parsed Entity ]
+An entity reference must not contain the name of an unparsed entity</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -5204,7 +5746,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5219,7 +5761,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlEntityPtr if found, or NULL otherwise.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5229,7 +5771,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6014"
+NAME="AEN6691"
></A
><H3
><A
@@ -5293,7 +5835,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5303,7 +5845,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6033"
+NAME="AEN6710"
></A
><H3
><A
@@ -5333,6 +5875,25 @@ a new input stream.</P
><P
>[69] PEReference ::= '%' Name ';'</P
><P
+>[ WFC: No Recursion ]
+TODO A parsed entity must not contain a recursive
+reference to itself, either directly or indirectly. </P
+><P
+>[ WFC: Entity Declared ]
+In a document without any DTD, a document with only an internal DTD
+subset which contains no parameter entity references, or a document
+with "standalone='yes'", ... ... The declaration of a parameter
+entity must precede any reference to it...</P
+><P
+>[ VC: Entity Declared ]
+In a document with an external subset or external parameter entities
+with "standalone='no'", ... ... The declaration of a parameter entity
+must precede any reference to it...</P
+><P
+>[ WFC: In DTD ]
+Parameter-entity references may only appear in the DTD.
+NOTE: misleading but this is handled.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -5360,7 +5921,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5370,7 +5931,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6050"
+NAME="AEN6731"
></A
><H3
><A
@@ -5399,6 +5960,10 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>[28] doctypedecl ::= '&lt;!DOCTYPE' S Name (S ExternalID)? S?
('[' (markupdecl | PEReference | S)* ']' S?)? '&gt;'</P
><P
+>[ VC: Root Element Type ]
+The Name in the document type declaration must match the element
+type of the root element.</P
+><P
></P
><DIV
CLASS="INFORMALTABLE"
@@ -5426,7 +5991,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5436,7 +6001,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6067"
+NAME="AEN6749"
></A
><H3
><A
@@ -5471,6 +6036,18 @@ HREF="gnome-xml-tree.html#CHAR"
><P
>[41] Attribute ::= Name Eq AttValue</P
><P
+>[ WFC: No External Entity References ]
+Attribute values cannot contain direct or indirect entity references
+to external entities.</P
+><P
+>[ WFC: No &lt; in Attribute Values ]
+The replacement text of any entity referred to directly or indirectly in
+an attribute value (other than "&amp;lt;") must not contain a &lt;. </P
+><P
+>[ VC: Attribute Value Type ]
+TODO The attribute must have been declared; the value must be of the type
+declared for it.</P
+><P
>[25] Eq ::= S? '=' S?</P
><P
>With namespace:</P
@@ -5507,7 +6084,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5524,7 +6101,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a CHAR ** used to store the value of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5539,7 +6116,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the attribute name, and the value in *value.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5549,7 +6126,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6098"
+NAME="AEN6783"
></A
><H3
><A
@@ -5581,8 +6158,16 @@ EmptyElement. In both case we don't parse the tag closing chars.</P
><P
>[40] STag ::= '&lt;' Name (S Attribute)* S? '&gt;'</P
><P
+>[ WFC: Unique Att Spec ]
+No attribute name may appear more than once in the same start-tag or
+empty-element tag. </P
+><P
>[44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/&gt;'</P
><P
+>[ WFC: Unique Att Spec ]
+No attribute name may appear more than once in the same start-tag or
+empty-element tag. </P
+><P
>With namespace:</P
><P
>[NS 8] STag ::= '&lt;' QName (S Attribute)* S? '&gt;'</P
@@ -5616,7 +6201,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5631,7 +6216,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the element name parsed</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5641,7 +6226,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6124"
+NAME="AEN6811"
></A
><H3
><A
@@ -5704,7 +6289,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5721,7 +6306,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the tag name as parsed in the opening tag.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5731,7 +6316,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6148"
+NAME="AEN6835"
></A
><H3
><A
@@ -5792,7 +6377,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5802,7 +6387,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6168"
+NAME="AEN6855"
></A
><H3
><A
@@ -5857,7 +6442,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5867,7 +6452,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6185"
+NAME="AEN6872"
></A
><H3
><A
@@ -5895,7 +6480,22 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
><P
>[39] element ::= EmptyElemTag | STag content ETag</P
><P
->[41] Attribute ::= Name Eq AttValue</P
+>[ WFC: Element Type Match ]
+The Name in an element's end-tag must match the element type in the
+start-tag. </P
+><P
+>[ VC: Element Valid ]
+TODO An element is valid if there is a declaration matching elementdecl
+where the Name matches the element type and one of the following holds:
+- The declaration matches EMPTY and the element has no content.
+- The declaration matches children and the sequence of child elements
+belongs to the language generated by the regular expression in the
+content model, with optional white space (characters matching the
+nonterminal S) between each pair of child elements.
+- The declaration matches Mixed and the content consists of character
+data and child elements whose types match names in the content model.
+- The declaration matches ANY, and the types of any child elements have
+been declared.</P
><P
></P
><DIV
@@ -5924,7 +6524,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5934,7 +6534,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6203"
+NAME="AEN6891"
></A
><H3
><A
@@ -5992,7 +6592,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6007,7 +6607,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the string giving the XML version number, or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6017,7 +6617,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6225"
+NAME="AEN6913"
></A
><H3
><A
@@ -6077,7 +6677,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6092,7 +6692,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the version string, e.g. "1.0"</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6102,7 +6702,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6248"
+NAME="AEN6936"
></A
><H3
><A
@@ -6160,7 +6760,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6175,7 +6775,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the encoding name value or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6185,7 +6785,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6270"
+NAME="AEN6958"
></A
><H3
><A
@@ -6245,7 +6845,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6260,7 +6860,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the encoding value or NULL</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6270,7 +6870,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6293"
+NAME="AEN6981"
></A
><H3
><A
@@ -6297,7 +6897,21 @@ HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
>parse the XML standalone declaration</P
><P
>[32] SDDecl ::= S 'standalone' Eq
-(("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"'))</P
+(("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) </P
+><P
+>[ VC: Standalone Document Declaration ]
+TODO The standalone document declaration must have the value "no"
+if any external markup declarations contain declarations of:
+- attributes with default values, if elements to which these
+attributes apply appear in the document without specifications
+of values for these attributes, or
+- entities (other than amp, lt, gt, apos, quot), if references
+to those entities appear in the document, or
+- attributes with values subject to normalization, where the
+attribute appears in the document with a value which will change
+as a result of normalization, or
+- element types with element content, if white space occurs directly
+within any instance of those types.</P
><P
></P
><DIV
@@ -6326,7 +6940,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6341,7 +6955,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->1 if standalone, 0 otherwise</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6351,7 +6965,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6314"
+NAME="AEN7003"
></A
><H3
><A
@@ -6406,7 +7020,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6416,7 +7030,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6331"
+NAME="AEN7020"
></A
><H3
><A
@@ -6471,7 +7085,118 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN7037"
+></A
+><H3
+><A
+NAME="XMLPARSEEXTERNALSUBSET"
+></A
+>xmlParseExternalSubset ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>void xmlParseExternalSubset (<A
+HREF="gnome-xml-parser.html#XMLPARSERCTXTPTR"
+>xmlParserCtxtPtr</A
+> ctxt,
+ 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
+>parse Markup declarations from an external subset</P
+><P
+>[30] extSubset ::= textDecl? extSubsetDecl</P
+><P
+>[31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *</P
+><P
+>TODO There is a check [ VC: Proper Declaration/PE Nesting ]</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</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"
+>&nbsp;</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"
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6481,7 +7206,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6348"
+NAME="AEN7066"
></A
><H3
><A
@@ -6497,7 +7222,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_SUBSTITUTE_NONE 0</PRE
+>#define XML_SUBSTITUTE_NONE</PRE
></TD
></TR
></TABLE
@@ -6507,7 +7232,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6353"
+NAME="AEN7071"
></A
><H3
><A
@@ -6523,7 +7248,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_SUBSTITUTE_REF 1</PRE
+>#define XML_SUBSTITUTE_REF</PRE
></TD
></TR
></TABLE
@@ -6533,7 +7258,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6358"
+NAME="AEN7076"
></A
><H3
><A
@@ -6549,7 +7274,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_SUBSTITUTE_PEREF 2</PRE
+>#define XML_SUBSTITUTE_PEREF</PRE
></TD
></TR
></TABLE
@@ -6559,7 +7284,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6363"
+NAME="AEN7081"
></A
><H3
><A
@@ -6575,7 +7300,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_SUBSTITUTE_BOTH 3</PRE
+>#define XML_SUBSTITUTE_BOTH</PRE
></TD
></TR
></TABLE
@@ -6585,7 +7310,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6368"
+NAME="AEN7086"
></A
><H3
><A
@@ -6657,7 +7382,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6674,7 +7399,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the len to decode (in bytes !), -1 for no size limit</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6691,7 +7416,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6708,7 +7433,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an end marker CHAR, 0 if none</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6725,7 +7450,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an end marker CHAR, 0 if none</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6742,7 +7467,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an end marker CHAR, 0 if none</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6757,8 +7482,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->A newly allocated string with the substitution done. The caller
-must deallocate it !</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6768,7 +7492,7 @@ must deallocate it !</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6413"
+NAME="AEN7131"
></A
><H3
><A
@@ -6865,7 +7589,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6437"
+NAME="AEN7155"
></A
><H3
><A
@@ -6944,7 +7668,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6457"
+NAME="AEN7175"
></A
><H3
><A
@@ -7041,7 +7765,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6481"
+NAME="AEN7199"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-tree.html b/doc/html/gnome-xml-tree.html
index d4890f59..42e98f0a 100644
--- a/doc/html/gnome-xml-tree.html
+++ b/doc/html/gnome-xml-tree.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN1684"
+NAME="AEN1731"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN1684"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN1687"
+NAME="AEN1734"
></A
><H2
>Synopsis</H2
@@ -647,6 +647,21 @@ HREF="gnome-xml-tree.html#CHAR"
HREF="gnome-xml-tree.html#XMLNODEPTR"
>xmlNodePtr</A
> <A
+HREF="gnome-xml-tree.html#XMLNEWCDATABLOCK"
+>xmlNewCDataBlock</A
+> (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *content,
+ int len);
+<A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> <A
HREF="gnome-xml-tree.html#XMLNEWREFERENCE"
>xmlNewReference</A
> (<A
@@ -1046,7 +1061,7 @@ HREF="gnome-xml-tree.html#XMLSETCOMPRESSMODE"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN1937"
+NAME="AEN1988"
></A
><H2
>Description</H2
@@ -1056,14 +1071,14 @@ NAME="AEN1937"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN1940"
+NAME="AEN1991"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1942"
+NAME="AEN1993"
></A
><H3
><A
@@ -1102,7 +1117,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1947"
+NAME="AEN1998"
></A
><H3
><A
@@ -1115,33 +1130,20 @@ NAME="CHAR"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1951"
+NAME="AEN2002"
></A
><H3
><A
NAME="XMLNOTATIONPTR"
></A
>xmlNotationPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlNotation *xmlNotationPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1956"
+NAME="AEN2006"
></A
><H3
><A
@@ -1178,7 +1180,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1961"
+NAME="AEN2011"
></A
><H3
><A
@@ -1209,59 +1211,33 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1966"
+NAME="AEN2016"
></A
><H3
><A
NAME="XMLENUMERATIONPTR"
></A
>xmlEnumerationPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlEnumeration *xmlEnumerationPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1971"
+NAME="AEN2020"
></A
><H3
><A
NAME="XMLATTRIBUTEPTR"
></A
>xmlAttributePtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlAttribute *xmlAttributePtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1976"
+NAME="AEN2024"
></A
><H3
><A
@@ -1292,7 +1268,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1981"
+NAME="AEN2029"
></A
><H3
><A
@@ -1323,33 +1299,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1986"
+NAME="AEN2034"
></A
><H3
><A
NAME="XMLELEMENTCONTENTPTR"
></A
>xmlElementContentPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlElementContent *xmlElementContentPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1991"
+NAME="AEN2038"
></A
><H3
><A
@@ -1380,33 +1343,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN1996"
+NAME="AEN2043"
></A
><H3
><A
NAME="XMLELEMENTPTR"
></A
>xmlElementPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlElement *xmlElementPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2001"
+NAME="AEN2047"
></A
><H3
><A
@@ -1435,241 +1385,124 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2006"
+NAME="AEN2052"
></A
><H3
><A
NAME="XMLNSPTR"
></A
>xmlNsPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlNs *xmlNsPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2011"
+NAME="AEN2056"
></A
><H3
><A
NAME="XMLDTDPTR"
></A
>xmlDtdPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlDtd *xmlDtdPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2016"
+NAME="AEN2060"
></A
><H3
><A
NAME="XMLATTRPTR"
></A
>xmlAttrPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlAttr *xmlAttrPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2021"
+NAME="AEN2064"
></A
><H3
><A
NAME="XMLNODE"
></A
>xmlNode</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlNode xmlNode;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2026"
+NAME="AEN2068"
></A
><H3
><A
NAME="XMLNODEPTR"
></A
>xmlNodePtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlNode *xmlNodePtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2031"
+NAME="AEN2072"
></A
><H3
><A
NAME="XMLDOC"
></A
>xmlDoc</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlDoc xmlDoc;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2036"
+NAME="AEN2076"
></A
><H3
><A
NAME="XMLDOCPTR"
></A
>xmlDocPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlDoc *xmlDocPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2041"
+NAME="AEN2080"
></A
><H3
><A
NAME="XMLBUFFER"
></A
>xmlBuffer</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef _xmlBuffer xmlBuffer;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2046"
+NAME="AEN2084"
></A
><H3
><A
NAME="XMLBUFFERPTR"
></A
>xmlBufferPtr</H3
-><TABLE
-BORDER="0"
-BGCOLOR="#D6E8FF"
-WIDTH="100%"
-CELLPADDING="6"
-><TR
-><TD
-><PRE
-CLASS="PROGRAMLISTING"
->typedef xmlBuffer *xmlBufferPtr;</PRE
-></TD
-></TR
-></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2051"
+NAME="AEN2088"
></A
><H3
><A
@@ -1695,7 +1528,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2056"
+NAME="AEN2093"
></A
><H3
><A
@@ -1721,7 +1554,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2061"
+NAME="AEN2098"
></A
><H3
><A
@@ -1747,7 +1580,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2066"
+NAME="AEN2103"
></A
><H3
><A
@@ -1798,7 +1631,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new structure.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1808,7 +1641,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2082"
+NAME="AEN2119"
></A
><H3
><A
@@ -1861,7 +1694,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to free</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1871,7 +1704,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2098"
+NAME="AEN2135"
></A
><H3
><A
@@ -1928,7 +1761,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the file output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1945,7 +1778,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to dump</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1960,7 +1793,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the number of CHAR written</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1970,7 +1803,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2123"
+NAME="AEN2160"
></A
><H3
><A
@@ -2028,7 +1861,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to dump</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2045,7 +1878,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR string</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2062,7 +1895,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the number of CHAR to add</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2072,7 +1905,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2148"
+NAME="AEN2185"
></A
><H3
><A
@@ -2129,7 +1962,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to dump</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2146,7 +1979,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the CHAR string</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2156,7 +1989,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2169"
+NAME="AEN2206"
></A
><H3
><A
@@ -2210,7 +2043,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to dump</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2227,7 +2060,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the C char string</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2237,7 +2070,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2189"
+NAME="AEN2226"
></A
><H3
><A
@@ -2291,7 +2124,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer to dump</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2308,7 +2141,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the number of CHAR to remove</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2323,7 +2156,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the number of CHAR removed, or -1 in case of failure.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2333,7 +2166,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2213"
+NAME="AEN2250"
></A
><H3
><A
@@ -2386,7 +2219,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the buffer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2396,7 +2229,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2229"
+NAME="AEN2266"
></A
><H3
><A
@@ -2464,7 +2297,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2481,7 +2314,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the DTD name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2498,7 +2331,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the external ID</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2515,7 +2348,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the system ID</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2530,7 +2363,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new DTD structure</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2540,7 +2373,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2265"
+NAME="AEN2302"
></A
><H3
><A
@@ -2608,7 +2441,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2625,7 +2458,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the DTD name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2642,7 +2475,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the external ID</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2659,7 +2492,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the system ID</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2674,7 +2507,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new DTD structure</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2684,7 +2517,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2301"
+NAME="AEN2338"
></A
><H3
><A
@@ -2737,7 +2570,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the DTD structure to free up</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2747,7 +2580,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2317"
+NAME="AEN2354"
></A
><H3
><A
@@ -2811,7 +2644,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document carrying the namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2828,7 +2661,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the URI associated</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2845,7 +2678,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the prefix for the namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2860,7 +2693,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->returns a new namespace pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2870,7 +2703,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2348"
+NAME="AEN2385"
></A
><H3
><A
@@ -2934,7 +2767,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the element carrying the namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2951,7 +2784,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the URI associated</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2968,7 +2801,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the prefix for the namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2983,7 +2816,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->returns a new namespace pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2993,7 +2826,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2379"
+NAME="AEN2416"
></A
><H3
><A
@@ -3046,7 +2879,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the namespace pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3056,7 +2889,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2395"
+NAME="AEN2432"
></A
><H3
><A
@@ -3112,7 +2945,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> CHAR string giving the version of XML "1.0"</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3127,7 +2960,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new document</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3137,7 +2970,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2416"
+NAME="AEN2453"
></A
><H3
><A
@@ -3190,8 +3023,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> pointer to the document
-@: </TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3201,7 +3033,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2432"
+NAME="AEN2469"
></A
><H3
><A
@@ -3265,7 +3097,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3282,7 +3114,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the name of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3299,7 +3131,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the value of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3314,7 +3146,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the attribute</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3324,7 +3156,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2463"
+NAME="AEN2500"
></A
><H3
><A
@@ -3388,7 +3220,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the holding node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3405,7 +3237,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the name of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3422,7 +3254,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the value of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3437,7 +3269,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the attribute</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3447,7 +3279,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2494"
+NAME="AEN2531"
></A
><H3
><A
@@ -3500,7 +3332,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first property in the list</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3510,7 +3342,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2510"
+NAME="AEN2547"
></A
><H3
><A
@@ -3563,7 +3395,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first property in the list</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3573,7 +3405,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2526"
+NAME="AEN2563"
></A
><H3
><A
@@ -3629,7 +3461,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3644,7 +3476,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlAttrPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3654,7 +3486,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2547"
+NAME="AEN2584"
></A
><H3
><A
@@ -3710,7 +3542,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3725,7 +3557,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlAttrPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3735,7 +3567,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2568"
+NAME="AEN2605"
></A
><H3
><A
@@ -3791,7 +3623,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the dtd</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3806,7 +3638,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlDtdPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3816,7 +3648,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2589"
+NAME="AEN2626"
></A
><H3
><A
@@ -3874,7 +3706,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3891,7 +3723,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if 1 do a recursive copy.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -3906,7 +3738,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlDocPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -3916,7 +3748,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2614"
+NAME="AEN2651"
></A
><H3
><A
@@ -3995,7 +3827,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4012,7 +3844,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> namespace if any</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4029,7 +3861,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4046,7 +3878,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text content if any</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4061,7 +3893,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4071,7 +3903,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2652"
+NAME="AEN2689"
></A
><H3
><A
@@ -4143,7 +3975,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> namespace if any</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4160,7 +3992,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4175,7 +4007,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4185,7 +4017,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2680"
+NAME="AEN2717"
></A
><H3
><A
@@ -4270,7 +4102,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the parent node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4287,7 +4119,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a namespace if any</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4304,7 +4136,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the name of the child</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4321,7 +4153,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the content of the child if any.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4336,7 +4168,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4346,7 +4178,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2719"
+NAME="AEN2756"
></A
><H3
><A
@@ -4406,7 +4238,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4423,7 +4255,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4438,7 +4270,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4448,7 +4280,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2745"
+NAME="AEN2782"
></A
><H3
><A
@@ -4504,7 +4336,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4519,7 +4351,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4529,7 +4361,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2766"
+NAME="AEN2803"
></A
><H3
><A
@@ -4591,7 +4423,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4608,7 +4440,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4625,7 +4457,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text len.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4640,7 +4472,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4650,7 +4482,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2796"
+NAME="AEN2833"
></A
><H3
><A
@@ -4707,7 +4539,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4724,7 +4556,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the text len.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4739,7 +4571,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4749,7 +4581,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2821"
+NAME="AEN2858"
></A
><H3
><A
@@ -4809,7 +4641,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4826,7 +4658,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the comment content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4841,7 +4673,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4851,7 +4683,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2847"
+NAME="AEN2884"
></A
><H3
><A
@@ -4907,7 +4739,127 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the comment content</TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN2905"
+></A
+><H3
+><A
+NAME="XMLNEWCDATABLOCK"
+></A
+>xmlNewCDataBlock ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> xmlNewCDataBlock (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *content,
+ int len);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Creation of a new node containing a CData block.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>content</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</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"
+>&nbsp;</TD
></TR
><TR
><TD
@@ -4922,7 +4874,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -4932,7 +4884,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2868"
+NAME="AEN2935"
></A
><H3
><A
@@ -4992,7 +4944,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5009,7 +4961,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the reference name, or the reference string with &amp; and ;</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5024,7 +4976,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the new node object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5034,7 +4986,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2894"
+NAME="AEN2961"
></A
><H3
><A
@@ -5091,7 +5043,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5108,7 +5060,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if 1 do a recursive copy.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5123,7 +5075,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlNodePtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5133,7 +5085,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2919"
+NAME="AEN2986"
></A
><H3
><A
@@ -5189,7 +5141,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first node in the list.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5204,7 +5156,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlNodePtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5214,7 +5166,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2940"
+NAME="AEN3007"
></A
><H3
><A
@@ -5270,7 +5222,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the parent node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5285,7 +5237,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the last child or NULL if none.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5295,7 +5247,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2961"
+NAME="AEN3028"
></A
><H3
><A
@@ -5348,7 +5300,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5363,7 +5315,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->1 yes, 0 no</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5373,7 +5325,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN2981"
+NAME="AEN3048"
></A
><H3
><A
@@ -5438,7 +5390,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the parent node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5455,7 +5407,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the child node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5470,7 +5422,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the child or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5480,7 +5432,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3008"
+NAME="AEN3075"
></A
><H3
><A
@@ -5533,7 +5485,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5543,7 +5495,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3024"
+NAME="AEN3091"
></A
><H3
><A
@@ -5603,7 +5555,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first text node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5620,7 +5572,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the second text node being merged</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5635,7 +5587,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the first text node augmented</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5645,7 +5597,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3050"
+NAME="AEN3117"
></A
><H3
><A
@@ -5703,7 +5655,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5720,7 +5672,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5737,12 +5689,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> <TT
-CLASS="PARAMETER"
-><I
->content</I
-></TT
-> lenght</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5752,7 +5699,7 @@ CLASS="PARAMETER"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3076"
+NAME="AEN3142"
></A
><H3
><A
@@ -5806,7 +5753,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first node in the list</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5816,7 +5763,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3092"
+NAME="AEN3158"
></A
><H3
><A
@@ -5869,7 +5816,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -5879,7 +5826,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3108"
+NAME="AEN3174"
></A
><H3
><A
@@ -5951,7 +5898,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5968,7 +5915,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the current node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -5985,7 +5932,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the namespace string</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6000,7 +5947,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the namespace pointer or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6010,7 +5957,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3140"
+NAME="AEN3206"
></A
><H3
><A
@@ -6075,7 +6022,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6092,7 +6039,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the current node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6109,7 +6056,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the namespace value</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6124,7 +6071,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the namespace pointer or NULL.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6134,7 +6081,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3171"
+NAME="AEN3237"
></A
><H3
><A
@@ -6191,7 +6138,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a node in the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6208,7 +6155,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a namespace pointer</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6218,7 +6165,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3192"
+NAME="AEN3258"
></A
><H3
><A
@@ -6274,7 +6221,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6289,7 +6236,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlNsPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6299,7 +6246,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3213"
+NAME="AEN3279"
></A
><H3
><A
@@ -6355,7 +6302,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the first namespace</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6370,7 +6317,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a new xmlNsPtr, or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6380,7 +6327,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3234"
+NAME="AEN3300"
></A
><H3
><A
@@ -6444,7 +6391,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6461,7 +6408,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6478,7 +6425,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute value</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6493,7 +6440,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the attribute pointer.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6503,7 +6450,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3265"
+NAME="AEN3331"
></A
><H3
><A
@@ -6564,7 +6511,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6581,7 +6528,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6596,7 +6543,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the attribute value or NULL if not found.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6606,7 +6553,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3291"
+NAME="AEN3357"
></A
><H3
><A
@@ -6667,7 +6614,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6684,7 +6631,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the value of the attribute</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6699,7 +6646,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the first child</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6709,7 +6656,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3317"
+NAME="AEN3383"
></A
><H3
><A
@@ -6771,7 +6718,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6788,7 +6735,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the value of the text</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6805,7 +6752,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the length of the string value</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6820,7 +6767,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the first child</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6830,7 +6777,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3347"
+NAME="AEN3413"
></A
><H3
><A
@@ -6892,7 +6839,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6909,7 +6856,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> a Node list</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6926,7 +6873,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> should we replace entity contents or show their external form</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -6941,7 +6888,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a pointer to the string copy, the calller must free it.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -6951,7 +6898,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3377"
+NAME="AEN3443"
></A
><H3
><A
@@ -7008,7 +6955,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node being modified</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7025,7 +6972,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the new value of the content</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7035,7 +6982,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3398"
+NAME="AEN3464"
></A
><H3
><A
@@ -7093,7 +7040,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node being modified</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7110,7 +7057,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the new value of the content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7127,12 +7074,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the size of <TT
-CLASS="PARAMETER"
-><I
->content</I
-></TT
-></TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7142,7 +7084,7 @@ CLASS="PARAMETER"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3424"
+NAME="AEN3489"
></A
><H3
><A
@@ -7199,7 +7141,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node being modified</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7216,7 +7158,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> extra content</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7226,7 +7168,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3445"
+NAME="AEN3510"
></A
><H3
><A
@@ -7284,7 +7226,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node being modified</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7301,7 +7243,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> extra content</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7318,12 +7260,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the size of <TT
-CLASS="PARAMETER"
-><I
->content</I
-></TT
-></TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7333,7 +7270,7 @@ CLASS="PARAMETER"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3471"
+NAME="AEN3535"
></A
><H3
><A
@@ -7392,7 +7329,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the node being read</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7407,8 +7344,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->a new CHAR * or NULL if no content is available.
-It's up to the caller to free the memory.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7418,7 +7354,7 @@ It's up to the caller to free the memory.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3492"
+NAME="AEN3556"
></A
><H3
><A
@@ -7476,7 +7412,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7493,7 +7429,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the string to add</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7503,7 +7439,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3513"
+NAME="AEN3577"
></A
><H3
><A
@@ -7558,7 +7494,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7575,7 +7511,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the string to add</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7585,7 +7521,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3533"
+NAME="AEN3597"
></A
><H3
><A
@@ -7644,7 +7580,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7661,7 +7597,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the string to add</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7671,7 +7607,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3554"
+NAME="AEN3618"
></A
><H3
><A
@@ -7730,7 +7666,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7747,7 +7683,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> OUT: the memory pointer</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7764,7 +7700,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> OUT: the memory lenght</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7774,7 +7710,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3579"
+NAME="AEN3643"
></A
><H3
><A
@@ -7831,7 +7767,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the FILE*</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7848,7 +7784,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7858,7 +7794,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3600"
+NAME="AEN3664"
></A
><H3
><A
@@ -7913,7 +7849,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the filename</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7930,7 +7866,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -7945,7 +7881,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the number of file written or -1 in case of failure.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -7955,7 +7891,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3624"
+NAME="AEN3688"
></A
><H3
><A
@@ -8008,7 +7944,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -8023,7 +7959,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->0 (uncompressed) to 9 (max compression)</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -8033,7 +7969,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3644"
+NAME="AEN3708"
></A
><H3
><A
@@ -8088,7 +8024,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -8105,7 +8041,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the compression ratio</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -8115,7 +8051,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3664"
+NAME="AEN3728"
></A
><H3
><A
@@ -8163,7 +8099,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->0 (uncompressed) to 9 (max compression)</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -8173,7 +8109,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3679"
+NAME="AEN3743"
></A
><H3
><A
@@ -8224,7 +8160,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the compression ratio</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-valid.html b/doc/html/gnome-xml-valid.html
index c9a8387d..15c43267 100644
--- a/doc/html/gnome-xml-valid.html
+++ b/doc/html/gnome-xml-valid.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN4093"
+NAME="AEN4184"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN4093"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN4096"
+NAME="AEN4187"
></A
><H2
>Synopsis</H2
@@ -138,6 +138,30 @@ CELLPADDING="6"
CLASS="SYNOPSIS"
>&#13;
+void (<A
+HREF="gnome-xml-valid.html#XMLVALIDITYERRORFUNC"
+>*xmlValidityErrorFunc</A
+>) (void *ctx,
+ const char *msg,
+ ...);
+void (<A
+HREF="gnome-xml-valid.html#XMLVALIDITYWARNINGFUNC"
+>*xmlValidityWarningFunc</A
+>) (void *ctx,
+ const char *msg,
+ ...);
+void <A
+HREF="gnome-xml-valid.html#XMLPARSERVALIDITYERROR"
+>xmlParserValidityError</A
+> (void *ctx,
+ const char *msg,
+ ...);
+void <A
+HREF="gnome-xml-valid.html#XMLPARSERVALIDITYWARNING"
+>xmlParserValidityWarning</A
+> (void *ctx,
+ const char *msg,
+ ...);
#define <A
HREF="gnome-xml-valid.html#XML-MIN-NOTATION-TABLE"
>XML_MIN_NOTATION_TABLE</A
@@ -168,7 +192,11 @@ HREF="gnome-xml-tree.html#XMLNOTATIONPTR"
> <A
HREF="gnome-xml-valid.html#XMLADDNOTATIONDECL"
>xmlAddNotationDecl</A
-> (<A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -246,7 +274,11 @@ HREF="gnome-xml-tree.html#XMLELEMENTPTR"
> <A
HREF="gnome-xml-valid.html#XMLADDELEMENTDECL"
>xmlAddElementDecl</A
-> (<A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -320,7 +352,11 @@ HREF="gnome-xml-tree.html#XMLATTRIBUTEPTR"
> <A
HREF="gnome-xml-valid.html#XMLADDATTRIBUTEDECL"
>xmlAddAttributeDecl</A
-> (<A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -369,7 +405,153 @@ HREF="gnome-xml-tree.html#XMLBUFFERPTR"
<A
HREF="gnome-xml-valid.html#XMLATTRIBUTETABLEPTR"
>xmlAttributeTablePtr</A
-> table);</PRE
+> table);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEROOT"
+>xmlValidateRoot</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEELEMENTDECL"
+>xmlValidateElementDecl</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLELEMENTPTR"
+>xmlElementPtr</A
+> elem);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEATTRIBUTEDECL"
+>xmlValidateAttributeDecl</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLATTRIBUTEPTR"
+>xmlAttributePtr</A
+> attr);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATENOTATIONDECL"
+>xmlValidateNotationDecl</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNOTATIONPTR"
+>xmlNotationPtr</A
+> nota);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEDTD"
+>xmlValidateDtd</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+> dtd);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEDOCUMENT"
+>xmlValidateDocument</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEELEMENT"
+>xmlValidateElement</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEONEELEMENT"
+>xmlValidateOneElement</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem);
+int <A
+HREF="gnome-xml-valid.html#XMLVALIDATEONEATTRIBUTE"
+>xmlValidateOneAttribute</A
+> (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem,
+ <A
+HREF="gnome-xml-tree.html#XMLATTRPTR"
+>xmlAttrPtr</A
+> attr,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *value);
+int <A
+HREF="gnome-xml-valid.html#XMLISMIXEDELEMENT"
+>xmlIsMixedElement</A
+> (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);</PRE
></TD
></TR
></TABLE
@@ -377,7 +559,7 @@ HREF="gnome-xml-valid.html#XMLATTRIBUTETABLEPTR"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4163"
+NAME="AEN4300"
></A
><H2
>Description</H2
@@ -387,20 +569,20 @@ NAME="AEN4163"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4166"
+NAME="AEN4303"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4168"
+NAME="AEN4305"
></A
><H3
><A
-NAME="XML-MIN-NOTATION-TABLE"
+NAME="XMLVALIDITYERRORFUNC"
></A
->XML_MIN_NOTATION_TABLE</H3
+>xmlValidityErrorFunc ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -410,23 +592,91 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_MIN_NOTATION_TABLE 32</PRE
+>void (*xmlValidityErrorFunc) (void *ctx,
+ const char *msg,
+ ...);</PRE
></TD
></TR
></TABLE
><P
></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>msg</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>...</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4173"
+NAME="AEN4327"
></A
><H3
><A
-NAME="XMLNOTATIONTABLEPTR"
+NAME="XMLVALIDITYWARNINGFUNC"
></A
->xmlNotationTablePtr</H3
+>xmlValidityWarningFunc ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -436,23 +686,188 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->typedef xmlNotationTable *xmlNotationTablePtr;</PRE
+>void (*xmlValidityWarningFunc) (void *ctx,
+ const char *msg,
+ ...);</PRE
></TD
></TR
></TABLE
><P
></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>msg</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>...</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4178"
+NAME="AEN4349"
></A
><H3
><A
-NAME="XML-MIN-ELEMENT-TABLE"
+NAME="XMLPARSERVALIDITYERROR"
></A
->XML_MIN_ELEMENT_TABLE</H3
+>xmlParserValidityError ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>void xmlParserValidityError (void *ctx,
+ const char *msg,
+ ...);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Display and format an validity error messages, gives file,
+line, position and extra parameters.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>msg</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>...</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4372"
+></A
+><H3
+><A
+NAME="XMLPARSERVALIDITYWARNING"
+></A
+>xmlParserValidityWarning ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -462,23 +877,94 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_MIN_ELEMENT_TABLE 32</PRE
+>void xmlParserValidityWarning (void *ctx,
+ const char *msg,
+ ...);</PRE
></TD
></TR
></TABLE
><P
+>Display and format a validity warning messages, gives file, line,
+position and extra parameters.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>ctx</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>msg</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>...</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
></P
></DIV
+></DIV
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4183"
+NAME="AEN4395"
></A
><H3
><A
-NAME="XMLELEMENTTABLEPTR"
+NAME="XML-MIN-NOTATION-TABLE"
></A
->xmlElementTablePtr</H3
+>XML_MIN_NOTATION_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -488,7 +974,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->typedef xmlElementTable *xmlElementTablePtr;</PRE
+>#define XML_MIN_NOTATION_TABLE</PRE
></TD
></TR
></TABLE
@@ -498,13 +984,26 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4188"
+NAME="AEN4400"
></A
><H3
><A
-NAME="XML-MIN-ATTRIBUTE-TABLE"
+NAME="XMLNOTATIONTABLEPTR"
></A
->XML_MIN_ATTRIBUTE_TABLE</H3
+>xmlNotationTablePtr</H3
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4404"
+></A
+><H3
+><A
+NAME="XML-MIN-ELEMENT-TABLE"
+></A
+>XML_MIN_ELEMENT_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -514,7 +1013,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XML_MIN_ATTRIBUTE_TABLE 32</PRE
+>#define XML_MIN_ELEMENT_TABLE</PRE
></TD
></TR
></TABLE
@@ -524,13 +1023,26 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4193"
+NAME="AEN4409"
></A
><H3
><A
-NAME="XMLATTRIBUTETABLEPTR"
+NAME="XMLELEMENTTABLEPTR"
></A
->xmlAttributeTablePtr</H3
+>xmlElementTablePtr</H3
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4413"
+></A
+><H3
+><A
+NAME="XML-MIN-ATTRIBUTE-TABLE"
+></A
+>XML_MIN_ATTRIBUTE_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
@@ -540,7 +1052,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->typedef xmlAttributeTable *xmlAttributeTablePtr;</PRE
+>#define XML_MIN_ATTRIBUTE_TABLE</PRE
></TD
></TR
></TABLE
@@ -550,7 +1062,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4198"
+NAME="AEN4418"
+></A
+><H3
+><A
+NAME="XMLATTRIBUTETABLEPTR"
+></A
+>xmlAttributeTablePtr</H3
+><P
+></P
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4422"
></A
><H3
><A
@@ -569,7 +1094,11 @@ CLASS="PROGRAMLISTING"
><A
HREF="gnome-xml-tree.html#XMLNOTATIONPTR"
>xmlNotationPtr</A
-> xmlAddNotationDecl (<A
+> xmlAddNotationDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -611,6 +1140,23 @@ VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
+>ctxt</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
>dtd</I
></TT
>&nbsp;:</TD
@@ -618,7 +1164,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> pointer to the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -635,7 +1181,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -652,7 +1198,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the public identifier or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -669,7 +1215,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the system identifier or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -684,7 +1230,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->NULL if not, othervise the entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -694,7 +1240,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4234"
+NAME="AEN4463"
></A
><H3
><A
@@ -750,7 +1296,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> A notation table</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -765,7 +1311,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new xmlNotationTablePtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -775,7 +1321,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4255"
+NAME="AEN4484"
></A
><H3
><A
@@ -828,7 +1374,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An notation table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -838,7 +1384,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4271"
+NAME="AEN4500"
></A
><H3
><A
@@ -895,7 +1441,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -912,7 +1458,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> A notation table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -922,7 +1468,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4292"
+NAME="AEN4521"
></A
><H3
><A
@@ -979,7 +1525,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the subelement name or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -996,7 +1542,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the type of element content decl</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1011,7 +1557,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->NULL if not, othervise the new element content structure</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1021,7 +1567,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4317"
+NAME="AEN4546"
></A
><H3
><A
@@ -1077,7 +1623,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An element content pointer.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1092,7 +1638,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new xmlElementContentPtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1102,7 +1648,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4338"
+NAME="AEN4567"
></A
><H3
><A
@@ -1155,7 +1701,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the element content tree to free</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1165,7 +1711,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4354"
+NAME="AEN4583"
></A
><H3
><A
@@ -1184,7 +1730,11 @@ CLASS="PROGRAMLISTING"
><A
HREF="gnome-xml-tree.html#XMLELEMENTPTR"
>xmlElementPtr</A
-> xmlAddElementDecl (<A
+> xmlAddElementDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -1223,6 +1773,23 @@ VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
+>ctxt</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
>dtd</I
></TT
>&nbsp;:</TD
@@ -1230,7 +1797,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> pointer to the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1247,7 +1814,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the entity name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1264,7 +1831,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the element type</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1281,7 +1848,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the element content tree or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1296,7 +1863,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->NULL if not, othervise the entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1306,7 +1873,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4389"
+NAME="AEN4623"
></A
><H3
><A
@@ -1362,7 +1929,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An element table</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1377,7 +1944,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new xmlElementTablePtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1387,7 +1954,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4410"
+NAME="AEN4644"
></A
><H3
><A
@@ -1440,7 +2007,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An element table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1450,7 +2017,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4426"
+NAME="AEN4660"
></A
><H3
><A
@@ -1507,7 +2074,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1524,7 +2091,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An element table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1534,7 +2101,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4447"
+NAME="AEN4681"
></A
><H3
><A
@@ -1590,7 +2157,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the enumeration name or NULL</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1605,8 +2172,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlEnumerationPtr just created or NULL in case
-of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1616,7 +2182,7 @@ of error.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4468"
+NAME="AEN4702"
></A
><H3
><A
@@ -1669,7 +2235,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the tree to free.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1679,7 +2245,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4484"
+NAME="AEN4718"
></A
><H3
><A
@@ -1735,7 +2301,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the tree to copy.</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1750,8 +2316,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlEnumerationPtr just created or NULL in case
-of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1761,7 +2326,7 @@ of error.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4505"
+NAME="AEN4739"
></A
><H3
><A
@@ -1780,7 +2345,11 @@ CLASS="PROGRAMLISTING"
><A
HREF="gnome-xml-tree.html#XMLATTRIBUTEPTR"
>xmlAttributePtr</A
-> xmlAddAttributeDecl (<A
+> xmlAddAttributeDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
HREF="gnome-xml-tree.html#XMLDTDPTR"
>xmlDtdPtr</A
> dtd,
@@ -1828,6 +2397,23 @@ VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
+>ctxt</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
>dtd</I
></TT
>&nbsp;:</TD
@@ -1835,7 +2421,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> pointer to the DTD</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1852,7 +2438,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the element name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1869,7 +2455,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute name</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1886,7 +2472,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute type</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1903,7 +2489,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute default type</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1920,7 +2506,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the attribute default value</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1937,7 +2523,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> if it's an enumeration, the associated list</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -1952,7 +2538,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->NULL if not, othervise the entity</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -1962,7 +2548,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4554"
+NAME="AEN4793"
></A
><H3
><A
@@ -2018,7 +2604,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An attribute table</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2033,7 +2619,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the new xmlAttributeTablePtr or NULL in case of error.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2043,7 +2629,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4575"
+NAME="AEN4814"
></A
><H3
><A
@@ -2096,7 +2682,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An attribute table</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -2106,7 +2692,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4591"
+NAME="AEN4830"
></A
><H3
><A
@@ -2163,7 +2749,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML buffer output</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -2180,7 +2766,1235 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> An attribute table</TD
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4851"
+></A
+><H3
+><A
+NAME="XMLVALIDATEROOT"
+></A
+>xmlValidateRoot ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateRoot (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a the root element
+basically it does the following check as described by the
+XML-1.0 recommendation:
+- [ VC: Root Element Type ]
+it doesn't try to recurse or apply other check to the element</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4876"
+></A
+><H3
+><A
+NAME="XMLVALIDATEELEMENTDECL"
+></A
+>xmlValidateElementDecl ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateElementDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLELEMENTPTR"
+>xmlElementPtr</A
+> elem);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a single element definition
+basically it does the following checks as described by the
+XML-1.0 recommendation:
+- [ VC: One ID per Element Type ]
+- [ VC: No Duplicate Types ]
+- [ VC: Unique Element Type Declaration ]</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>elem</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4906"
+></A
+><H3
+><A
+NAME="XMLVALIDATEATTRIBUTEDECL"
+></A
+>xmlValidateAttributeDecl ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateAttributeDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLATTRIBUTEPTR"
+>xmlAttributePtr</A
+> attr);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a single attribute definition
+basically it does the following checks as described by the
+XML-1.0 recommendation:
+- [ VC: Attribute Default Legal ]
+- [ VC: Enumeration ]
+- [ VC: ID Attribute Default ]</P
+><P
+>The ID/IDREF uniqueness and matching are done separately</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>attr</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4937"
+></A
+><H3
+><A
+NAME="XMLVALIDATENOTATIONDECL"
+></A
+>xmlValidateNotationDecl ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateNotationDecl (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNOTATIONPTR"
+>xmlNotationPtr</A
+> nota);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a single notation definition
+basically it does the following checks as described by the
+XML-1.0 recommendation:
+- it seems that no validity constraing exist on notation declarations
+But this function get called anyway ...</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>nota</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4967"
+></A
+><H3
+><A
+NAME="XMLVALIDATEDTD"
+></A
+>xmlValidateDtd ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateDtd (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLDTDPTR"
+>xmlDtdPtr</A
+> dtd);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate the dtd instance</P
+><P
+>basically it does check all the definitions in the DtD.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>dtd</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4998"
+></A
+><H3
+><A
+NAME="XMLVALIDATEDOCUMENT"
+></A
+>xmlValidateDocument ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateDocument (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate the document instance</P
+><P
+>basically it does the all the checks described by the
+i.e. validates the internal and external subset (if present)
+and validate the document tree.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5024"
+></A
+><H3
+><A
+NAME="XMLVALIDATEELEMENT"
+></A
+>xmlValidateElement ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateElement (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate the subtree under an element</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>elem</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5054"
+></A
+><H3
+><A
+NAME="XMLVALIDATEONEELEMENT"
+></A
+>xmlValidateOneElement ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateOneElement (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a single element and it's attributes,
+basically it does the following checks as described by the
+XML-1.0 recommendation:
+- [ VC: Element Valid ]
+- [ VC: Required Attribute ]
+Then call <A
+HREF="gnome-xml-valid.html#XMLVALIDATEONEATTRIBUTE"
+>xmlValidateOneAttribute</A
+>() for each attribute present.</P
+><P
+>The ID/IDREF checkings are done separately</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>elem</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5086"
+></A
+><H3
+><A
+NAME="XMLVALIDATEONEATTRIBUTE"
+></A
+>xmlValidateOneAttribute ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlValidateOneAttribute (<GTKDOCLINK
+HREF="XMLVALIDCTXTPTR"
+>xmlValidCtxtPtr</GTKDOCLINK
+> ctxt,
+ <A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> elem,
+ <A
+HREF="gnome-xml-tree.html#XMLATTRPTR"
+>xmlAttrPtr</A
+> attr,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *value);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Try to validate a single attribute for an element
+basically it * does the following checks as described by the
+XML-1.0 recommendation:
+- [ VC: Attribute Value Type ]
+- [ VC: Fixed Attribute Default ]
+- [ VC: Entity Name ]
+- [ VC: Name Token ]
+- [ VC: ID ]
+- [ VC: IDREF ]
+- [ VC: Entity Name ]
+- [ VC: Notation Attributes ]</P
+><P
+>The ID/IDREF uniqueness and matching are done separately</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+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"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>elem</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>attr</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>value</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5127"
+></A
+><H3
+><A
+NAME="XMLISMIXEDELEMENT"
+></A
+>xmlIsMixedElement ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int xmlIsMixedElement (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ const <A
+HREF="gnome-xml-tree.html#CHAR"
+>CHAR</A
+> *name);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Search in the DtDs whether an element accept Mixed content (or ANY)
+basically if it is supposed to accept text childs</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+>&nbsp;:</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-xml-error.html b/doc/html/gnome-xml-xml-error.html
index a58fd7f3..f7edde58 100644
--- a/doc/html/gnome-xml-xml-error.html
+++ b/doc/html/gnome-xml-xml-error.html
@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN4617"
+NAME="AEN5157"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@ NAME="AEN4617"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN4620"
+NAME="AEN5160"
></A
><H2
>Synopsis</H2
@@ -157,7 +157,7 @@ HREF="gnome-xml-xml-error.html#XMLPARSERWARNING"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4625"
+NAME="AEN5165"
></A
><H2
>Description</H2
@@ -167,14 +167,14 @@ NAME="AEN4625"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN4628"
+NAME="AEN5168"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4630"
+NAME="AEN5170"
></A
><H3
><A
@@ -227,7 +227,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -244,7 +244,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the message to display/transmit</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -261,7 +261,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> extra parameters for the message display</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -271,7 +271,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4653"
+NAME="AEN5193"
></A
><H3
><A
@@ -324,7 +324,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> an XML parser context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -341,7 +341,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the message to display/transmit</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -358,7 +358,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> extra parameters for the message display</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/gnome-xml-xpath.html b/doc/html/gnome-xml-xpath.html
index 539d8c85..5f9b676c 100644
--- a/doc/html/gnome-xml-xpath.html
+++ b/doc/html/gnome-xml-xpath.html
@@ -103,7 +103,7 @@ ALIGN="right"
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN6940"
+NAME="AEN7649"
></A
><H2
>Name</H2
@@ -111,7 +111,7 @@ NAME="AEN6940"
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN6943"
+NAME="AEN7652"
></A
><H2
>Synopsis</H2
@@ -216,7 +216,7 @@ HREF="XMLXPATHCONTEXTPTR"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6968"
+NAME="AEN7677"
></A
><H2
>Description</H2
@@ -226,14 +226,14 @@ NAME="AEN6968"
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN6971"
+NAME="AEN7680"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6973"
+NAME="AEN7682"
></A
><H3
><A
@@ -249,7 +249,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XPATH_UNDEFINED 0</PRE
+>#define XPATH_UNDEFINED</PRE
></TD
></TR
></TABLE
@@ -259,7 +259,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6978"
+NAME="AEN7687"
></A
><H3
><A
@@ -275,7 +275,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XPATH_NODESET 1</PRE
+>#define XPATH_NODESET</PRE
></TD
></TR
></TABLE
@@ -285,7 +285,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6983"
+NAME="AEN7692"
></A
><H3
><A
@@ -301,7 +301,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XPATH_BOOLEAN 2</PRE
+>#define XPATH_BOOLEAN</PRE
></TD
></TR
></TABLE
@@ -311,7 +311,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6988"
+NAME="AEN7697"
></A
><H3
><A
@@ -327,7 +327,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XPATH_NUMBER 3</PRE
+>#define XPATH_NUMBER</PRE
></TD
></TR
></TABLE
@@ -337,7 +337,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6993"
+NAME="AEN7702"
></A
><H3
><A
@@ -353,7 +353,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
->#define XPATH_STRING 4</PRE
+>#define XPATH_STRING</PRE
></TD
></TR
></TABLE
@@ -363,7 +363,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6998"
+NAME="AEN7707"
></A
><H3
><A
@@ -442,7 +442,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7017"
+NAME="AEN7726"
></A
><H3
><A
@@ -501,7 +501,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XML document</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -518,7 +518,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the variable list</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -535,7 +535,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the function list</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -552,7 +552,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the namespace list</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -567,7 +567,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlXPathContext just allocated.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -577,7 +577,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7050"
+NAME="AEN7759"
></A
><H3
><A
@@ -630,7 +630,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the context to free</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -640,7 +640,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7066"
+NAME="AEN7775"
></A
><H3
><A
@@ -700,7 +700,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XPath expression</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -717,7 +717,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XPath context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -732,8 +732,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlXPathObjectPtr resulting from the eveluation or NULL.
-the caller has to free the object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -743,7 +742,7 @@ the caller has to free the object.</TD
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7092"
+NAME="AEN7801"
></A
><H3
><A
@@ -796,7 +795,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the object to free</TD
+>&nbsp;</TD
></TR
></TABLE
><P
@@ -806,7 +805,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7108"
+NAME="AEN7817"
></A
><H3
><A
@@ -866,7 +865,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XPath expression</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -883,7 +882,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
-> the XPath context</TD
+>&nbsp;</TD
></TR
><TR
><TD
@@ -898,8 +897,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the xmlXPathObjectPtr resulting from the eveluation or NULL.
-the caller has to free the object.</TD
+>&nbsp;</TD
></TR
></TABLE
><P
diff --git a/doc/html/index.sgml b/doc/html/index.sgml
index a6789f99..34c6da5d 100644
--- a/doc/html/index.sgml
+++ b/doc/html/index.sgml
@@ -5,6 +5,7 @@
<ANCHOR id ="XMLPARSERNODEINFO" href="gnome-xml/gnome-xml-parser.html#XMLPARSERNODEINFO">
<ANCHOR id ="XMLPARSERNODEINFOSEQ" href="gnome-xml/gnome-xml-parser.html#XMLPARSERNODEINFOSEQ">
<ANCHOR id ="XMLPARSERNODEINFOSEQPTR" href="gnome-xml/gnome-xml-parser.html#XMLPARSERNODEINFOSEQPTR">
+<ANCHOR id ="XMLPARSERINPUTSTATE" href="gnome-xml/gnome-xml-parser.html#XMLPARSERINPUTSTATE">
<ANCHOR id ="XMLPARSERCTXT" href="gnome-xml/gnome-xml-parser.html#XMLPARSERCTXT">
<ANCHOR id ="XMLPARSERCTXTPTR" href="gnome-xml/gnome-xml-parser.html#XMLPARSERCTXTPTR">
<ANCHOR id ="XMLSAXLOCATOR" href="gnome-xml/gnome-xml-parser.html#XMLSAXLOCATOR">
@@ -12,6 +13,7 @@
<ANCHOR id ="RESOLVEENTITYSAXFUNC" href="gnome-xml/gnome-xml-parser.html#RESOLVEENTITYSAXFUNC">
<ANCHOR id ="INTERNALSUBSETSAXFUNC" href="gnome-xml/gnome-xml-parser.html#INTERNALSUBSETSAXFUNC">
<ANCHOR id ="GETENTITYSAXFUNC" href="gnome-xml/gnome-xml-parser.html#GETENTITYSAXFUNC">
+<ANCHOR id ="GETPARAMETERENTITYSAXFUNC" href="gnome-xml/gnome-xml-parser.html#GETPARAMETERENTITYSAXFUNC">
<ANCHOR id ="ENTITYDECLSAXFUNC" href="gnome-xml/gnome-xml-parser.html#ENTITYDECLSAXFUNC">
<ANCHOR id ="NOTATIONDECLSAXFUNC" href="gnome-xml/gnome-xml-parser.html#NOTATIONDECLSAXFUNC">
<ANCHOR id ="ATTRIBUTEDECLSAXFUNC" href="gnome-xml/gnome-xml-parser.html#ATTRIBUTEDECLSAXFUNC">
@@ -28,6 +30,7 @@
<ANCHOR id ="IGNORABLEWHITESPACESAXFUNC" href="gnome-xml/gnome-xml-parser.html#IGNORABLEWHITESPACESAXFUNC">
<ANCHOR id ="PROCESSINGINSTRUCTIONSAXFUNC" href="gnome-xml/gnome-xml-parser.html#PROCESSINGINSTRUCTIONSAXFUNC">
<ANCHOR id ="COMMENTSAXFUNC" href="gnome-xml/gnome-xml-parser.html#COMMENTSAXFUNC">
+<ANCHOR id ="CDATABLOCKSAXFUNC" href="gnome-xml/gnome-xml-parser.html#CDATABLOCKSAXFUNC">
<ANCHOR id ="WARNINGSAXFUNC" href="gnome-xml/gnome-xml-parser.html#WARNINGSAXFUNC">
<ANCHOR id ="ERRORSAXFUNC" href="gnome-xml/gnome-xml-parser.html#ERRORSAXFUNC">
<ANCHOR id ="FATALERRORSAXFUNC" href="gnome-xml/gnome-xml-parser.html#FATALERRORSAXFUNC">
@@ -133,6 +136,7 @@
<ANCHOR id ="XMLNEWTEXTLEN" href="gnome-xml/gnome-xml-tree.html#XMLNEWTEXTLEN">
<ANCHOR id ="XMLNEWDOCCOMMENT" href="gnome-xml/gnome-xml-tree.html#XMLNEWDOCCOMMENT">
<ANCHOR id ="XMLNEWCOMMENT" href="gnome-xml/gnome-xml-tree.html#XMLNEWCOMMENT">
+<ANCHOR id ="XMLNEWCDATABLOCK" href="gnome-xml/gnome-xml-tree.html#XMLNEWCDATABLOCK">
<ANCHOR id ="XMLNEWREFERENCE" href="gnome-xml/gnome-xml-tree.html#XMLNEWREFERENCE">
<ANCHOR id ="XMLCOPYNODE" href="gnome-xml/gnome-xml-tree.html#XMLCOPYNODE">
<ANCHOR id ="XMLCOPYNODELIST" href="gnome-xml/gnome-xml-tree.html#XMLCOPYNODELIST">
@@ -184,6 +188,7 @@
<ANCHOR id ="XMLGETPREDEFINEDENTITY" href="gnome-xml/gnome-xml-entities.html#XMLGETPREDEFINEDENTITY">
<ANCHOR id ="XMLGETDOCENTITY" href="gnome-xml/gnome-xml-entities.html#XMLGETDOCENTITY">
<ANCHOR id ="XMLGETDTDENTITY" href="gnome-xml/gnome-xml-entities.html#XMLGETDTDENTITY">
+<ANCHOR id ="XMLGETPARAMETERENTITY" href="gnome-xml/gnome-xml-entities.html#XMLGETPARAMETERENTITY">
<ANCHOR id ="XMLENCODEENTITIES" href="gnome-xml/gnome-xml-entities.html#XMLENCODEENTITIES">
<ANCHOR id ="XMLENCODEENTITIESREENTRANT" href="gnome-xml/gnome-xml-entities.html#XMLENCODEENTITIESREENTRANT">
<ANCHOR id ="XMLCREATEENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLCREATEENTITIESTABLE">
@@ -191,6 +196,10 @@
<ANCHOR id ="XMLFREEENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLFREEENTITIESTABLE">
<ANCHOR id ="XMLDUMPENTITIESTABLE" href="gnome-xml/gnome-xml-entities.html#XMLDUMPENTITIESTABLE">
<ANCHOR id ="GNOME-XML-VALID" href="gnome-xml/gnome-xml-valid.html">
+<ANCHOR id ="XMLVALIDITYERRORFUNC" href="gnome-xml/gnome-xml-valid.html#XMLVALIDITYERRORFUNC">
+<ANCHOR id ="XMLVALIDITYWARNINGFUNC" href="gnome-xml/gnome-xml-valid.html#XMLVALIDITYWARNINGFUNC">
+<ANCHOR id ="XMLPARSERVALIDITYERROR" href="gnome-xml/gnome-xml-valid.html#XMLPARSERVALIDITYERROR">
+<ANCHOR id ="XMLPARSERVALIDITYWARNING" href="gnome-xml/gnome-xml-valid.html#XMLPARSERVALIDITYWARNING">
<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">
<ANCHOR id ="XML-MIN-ELEMENT-TABLE" href="gnome-xml/gnome-xml-valid.html#XML-MIN-ELEMENT-TABLE">
@@ -215,10 +224,23 @@
<ANCHOR id ="XMLCOPYATTRIBUTETABLE" href="gnome-xml/gnome-xml-valid.html#XMLCOPYATTRIBUTETABLE">
<ANCHOR id ="XMLFREEATTRIBUTETABLE" href="gnome-xml/gnome-xml-valid.html#XMLFREEATTRIBUTETABLE">
<ANCHOR id ="XMLDUMPATTRIBUTETABLE" href="gnome-xml/gnome-xml-valid.html#XMLDUMPATTRIBUTETABLE">
+<ANCHOR id ="XMLVALIDATEROOT" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEROOT">
+<ANCHOR id ="XMLVALIDATEELEMENTDECL" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEELEMENTDECL">
+<ANCHOR id ="XMLVALIDATEATTRIBUTEDECL" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEATTRIBUTEDECL">
+<ANCHOR id ="XMLVALIDATENOTATIONDECL" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATENOTATIONDECL">
+<ANCHOR id ="XMLVALIDATEDTD" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEDTD">
+<ANCHOR id ="XMLVALIDATEDOCUMENT" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEDOCUMENT">
+<ANCHOR id ="XMLVALIDATEELEMENT" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEELEMENT">
+<ANCHOR id ="XMLVALIDATEONEELEMENT" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEONEELEMENT">
+<ANCHOR id ="XMLVALIDATEONEATTRIBUTE" href="gnome-xml/gnome-xml-valid.html#XMLVALIDATEONEATTRIBUTE">
+<ANCHOR id ="XMLISMIXEDELEMENT" href="gnome-xml/gnome-xml-valid.html#XMLISMIXEDELEMENT">
<ANCHOR id ="GNOME-XML-XML-ERROR" href="gnome-xml/gnome-xml-xml-error.html">
<ANCHOR id ="XMLPARSERERROR" href="gnome-xml/gnome-xml-xml-error.html#XMLPARSERERROR">
<ANCHOR id ="XMLPARSERWARNING" href="gnome-xml/gnome-xml-xml-error.html#XMLPARSERWARNING">
<ANCHOR id ="GNOME-XML-PARSERINTERNALS" href="gnome-xml/gnome-xml-parserinternals.html">
+<ANCHOR id ="CHARVAL" href="gnome-xml/gnome-xml-parserinternals.html#CHARVAL">
+<ANCHOR id ="NEXTCHARVAL" href="gnome-xml/gnome-xml-parserinternals.html#NEXTCHARVAL">
+<ANCHOR id ="SKIPCHARVAL" href="gnome-xml/gnome-xml-parserinternals.html#SKIPCHARVAL">
<ANCHOR id ="IS-CHAR" href="gnome-xml/gnome-xml-parserinternals.html#IS-CHAR">
<ANCHOR id ="IS-BLANK" href="gnome-xml/gnome-xml-parserinternals.html#IS-BLANK">
<ANCHOR id ="IS-BASECHAR" href="gnome-xml/gnome-xml-parserinternals.html#IS-BASECHAR">
@@ -235,6 +257,8 @@
<ANCHOR id ="XMLCREATEFILEPARSERCTXT" href="gnome-xml/gnome-xml-parserinternals.html#XMLCREATEFILEPARSERCTXT">
<ANCHOR id ="XMLCREATEMEMORYPARSERCTXT" href="gnome-xml/gnome-xml-parserinternals.html#XMLCREATEMEMORYPARSERCTXT">
<ANCHOR id ="XMLFREEPARSERCTXT" href="gnome-xml/gnome-xml-parserinternals.html#XMLFREEPARSERCTXT">
+<ANCHOR id ="XMLNEWPARSERCTXT" href="gnome-xml/gnome-xml-parserinternals.html#XMLNEWPARSERCTXT">
+<ANCHOR id ="XMLSWITCHENCODING" href="gnome-xml/gnome-xml-parserinternals.html#XMLSWITCHENCODING">
<ANCHOR id ="XMLHANDLEENTITY" href="gnome-xml/gnome-xml-parserinternals.html#XMLHANDLEENTITY">
<ANCHOR id ="XMLNEWENTITYINPUTSTREAM" href="gnome-xml/gnome-xml-parserinternals.html#XMLNEWENTITYINPUTSTREAM">
<ANCHOR id ="XMLPUSHINPUT" href="gnome-xml/gnome-xml-parserinternals.html#XMLPUSHINPUT">
@@ -247,6 +271,7 @@
<ANCHOR id ="XMLNAMESPACEPARSENSDEF" href="gnome-xml/gnome-xml-parserinternals.html#XMLNAMESPACEPARSENSDEF">
<ANCHOR id ="XMLPARSEQUOTEDSTRING" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSEQUOTEDSTRING">
<ANCHOR id ="XMLPARSENAMESPACE" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSENAMESPACE">
+<ANCHOR id ="XMLSCANNAME" href="gnome-xml/gnome-xml-parserinternals.html#XMLSCANNAME">
<ANCHOR id ="XMLPARSENAME" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSENAME">
<ANCHOR id ="XMLPARSENMTOKEN" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSENMTOKEN">
<ANCHOR id ="XMLPARSEENTITYVALUE" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSEENTITYVALUE">
@@ -289,6 +314,7 @@
<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 ="XMLPARSEEXTERNALSUBSET" href="gnome-xml/gnome-xml-parserinternals.html#XMLPARSEEXTERNALSUBSET">
<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">
diff --git a/doc/xml.html b/doc/xml.html
index 03abc155..edeb391e 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -1,23 +1,54 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
-<title>The XML library for Gnome</title>
-<meta name="GENERATOR" content="amaya V1.3b">
+ <title>The XML library for Gnome</title>
+ <meta name="GENERATOR" content="amaya V2.1">
</head>
-<body bgcolor="#ffffff">
+<body bgcolor="#ffffff">
<h1 align="center">The XML library for Gnome</h1>
-<p>
-This document describes the <a href="http://www.w3.org/XML/">XML</a> library
-provideed in the <a href="http://www.gnome.org/">Gnome</a> framework. XML is a
-standard to build tag based structured documents. The internal document
-repesentation is as close as possible to the <a
-href="http://www.w3.org/DOM/">DOM</a> interfaces.</p>
+
+<p>This document describes the <a href="http://www.w3.org/XML/">XML</a>
+library provideed in the <a href="http://www.gnome.org/">Gnome</a> framework.
+XML is a standard to build tag based structured documents/data. </p>
+
+<p>The internal document repesentation is as close as possible to the <a
+href="http://www.w3.org/DOM/">DOM</a> interfaces. </p>
+
+<p>Libxml also has a <a href="http://www.megginson.com/SAX/index.html">SAX
+interface</a>, <a href="mailto:james@daa.com.au">James Henstridge</a> made <a
+href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">a nice
+documentation</a> expaining how to use it. The interface is as compatible as
+possible with <a href="http://www.jclark.com/xml/expat.html">Expat</a>
+one.</p>
+
+<p>The code is commented in a <a href=""></a>way which allow <a
+href="http://rpmfind.net/veillard/XML/libxml.html">extensive documentation</a>
+to be automatically extracted.</p>
+
+<p>There is also a mailing-list <a
+href="xml@rufus.w3.org">xml@rufus.w3.org</a> for libxml, with an <a
+href="http://rpmfind.net/veillard/XML/messages">on-line archive</a>. To
+subscribe to this majordomo based list, send a mail to <a
+href="majordomo@rufus.w3.org">majordomo@rufus.w3.org</a> with "subscribe xml"
+in the <strong>content</strong> of the message.</p>
+
+<p>This library is released both under the W3C Copyright and the GNU LGP,
+basically everybody should be happy, if not, drop me a mail.</p>
+
+<p>People are invited to use the <a
+href="http://cvs.gnome.org/lxr/source/gdome/">gdome Gnome module to</a> get a
+full DOM interface, thanks to <a href="mailto:raph@levien.com">Raph
+Levien</a>, check his <a
+href="http://www.levien.com/gnome/domination.html">DOMination paper</a>. He
+uses it for his implementation of <a
+href="http://www.w3.org/Graphics/SVG/">SVG</a> called <a
+href="http://www.levien.com/svg/">gill</a>.</p>
<h2>xml</h2>
-<p>
-XML is a standard for markup based structured documents, here is <a
+
+<p>XML is a standard for markup based structured documents, here is <a
name="example">an example</a>:</p>
<pre>&lt;?xml version="1.0"?>
&lt;EXAMPLE prop1="gnome is great" prop2="&amp;amp; linux too">
@@ -31,17 +62,17 @@ name="example">an example</a>:</p>
&lt;p>...&lt;/p>
&lt;/chapter>
&lt;/EXAMPLE></pre>
-<p>
-The first line specify that it's an XML document and gives useful informations
-about it's encoding. Then the document is a text format whose structure is
-specified by tags between brackets. <strong>Each tag opened have to be
-closed</strong> XML is pedantic about this, not that for example the image
-tag has no content (just an attribute) and is closed by ending up the tag
-with <code>/></code>.</p>
+
+<p>The first line specify that it's an XML document and gives useful
+informations about it's encoding. Then the document is a text format whose
+structure is specified by tags between brackets. <strong>Each tag opened have
+to be closed</strong> XML is pedantic about this, not that for example the
+image tag has no content (just an attribute) and is closed by ending up the
+tag with <code>/></code>.</p>
<h2>The tree output</h2>
-<p>
-The parser returns a tree built during the document analysis. The value
+
+<p>The parser returns a tree built during the document analysis. The value
returned is an <strong>xmlDocPtr</strong> (i.e. a pointer to an
<strong>xmlDoc</strong> structure). This structure contains informations like
the file name, the document type, and a <strong>root</strong> pointer which
@@ -50,13 +81,13 @@ which is the document). The tree is made of <strong>xmlNode</strong>s, chained
in double linked lists of siblings and with childs&lt;->parent relationship.
An xmlNode can also carry properties (a chain of xmlAttr structures). An
attribute may have a value which is a list of TEXT or ENTITY_REF nodes.</p>
-<p>
-Here is an example (erroneous w.r.t. the XML spec since there should be only
-one ELEMENT under the root):</p>
-<p>
-<img src="structure.gif" alt=" structure.gif "></p>
-<p>
-In the source package there is a small program (not installed by default)
+
+<p>Here is an example (erroneous w.r.t. the XML spec since there should be
+only one ELEMENT under the root):</p>
+
+<p><img src="structure.gif" alt=" structure.gif "></p>
+
+<p>In the source package there is a small program (not installed by default)
called <strong>tester</strong> which parses XML files given as argument and
prints them back as parsed, this is useful to detect errors both in XML code
and in the XML parser itself. It has an option <strong>--debug</strong> which
@@ -91,12 +122,12 @@ standalone=true
ELEMENT p
TEXT
content=...</pre>
-<p>
-This should be useful to learn the internal representation model.</p>
+
+<p>This should be useful to learn the internal representation model.</p>
<h2>The XML library interfaces</h2>
-<p>
-This section is directly intended to help programmers getting bootstrapped
+
+<p>This section is directly intended to help programmers getting bootstrapped
using the XML library from the C language. It doesn't intent to be extensive,
I hope the automatically generated docs will provide the completeness
required, but as a separated set of documents. The interfaces of the XML
@@ -105,35 +136,33 @@ interested in a higher level API should <a href="#DOM">look at DOM</a>
(unfortunately not completed).</p>
<h3>Invoking the parser</h3>
-<p>
-Usually, the first thing to do is to read an XML input, the parser accepts to
-parse both memory mapped documents or direct files. The functions are defined
-in "parser.h":</p>
+
+<p>Usually, the first thing to do is to read an XML input, the parser accepts
+to parse both memory mapped documents or direct files. The functions are
+defined in "parser.h":</p>
<dl>
-<dt><code>xmlDocPtr xmlParseMemory(char *buffer, int size);</code></dt>
-<dd><p>
-parse a zero terminated string containing the document</p>
-</dd>
+ <dt><code>xmlDocPtr xmlParseMemory(char *buffer, int size);</code></dt>
+ <dd><p>parse a zero terminated string containing the document</p>
+ </dd>
</dl>
<dl>
-<dt><code>xmlDocPtr xmlParseFile(const char *filename);</code></dt>
-<dd><p>
-parse an XML document contained in a file (possibly compressed)</p>
-</dd>
+ <dt><code>xmlDocPtr xmlParseFile(const char *filename);</code></dt>
+ <dd><p>parse an XML document contained in a file (possibly compressed)</p>
+ </dd>
</dl>
-<p>
-This returns a pointer to the document structure (or NULL in case of
+
+<p>This returns a pointer to the document structure (or NULL in case of
failure).</p>
-<p>
-A couple of comments can be made, first this mean that the parser is
+
+<p>A couple of comments can be made, first this mean that the parser is
memory-hungry, first to load the document in memory, second to build the tree.
Reading a document without building the tree will be possible in the future by
pluggin the code to the SAX interface (see SAX.c).</p>
<h3>Building a tree from scratch</h3>
-<p>
-The other way to get an XML tree in memory is by building it. Basically there
-is a set of functions dedicated to building new elements, those are also
+
+<p>The other way to get an XML tree in memory is by building it. Basically
+there is a set of functions dedicated to building new elements, those are also
described in "tree.h", here is for example the piece of code producing the
example used before:</p>
<pre> xmlDocPtr doc;
@@ -150,129 +179,120 @@ example used before:</p>
subtree = xmlNewChild(tree, NULL, "p", "bla bla bla ...");
subtree = xmlNewChild(tree, NULL, "image", NULL);
xmlSetProp(subtree, "href", "linus.gif");</pre>
-<p>
-Not really rocket science ...</p>
+
+<p>Not really rocket science ...</p>
<h3>Traversing the tree</h3>
-<p>
-Basically by including "tree.h" your code has access to the internal structure
-of all the element of the tree. The names should be somewhat simple like
-<strong>parent</strong>, <strong>childs</strong>, <strong>next</strong>,
+
+<p>Basically by including "tree.h" your code has access to the internal
+structure of all the element of the tree. The names should be somewhat simple
+like <strong>parent</strong>, <strong>childs</strong>, <strong>next</strong>,
<strong>prev</strong>, <strong>properties</strong>, etc... For example still
with the previous example:</p>
<pre><code>doc->root->childs->childs</code></pre>
-<p>
-points to the title element,</p>
+
+<p>points to the title element,</p>
<pre>doc->root->childs->next->child->child</pre>
-<p>
-points to the text node containing the chapter titlle "The Linux adventure"
+
+<p>points to the text node containing the chapter titlle "The Linux adventure"
and</p>
<pre>doc->root->properties->next->val</pre>
-<p>
-points to the entity reference containing the value of "&amp;linux" at the
+
+<p>points to the entity reference containing the value of "&amp;linux" at the
beginning of the second attribute of the root element "EXAMPLE".</p>
<h3>Modifying the tree</h3>
-<p>
-functions are provided to read and write the document content:</p>
+
+<p>functions are provided to read and write the document content:</p>
<dl>
-<dt><code>xmlAttrPtr xmlSetProp(xmlNodePtr node, const CHAR *name, const CHAR
-*value);</code></dt>
-<dd><p>
-This set (or change) an attribute carried by an ELEMENT node the value can be
-NULL</p>
-</dd>
+ <dt><code>xmlAttrPtr xmlSetProp(xmlNodePtr node, const CHAR *name, const
+ CHAR *value);</code></dt>
+ <dd><p>This set (or change) an attribute carried by an ELEMENT node the
+ value can be NULL</p>
+ </dd>
</dl>
<dl>
-<dt><code>const CHAR *xmlGetProp(xmlNodePtr node, const CHAR
-*name);</code></dt>
-<dd><p>
-This function returns a pointer to the property content, note that no extra
-copy is made</p>
-</dd>
+ <dt><code>const CHAR *xmlGetProp(xmlNodePtr node, const CHAR
+ *name);</code></dt>
+ <dd><p>This function returns a pointer to the property content, note that
+ no extra copy is made</p>
+ </dd>
</dl>
-<p>
-Two functions must be used to read an write the text associated to
+
+<p>Two functions must be used to read an write the text associated to
elements:</p>
<dl>
-<dt><code>xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const CHAR
-*value);</code></dt>
-<dd><p>
-This function takes an "external" string and convert it to one text node or
-possibly to a list of entity and text nodes. All non-predefined entity
-references like &amp;Gnome; will be stored internally as an entity node, hence
-the result of the function may not be a single node.</p>
-</dd>
+ <dt><code>xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const CHAR
+ *value);</code></dt>
+ <dd><p>This function takes an "external" string and convert it to one text
+ node or possibly to a list of entity and text nodes. All non-predefined
+ entity references like &amp;Gnome; will be stored internally as an
+ entity node, hence the result of the function may not be a single
+ node.</p>
+ </dd>
</dl>
<dl>
-<dt><code>CHAR *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int
-inLine);</code></dt>
-<dd><p>
-this is the dual function, which generate a new string containing the content
-of the text and entity nodes. Note the extra argument inLine, if set to 1
-instead of returning the &amp;Gnome; XML encoding in the string it will
-substitute it with it's value say "GNU Network Object Model Environment". Set
-it if you want to use the string for non XML usage like User Interface.</p>
-</dd>
+ <dt><code>CHAR *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int
+ inLine);</code></dt>
+ <dd><p>this is the dual function, which generate a new string containing
+ the content of the text and entity nodes. Note the extra argument
+ inLine, if set to 1 instead of returning the &amp;Gnome; XML encoding in
+ the string it will substitute it with it's value say "GNU Network Object
+ Model Environment". Set it if you want to use the string for non XML
+ usage like User Interface.</p>
+ </dd>
</dl>
<h3>Saving a tree</h3>
-<p>
-Basically 3 options are possible:</p>
+
+<p>Basically 3 options are possible:</p>
<dl>
-<dt><code>void xmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int
-*size);</code></dt>
-<dd><p>
-returns a buffer where the document has been saved</p>
-</dd>
+ <dt><code>void xmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int
+ *size);</code></dt>
+ <dd><p>returns a buffer where the document has been saved</p>
+ </dd>
</dl>
<dl>
-<dt><code>extern void xmlDocDump(FILE *f, xmlDocPtr doc);</code></dt>
-<dd><p>
-dumps a buffer to an open file descriptor</p>
-</dd>
+ <dt><code>extern void xmlDocDump(FILE *f, xmlDocPtr doc);</code></dt>
+ <dd><p>dumps a buffer to an open file descriptor</p>
+ </dd>
</dl>
<dl>
-<dt><code>int xmlSaveFile(const char *filename, xmlDocPtr cur);</code></dt>
-<dd><p>
-save the document ot a file. In that case the compression interface is
-triggered if turned on</p>
-</dd>
+ <dt><code>int xmlSaveFile(const char *filename, xmlDocPtr cur);</code></dt>
+ <dd><p>save the document ot a file. In that case the compression interface
+ is triggered if turned on</p>
+ </dd>
</dl>
<h3>Compression</h3>
-<p>
-The library handle transparently compression when doing file based accesses,
-the level of compression on saves can be tuned either globally or individually
-for one file:</p>
+
+<p>The library handle transparently compression when doing file based
+accesses, the level of compression on saves can be tuned either globally or
+individually for one file:</p>
<dl>
-<dt><code>int xmlGetDocCompressMode (xmlDocPtr doc);</code></dt>
-<dd><p>
-Get the document compression ratio (0-9)</p>
-</dd>
+ <dt><code>int xmlGetDocCompressMode (xmlDocPtr doc);</code></dt>
+ <dd><p>Get the document compression ratio (0-9)</p>
+ </dd>
</dl>
<dl>
-<dt><code>void xmlSetDocCompressMode (xmlDocPtr doc, int mode);</code></dt>
-<dd><p>
-Set the document compression ratio</p>
-</dd>
+ <dt><code>void xmlSetDocCompressMode (xmlDocPtr doc, int mode);</code></dt>
+ <dd><p>Set the document compression ratio</p>
+ </dd>
</dl>
<dl>
-<dt><code>int xmlGetCompressMode(void);</code></dt>
-<dd><p>
-Get the default compression ratio</p>
-</dd>
+ <dt><code>int xmlGetCompressMode(void);</code></dt>
+ <dd><p>Get the default compression ratio</p>
+ </dd>
</dl>
<dl>
-<dt><code>void xmlSetCompressMode(int mode);</code></dt>
-<dd><p>
-set the default compression ratio</p>
-</dd>
+ <dt><code>void xmlSetCompressMode(int mode);</code></dt>
+ <dd><p>set the default compression ratio</p>
+ </dd>
</dl>
<h2><a name="DOM">DOM Principles</a></h2>
-<p>
-<a href="http://www.w3.org/DOM/">DOM</a> stands for the <em>Document Object
+
+<p><a href="http://www.w3.org/DOM/">DOM</a> stands for the <em>Document Object
Model</em> this is an API for accessing XML or HTML structured documents.
Native support for DOM in Gnome is on the way (module gnome-dom), and it will
be based on gnome-xml. This will be a far cleaner interface to manipulate XML
@@ -280,20 +300,20 @@ files within Gnome since it won't expose the internal structure. DOM defiles a
set of IDL (or Java) interfaces allowing to traverse and manipulate a
document. The DOM library will allow accessing and modifying "live" documents
presents on other programs like this:</p>
-<p>
-<img src="DOM.gif" alt=" DOM.gif "></p>
-<p>
-This should help greatly doing things like modifying a gnumeric spreadsheet
+
+<p><img src="DOM.gif" alt=" DOM.gif "></p>
+
+<p>This should help greatly doing things like modifying a gnumeric spreadsheet
embedded in a GWP document for example.</p>
<h3><a name="Example">A real example</a></h3>
-<p>
-Here is a real size example, where the actual content of the application data
-is not kept in the DOM tree but uses internal structures. It is based on
+
+<p>Here is a real size example, where the actual content of the application
+data is not kept in the DOM tree but uses internal structures. It is based on
a proposal to keep a database of jobs related to Gnome, with an XML based
-storage structure. Here is an <a href="gjobs.xml">XML encoded jobs base</a>:
-<pre>
-&lt;?xml version="1.0"?>
+storage structure. Here is an <a href="gjobs.xml">XML encoded jobs
+base</a>:</p>
+<pre>&lt;?xml version="1.0"?>
&lt;gjob:Helping xmlns:gjob="http://www.gnome.org/some-location">
&lt;gjob:Jobs>
@@ -303,8 +323,8 @@ storage structure. Here is an <a href="gjobs.xml">XML encoded jobs base</a>:
&lt;gjob:Category>Development&lt;/gjob:Category>
&lt;gjob:Update>
- &lt;gjob:Status>Open&lt;/gjob:Status>
- &lt;gjob:Modified>Mon, 07 Jun 1999 20:27:45 -0400 MET DST&lt;/gjob:Modified>
+ &lt;gjob:Status>Open&lt;/gjob:Status>
+ &lt;gjob:Modified>Mon, 07 Jun 1999 20:27:45 -0400 MET DST&lt;/gjob:Modified>
&lt;gjob:Salary>USD 0.00&lt;/gjob:Salary>
&lt;/gjob:Update>
@@ -315,17 +335,17 @@ storage structure. Here is an <a href="gjobs.xml">XML encoded jobs base</a>:
&lt;gjob:Contact>
&lt;gjob:Person>Nathan Clemons&lt;/gjob:Person>
- &lt;gjob:Email>nathan@windsofstorm.net&lt;/gjob:Email>
+ &lt;gjob:Email>nathan@windsofstorm.net&lt;/gjob:Email>
&lt;gjob:Company>
- &lt;/gjob:Company>
+ &lt;/gjob:Company>
&lt;gjob:Organisation>
- &lt;/gjob:Organisation>
+ &lt;/gjob:Organisation>
&lt;gjob:Webpage>
- &lt;/gjob:Webpage>
- &lt;gjob:Snailmail>
- &lt;/gjob:Snailmail>
- &lt;gjob:Phone>
- &lt;/gjob:Phone>
+ &lt;/gjob:Webpage>
+ &lt;gjob:Snailmail>
+ &lt;/gjob:Snailmail>
+ &lt;gjob:Phone>
+ &lt;/gjob:Phone>
&lt;/gjob:Contact>
&lt;gjob:Requirements>
@@ -349,23 +369,18 @@ storage structure. Here is an <a href="gjobs.xml">XML encoded jobs base</a>:
&lt;/gjob:Jobs>
&lt;/gjob:Helping>
-
</pre>
-<p>
-While loading the XML file into an internal DOM tree is a matter of calling
-only a couple of functions, browsing the tree to gather the informations
-and generate the internals structures is harder, and more error prone.
-</p>
-<p>
-The suggested principle is to be tolerant with respect to the input
-structure. For example the ordering of the attributes is not significant,
-Cthe XML specification is clear about it. It's also usually a good idea
-to not be dependant of the orders of the childs of a given node, unless it
-really makes things harder. Here is some code to parse the informations
-for a person:
-</p>
-<pre>
-/*
+
+<p>While loading the XML file into an internal DOM tree is a matter of calling
+only a couple of functions, browsing the tree to gather the informations and
+generate the internals structures is harder, and more error prone.</p>
+
+<p>The suggested principle is to be tolerant with respect to the input
+structure. For example the ordering of the attributes is not significant, Cthe
+XML specification is clear about it. It's also usually a good idea to not be
+dependant of the orders of the childs of a given node, unless it really makes
+things harder. Here is some code to parse the informations for a person:</p>
+<pre>/*
* A person record
*/
typedef struct person {
@@ -391,7 +406,7 @@ DEBUG("parsePerson\n");
ret = (personPtr) malloc(sizeof(person));
if (ret == NULL) {
fprintf(stderr,"out of memory\n");
- return(NULL);
+ return(NULL);
}
memset(ret, 0, sizeof(person));
@@ -399,38 +414,36 @@ DEBUG("parsePerson\n");
cur = cur->childs;
while (cur != NULL) {
if ((!strcmp(cur->name, "Person")) &amp;&amp; (cur->ns == ns))
- ret->name = xmlNodeListGetString(doc, cur->childs, 1);
+ ret->name = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Email")) &amp;&amp; (cur->ns == ns))
- ret->email = xmlNodeListGetString(doc, cur->childs, 1);
- cur = cur->next;
+ ret->email = xmlNodeListGetString(doc, cur->childs, 1);
+ cur = cur->next;
}
return(ret);
-}
-</pre>
-<p>
-Here is a couple of things to notice:</p>
+}</pre>
+
+<p>Here is a couple of things to notice:</p>
<ul>
-<li> Usually a recursive parsing style is the more convenient one,
-XML data being by nature subject to repetitive constructs and usualy exibit
-highly stuctured patterns.
-<li> The two arguments of type <em>xmlDocPtr</em> and <em>xmlNsPtr</em>, i.e.
-the pointer to the global XML document and the namespace reserved to the
-application. Document wide information are needed for example to decode
-entities and it's a good coding practice to define a namespace for your
-application set of data and test that the element and attributes you're
-analyzing actually pertains to your application space. This is done by a simple
-equality test (cur->ns == ns).
-<li> To retrieve text and attributes value, it is suggested to use
-the function <em>xmlNodeListGetString</em> to gather all the text and
-entity reference nodes generated by the DOM output and produce an
-single text string.
+ <li>Usually a recursive parsing style is the more convenient one, XML data
+ being by nature subject to repetitive constructs and usualy exibit highly
+ stuctured patterns.</li>
+ <li>The two arguments of type <em>xmlDocPtr</em> and <em>xmlNsPtr</em>, i.e.
+ the pointer to the global XML document and the namespace reserved to the
+ application. Document wide information are needed for example to decode
+ entities and it's a good coding practice to define a namespace for your
+ application set of data and test that the element and attributes you're
+ analyzing actually pertains to your application space. This is done by a
+ simple equality test (cur->ns == ns).</li>
+ <li>To retrieve text and attributes value, it is suggested to use the
+ function <em>xmlNodeListGetString</em> to gather all the text and entity
+ reference nodes generated by the DOM output and produce an single text
+ string.</li>
</ul>
-<p>
-Here is another piece of code used to parse another level of the structure:
-</p>
-<pre>
-/*
+
+<p>Here is another piece of code used to parse another level of the
+structure:</p>
+<pre>/*
* a Description for a Job
*/
typedef struct job {
@@ -455,7 +468,7 @@ DEBUG("parseJob\n");
ret = (jobPtr) malloc(sizeof(job));
if (ret == NULL) {
fprintf(stderr,"out of memory\n");
- return(NULL);
+ return(NULL);
}
memset(ret, 0, sizeof(job));
@@ -464,34 +477,32 @@ DEBUG("parseJob\n");
while (cur != NULL) {
if ((!strcmp(cur->name, "Project")) &amp;&amp; (cur->ns == ns)) {
- ret->projectID = xmlGetProp(cur, "ID");
- if (ret->projectID == NULL) {
- fprintf(stderr, "Project has no ID\n");
- }
- }
+ ret->projectID = xmlGetProp(cur, "ID");
+ if (ret->projectID == NULL) {
+ fprintf(stderr, "Project has no ID\n");
+ }
+ }
if ((!strcmp(cur->name, "Application")) &amp;&amp; (cur->ns == ns))
- ret->application = xmlNodeListGetString(doc, cur->childs, 1);
+ ret->application = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Category")) &amp;&amp; (cur->ns == ns))
- ret->category = xmlNodeListGetString(doc, cur->childs, 1);
+ ret->category = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Contact")) &amp;&amp; (cur->ns == ns))
- ret->contact = parsePerson(doc, ns, cur);
- cur = cur->next;
+ ret->contact = parsePerson(doc, ns, cur);
+ cur = cur->next;
}
return(ret);
-}
-</pre>
-<p>
-One can notice that once used to it, writing this kind of code
-is quite simple, but boring. Ultimately, it could be possble to write
-stubbers taking either C data structure definitions, a set of XML examples
-or an XML DTD and produce the code needed to import and export the
-content between C data and XML storage. This is left as an exercise to
-the reader :-)</p>
-<p>
-Feel free to use <a href="gjobread.c">the code for the full C parsing
-example</a> as a template,
-
-<a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a>
+}</pre>
+
+<p>One can notice that once used to it, writing this kind of code is quite
+simple, but boring. Ultimately, it could be possble to write stubbers taking
+either C data structure definitions, a set of XML examples or an XML DTD and
+produce the code needed to import and export the content between C data and
+XML storage. This is left as an exercise to the reader :-)</p>
+
+<p>Feel free to use <a href="gjobread.c">the code for the full C parsing
+example</a> as a template,</p>
+
+<p> <a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a></p>
</body>
</html>
diff --git a/encoding.c b/encoding.c
index 8ea34490..1771ec1c 100644
--- a/encoding.c
+++ b/encoding.c
@@ -23,7 +23,13 @@
#include <string.h>
#include <stdio.h>
#include "encoding.h"
+#ifdef HAVE_UNICODE_H
+#include <unicode.h>
+#endif
+#ifdef HAVE_UNICODE_H
+
+#else /* ! HAVE_UNICODE_H */
/*
* From rfc2044: encoding of the Unicode values on UTF-8:
*
@@ -206,6 +212,7 @@ UTF8ToUTF16(unsigned short* out, int outlen, unsigned char* in, int inlen)
return out-outstart;
}
+#endif /* ! HAVE_UNICODE_H */
/**
* xmlDetectCharEncoding:
@@ -407,8 +414,11 @@ xmlInitCharEncodingHandlers(void) {
return;
}
xmlNewCharEncodingHandler("UTF-8", NULL, NULL);
+#ifdef HAVE_UNICODE_H
+#else
xmlNewCharEncodingHandler("UTF-16", UTF16ToUTF8, UTF8ToUTF16);
xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1);
+#endif
}
/**
diff --git a/entities.c b/entities.c
index e1ec0af6..f0971d1c 100644
--- a/entities.c
+++ b/entities.c
@@ -68,7 +68,17 @@ xmlAddEntity(xmlEntitiesTablePtr table, const CHAR *name, int type,
* The entity is already defined in this Dtd, the spec says to NOT
* override it ... Is it worth a Warning ??? !!!
*/
- return;
+ if (((type == XML_INTERNAL_PARAMETER_ENTITY) ||
+ (type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
+ ((cur->type == XML_INTERNAL_PARAMETER_ENTITY) ||
+ (cur->type == XML_EXTERNAL_PARAMETER_ENTITY)))
+ return;
+ else
+ if (((type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (type != XML_EXTERNAL_PARAMETER_ENTITY)) &&
+ ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (cur->type != XML_EXTERNAL_PARAMETER_ENTITY)))
+ return;
}
}
if (table->nb_entities >= table->max_entities) {
@@ -78,9 +88,9 @@ xmlAddEntity(xmlEntitiesTablePtr table, const CHAR *name, int type,
table->max_entities *= 2;
table->table = (xmlEntityPtr)
realloc(table->table, table->max_entities * sizeof(xmlEntity));
- if (table->table) {
+ if (table->table == NULL) {
perror("realloc failed");
- exit(1);
+ return;
}
}
cur = &table->table[table->nb_entities];
@@ -219,6 +229,43 @@ xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
}
/**
+ * xmlGetParameterEntity:
+ * @doc: the document referencing the entity
+ * @name: the entity name
+ *
+ * Do an entity lookup in the internal and external subsets and
+ * returns the corresponding parameter entity, if found.
+ *
+ * Returns A pointer to the entity structure or NULL if not found.
+ */
+xmlEntityPtr
+xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name) {
+ int i;
+ xmlEntityPtr cur;
+ xmlEntitiesTablePtr table;
+
+ if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
+ table = (xmlEntitiesTablePtr) doc->intSubset->entities;
+ for (i = 0;i < table->nb_entities;i++) {
+ cur = &table->table[i];
+ if (((cur->type == XML_INTERNAL_PARAMETER_ENTITY) ||
+ (cur->type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
+ (!xmlStrcmp(cur->name, name))) return(cur);
+ }
+ }
+ if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
+ table = (xmlEntitiesTablePtr) doc->extSubset->entities;
+ for (i = 0;i < table->nb_entities;i++) {
+ cur = &table->table[i];
+ if (((cur->type == XML_INTERNAL_PARAMETER_ENTITY) ||
+ (cur->type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
+ (!xmlStrcmp(cur->name, name))) return(cur);
+ }
+ }
+ return(NULL);
+}
+
+/**
* xmlGetDtdEntity:
* @doc: the document referencing the entity
* @name: the entity name
@@ -238,7 +285,9 @@ xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name) {
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
for (i = 0;i < table->nb_entities;i++) {
cur = &table->table[i];
- if (!xmlStrcmp(cur->name, name)) return(cur);
+ if ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (cur->type != XML_EXTERNAL_PARAMETER_ENTITY) &&
+ (!xmlStrcmp(cur->name, name))) return(cur);
}
}
return(NULL);
@@ -265,7 +314,9 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
table = (xmlEntitiesTablePtr) doc->intSubset->entities;
for (i = 0;i < table->nb_entities;i++) {
cur = &table->table[i];
- if (!xmlStrcmp(cur->name, name)) return(cur);
+ if ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (cur->type != XML_EXTERNAL_PARAMETER_ENTITY) &&
+ (!xmlStrcmp(cur->name, name))) return(cur);
}
}
if (xmlPredefinedEntities == NULL)
@@ -273,7 +324,9 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
table = xmlPredefinedEntities;
for (i = 0;i < table->nb_entities;i++) {
cur = &table->table[i];
- if (!xmlStrcmp(cur->name, name)) return(cur);
+ if ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (cur->type != XML_EXTERNAL_PARAMETER_ENTITY) &&
+ (!xmlStrcmp(cur->name, name))) return(cur);
}
return(NULL);
@@ -291,8 +344,7 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
/*
* A buffer used for converting entities to their equivalent and back.
*
- * TODO: remove this, this helps performances but forbid reentrancy in a
- * stupid way.
+ * TODO: remove this, once we are not afraid of breaking binary compatibility
*/
static int buffer_size = 0;
static CHAR *buffer = NULL;
@@ -315,13 +367,10 @@ void growBuffer(void) {
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts.
*
- * TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
- * get erroneous.
- *
- * TODO This routine is not reentrant, the interface
- * should not be modified though.
+ * TODO: remove this, once we are not afraid of breaking binary compatibility
*
* People must migrate their code to xmlEncodeEntitiesReentrant !
+ * This routine will issue a warning when encountered.
*
* Returns A newly allocated string with the substitution done.
*/
@@ -329,6 +378,13 @@ const CHAR *
xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
const CHAR *cur = input;
CHAR *out = buffer;
+ static int warning = 1;
+
+ if (warning) {
+ fprintf(stderr, "Deprecated API xmlEncodeEntities() used\n");
+ fprintf(stderr, " change code to use xmlEncodeEntitiesReentrant()\n");
+ warning = 0;
+ }
if (input == NULL) return(NULL);
if (buffer == NULL) {
diff --git a/entities.h b/entities.h
index 86040574..180a40c0 100644
--- a/entities.h
+++ b/entities.h
@@ -66,6 +66,7 @@ void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
+xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name);
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
diff --git a/error.c b/error.c
index 6d1f57dd..4fbdd987 100644
--- a/error.c
+++ b/error.c
@@ -10,35 +10,24 @@
#include <stdarg.h>
#include "parser.h"
-/**
- * xmlParserError:
- * @ctx: an XML parser context
- * @msg: the message to display/transmit
- * @...: extra parameters for the message display
- *
- * Display and format an error messages, gives file, line, position and
- * extra parameters.
- */
-void
-xmlParserError(void *ctx, const char *msg, ...)
-{
- xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+static void
+xmlParserPrintFileInfo(xmlParserInputPtr input) {
+ if (input != NULL) {
+ if (input->filename)
+ fprintf(stderr, "%s:%d: ", input->filename,
+ input->line);
+ else
+ fprintf(stderr, "line %d: ", input->line);
+ }
+}
+
+static void
+xmlParserPrintFileContext(xmlParserInputPtr input) {
const CHAR *cur, *base;
- va_list args;
int n;
- va_start(args, msg);
- if (ctxt->input->filename)
- fprintf(stderr, "%s:%d: ", ctxt->input->filename,
- ctxt->input->line);
- else
- fprintf(stderr, "line %d: ", ctxt->input->line);
-
- fprintf(stderr, "error: ");
- vfprintf(stderr, msg, args);
- va_end(args);
- cur = ctxt->input->cur;
- base = ctxt->input->base;
+ cur = input->cur;
+ base = input->base;
while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) {
cur--;
}
@@ -53,7 +42,7 @@ xmlParserError(void *ctx, const char *msg, ...)
n++;
}
fprintf(stderr, "\n");
- cur = ctxt->input->cur;
+ cur = input->cur;
while ((*cur == '\n') || (*cur == '\r'))
cur--;
n = 0;
@@ -65,6 +54,36 @@ xmlParserError(void *ctx, const char *msg, ...)
}
/**
+ * xmlParserError:
+ * @ctx: an XML parser context
+ * @msg: the message to display/transmit
+ * @...: extra parameters for the message display
+ *
+ * Display and format an error messages, gives file, line, position and
+ * extra parameters.
+ */
+void
+xmlParserError(void *ctx, const char *msg, ...)
+{
+ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlParserInputPtr input;
+ va_list args;
+
+ input = ctxt->input;
+ if ((input->filename == NULL) && (ctxt->inputNr > 1))
+ input = ctxt->inputTab[ctxt->inputNr - 2];
+
+ xmlParserPrintFileInfo(input);
+
+ fprintf(stderr, "error: ");
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+
+ xmlParserPrintFileContext(input);
+}
+
+/**
* xmlParserWarning:
* @ctx: an XML parser context
* @msg: the message to display/transmit
@@ -77,44 +96,80 @@ void
xmlParserWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
- const CHAR *cur, *base;
+ xmlParserInputPtr input;
va_list args;
- int n;
- va_start(args, msg);
- if (ctxt->input->filename)
- fprintf(stderr, "%s:%d: ", ctxt->input->filename,
- ctxt->input->line);
- else
- fprintf(stderr, "line %d: ", ctxt->input->line);
+ input = ctxt->input;
+ if ((input->filename == NULL) && (ctxt->inputNr > 1))
+ input = ctxt->inputTab[ctxt->inputNr - 2];
+
+ xmlParserPrintFileInfo(input);
fprintf(stderr, "warning: ");
+ va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
- cur = ctxt->input->cur;
- base = ctxt->input->base;
- while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) {
- cur--;
- }
- n = 0;
- while ((n++ < 80) && (cur > base) && (*cur != '\n') && (*cur != '\r'))
- cur--;
- if ((*cur == '\n') || (*cur == '\r')) cur++;
- base = cur;
- n = 0;
- while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < 79)) {
- fprintf(stderr, "%c", (unsigned char) *cur++);
- n++;
- }
- fprintf(stderr, "\n");
- cur = ctxt->input->cur;
- while ((*cur == '\n') || (*cur == '\r'))
- cur--;
- n = 0;
- while ((cur != base) && (n++ < 80)) {
- fprintf(stderr, " ");
- base++;
- }
- fprintf(stderr,"^\n");
+
+ xmlParserPrintFileContext(input);
+}
+
+/**
+ * xmlParserValidityError:
+ * @ctx: an XML parser context
+ * @msg: the message to display/transmit
+ * @...: extra parameters for the message display
+ *
+ * Display and format an validity error messages, gives file,
+ * line, position and extra parameters.
+ */
+void
+xmlParserValidityError(void *ctx, const char *msg, ...)
+{
+ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlParserInputPtr input;
+ va_list args;
+
+ input = ctxt->input;
+ if ((input->filename == NULL) && (ctxt->inputNr > 1))
+ input = ctxt->inputTab[ctxt->inputNr - 2];
+
+ xmlParserPrintFileInfo(input);
+
+ fprintf(stderr, "validity error: ");
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+
+ xmlParserPrintFileContext(input);
+}
+
+/**
+ * xmlParserValidityWarning:
+ * @ctx: an XML parser context
+ * @msg: the message to display/transmit
+ * @...: extra parameters for the message display
+ *
+ * Display and format a validity warning messages, gives file, line,
+ * position and extra parameters.
+ */
+void
+xmlParserValidityWarning(void *ctx, const char *msg, ...)
+{
+ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ xmlParserInputPtr input;
+ va_list args;
+
+ input = ctxt->input;
+ if ((input->filename == NULL) && (ctxt->inputNr > 1))
+ input = ctxt->inputTab[ctxt->inputNr - 2];
+
+ xmlParserPrintFileInfo(input);
+
+ fprintf(stderr, "validity warning: ");
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+
+ xmlParserPrintFileContext(input);
}
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index 86040574..180a40c0 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -66,6 +66,7 @@ void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
+xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name);
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 43d183e0..6659cdf7 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -1,5 +1,5 @@
/*
- * parser.h : constants and stuff related to the XML parser.
+ * parser.h : Interfaces, constants and types related to the XML parser.
*
* See Copyright for the status of this software.
*
@@ -10,6 +10,7 @@
#define __XML_PARSER_H__
#include "tree.h"
+#include "valid.h"
#include "xmlIO.h"
#ifdef __cplusplus
@@ -21,12 +22,22 @@ extern "C" {
*/
#define XML_DEFAULT_VERSION "1.0"
+/**
+ * an xmlParserInput is an input flow for the XML processor.
+ * Each entity parsed is associated an xmlParserInput (except the
+ * few predefined ones). This is the case both for internal entities
+ * - in which case the flow is already completely in memory - or
+ * external entities - in which case we use the buf structure for
+ * progressive reading and I18N conversions to the internal UTF-8 format.
+ */
+
typedef void (* xmlParserInputDeallocate)(CHAR *);
typedef struct xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
+ const char *directory; /* the directory/base of teh file */
const CHAR *base; /* Base of the array to parse */
const CHAR *cur; /* Current char being parsed */
int line; /* Current line */
@@ -36,6 +47,11 @@ typedef struct xmlParserInput {
} xmlParserInput;
typedef xmlParserInput *xmlParserInputPtr;
+/**
+ * the parser can be asked to collect Node informations, i.e. at what
+ * place in the file they were detected.
+ * NOTE: This is off by default and not very well tested.
+ */
typedef struct _xmlParserNodeInfo {
const struct xmlNode* node;
/* Position & line # that text that created the node begins & ends on */
@@ -54,24 +70,63 @@ typedef struct xmlParserNodeInfoSeq {
typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
+/**
+ * The parser is not a state based parser, but we need to maintain
+ * minimum state informations, especially for entities processing.
+ */
+typedef enum xmlParserInputState {
+ XML_PARSER_EOF = 0,
+ XML_PARSER_PROLOG,
+ XML_PARSER_CONTENT,
+ XML_PARSER_ENTITY_DECL,
+ XML_PARSER_ENTITY_VALUE,
+ XML_PARSER_ATTRIBUTE_VALUE,
+ XML_PARSER_DTD,
+ XML_PARSER_EPILOG,
+ XML_PARSER_COMMENT,
+ XML_PARSER_CDATA_SECTION,
+} xmlParserInputState;
+
+/**
+ * The parser context.
+ * NOTE This doesn't completely defines the parser state, the (current ?)
+ * design of the parser uses recursive function calls since this allow
+ * and easy mapping from the production rules of the specification
+ * to the actual code. The drawback is that the actual function call
+ * also reflect the parser state. However most of the parsing routines
+ * takes as the only argument the parser context pointer, so migrating
+ * to a state based parser for progressive parsing shouldn't be too hard.
+ */
typedef struct _xmlParserCtxt {
struct xmlSAXHandler *sax; /* The SAX handler */
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 */
- int html; /* are we parsing an HTML document */
+ const CHAR *version; /* the XML version string */
+ const CHAR *encoding; /* encoding, if any */
+ int standalone; /* standalone document */
+ int hasExternalSubset; /* reference and external subset */
+ int hasPErefs; /* the internal subset has PE refs */
+ int html; /* are we parsing an HTML document */
+ int external; /* are we parsing an external entity */
+
+ int wellFormed; /* is the document well formed */
+ int valid; /* is the document valid */
+ int validate; /* shall we try to validate ? */
+ xmlValidCtxt vctxt; /* The validity context */
+
+ xmlParserInputState instate; /* current type of input */
+ int token; /* next char look-ahead */
+ char *directory; /* the data directory */
+
/* Input stream stack */
xmlParserInputPtr input; /* Current input stream */
int inputNr; /* Number of current input streams */
int inputMax; /* Max number of input streams */
xmlParserInputPtr *inputTab; /* stack of inputs */
- /* Node analysis stack */
+ /* Node analysis stack only used for DOM building */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
@@ -83,10 +138,9 @@ typedef struct _xmlParserCtxt {
typedef _xmlParserCtxt xmlParserCtxt;
typedef xmlParserCtxt *xmlParserCtxtPtr;
-/*
+/**
* a SAX Locator.
*/
-
typedef struct xmlSAXLocator {
const CHAR *(*getPublicId)(void *ctx);
const CHAR *(*getSystemId)(void *ctx);
@@ -96,8 +150,9 @@ typedef struct xmlSAXLocator {
typedef _xmlSAXLocator xmlSAXLocator;
typedef xmlSAXLocator *xmlSAXLocatorPtr;
-/*
- * a SAX Exception.
+/**
+ * a SAX handler is bunch of callbacks called by the parser when processing
+ * of the input generate data or structure informations.
*/
#include "entities.h"
@@ -108,6 +163,8 @@ typedef void (*internalSubsetSAXFunc) (void *ctx, const CHAR *name,
const CHAR *ExternalID, const CHAR *SystemID);
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
const CHAR *name);
+typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
+ const CHAR *name);
typedef void (*entityDeclSAXFunc) (void *ctx,
const CHAR *name, int type, const CHAR *publicId,
const CHAR *systemId, CHAR *content);
@@ -138,6 +195,7 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
typedef void (*processingInstructionSAXFunc) (void *ctx,
const CHAR *target, const CHAR *data);
typedef void (*commentSAXFunc) (void *ctx, const CHAR *value);
+typedef void (*cdataBlockSAXFunc) (void *ctx, const CHAR *value, int len);
typedef void (*warningSAXFunc) (void *ctx, const char *msg, ...);
typedef void (*errorSAXFunc) (void *ctx, const char *msg, ...);
typedef void (*fatalErrorSAXFunc) (void *ctx, const char *msg, ...);
@@ -170,12 +228,13 @@ typedef struct xmlSAXHandler {
warningSAXFunc warning;
errorSAXFunc error;
fatalErrorSAXFunc fatalError;
+ getParameterEntitySAXFunc getParameterEntity;
+ cdataBlockSAXFunc cdataBlock;
} xmlSAXHandler;
typedef xmlSAXHandler *xmlSAXHandlerPtr;
-/*
- * Global variables: just the SAX interface tables we are looking for full
- * reentrancy of the code and version infos.
+/**
+ * Global variables: just the default SAX interface tables and XML version infos.
*/
extern const char *xmlParserVersion;
@@ -186,14 +245,14 @@ extern xmlSAXHandler htmlDefaultSAXHandler;
#include "entities.h"
#include "xml-error.h"
-/*
+/**
* Input functions
*/
int xmlParserInputRead(xmlParserInputPtr in, int len);
int xmlParserInputGrow(xmlParserInputPtr in, int len);
-/*
+/**
* CHAR handling
*/
CHAR *xmlStrdup(const CHAR *cur);
@@ -207,23 +266,23 @@ int xmlStrlen(const CHAR *str);
CHAR *xmlStrcat(CHAR *cur, const CHAR *add);
CHAR *xmlStrncat(CHAR *cur, const CHAR *add, int len);
-/*
- * Interfaces
+/**
+ * Basic parsing Interfaces
*/
xmlDocPtr xmlParseDoc(CHAR *cur);
xmlDocPtr xmlParseMemory(char *buffer, int size);
xmlDocPtr xmlParseFile(const char *filename);
int xmlSubstituteEntitiesDefault(int val);
-/*
+/**
* Recovery mode
*/
xmlDocPtr xmlRecoverDoc(CHAR *cur);
xmlDocPtr xmlRecoverMemory(char *buffer, int size);
xmlDocPtr xmlRecoverFile(const char *filename);
-/*
- * Internal routines
+/**
+ * Less common routines and SAX interfaces
*/
int xmlParseDocument(xmlParserCtxtPtr ctxt);
xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur, int recovery);
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index b1077188..ae8e2cc2 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -18,6 +18,26 @@ extern "C" {
/**
* A few macros needed to help building the parser.
*/
+/* #define UNICODE */
+
+#ifdef UNICODE
+typedef unsigned long CHARVAL;
+
+#define NEXTCHARVAL(p) (unsigned long) \
+ ((*(p) == 0) ? (unsigned long) 0 : \
+ ((*(p) < 0x80) ? (unsigned long) (*(p)++) : \
+ (*(p) < 0xC0) ? (unsigned long) 0 : \
+ (*(p) < 0xE0) ? ((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) : \
+ (*(p) < 0xF0) ? (((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) << 6 + \
+ (*(p)++ & 0x3F)) : \
+ (*(p) < 0xF8) ? ((((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) << 6 + \
+ (*(p)++ & 0x3F)) << 6 + (*(p)++ & 0x3F)) : 0))
+#else
+typedef unsigned char CHARVAL;
+
+#define NEXTCHARVAL(p) (unsigned long) *(p);
+#define SKIPCHARVAL(p) (p)++;
+#endif
#ifdef UNICODE
/************************************************************************
@@ -402,7 +422,6 @@ extern "C" {
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
#else
-#ifndef USE_UTF_8
/************************************************************************
* *
* 8bits / ISO-Latin version of the macros. *
@@ -453,15 +472,6 @@ extern "C" {
*/
#define IS_EXTENDER(c) ((c) == 0xb7)
-#else /* USE_UTF_8 */
-/************************************************************************
- * *
- * 8bits / UTF-8 version of the macros. *
- * *
- ************************************************************************/
-
-TODO !!!
-#endif /* USE_UTF_8 */
#endif /* !UNICODE */
/*
@@ -513,6 +523,10 @@ xmlParserCtxtPtr
xmlCreateMemoryParserCtxt(char *buffer, int size);
void
xmlFreeParserCtxt(xmlParserCtxtPtr ctxt);
+xmlParserCtxtPtr
+xmlNewParserCtxt();
+void
+xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc);
/**
* Entities
@@ -554,6 +568,8 @@ xmlParseNamespace(xmlParserCtxtPtr ctxt);
* Generic production rules
*/
CHAR *
+xmlScanName(xmlParserCtxtPtr ctxt);
+CHAR *
xmlParseName(xmlParserCtxtPtr ctxt);
CHAR *
xmlParseNmtoken(xmlParserCtxtPtr ctxt);
@@ -638,6 +654,9 @@ void
xmlParseXMLDecl(xmlParserCtxtPtr ctxt);
void
xmlParseMisc(xmlParserCtxtPtr ctxt);
+void
+xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
+ const CHAR *SystemID);
/*
* Entities substitution
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index fddabb7e..a627d921 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -97,6 +97,7 @@ typedef xmlEnumeration *xmlEnumerationPtr;
typedef struct xmlAttribute {
const CHAR *elem; /* Element holding the attribute */
const CHAR *name; /* Attribute name */
+ struct xmlAttribute *next; /* list of attributes of an element */
xmlAttributeType type; /* The type */
xmlAttributeDefault def; /* the default */
const CHAR *defaultValue;/* or the default value */
@@ -138,9 +139,10 @@ typedef enum {
} xmlElementTypeVal;
typedef struct xmlElement {
- const CHAR *name; /* Element name */
- xmlElementTypeVal type; /* The type */
+ const CHAR *name; /* Element name */
+ xmlElementTypeVal type; /* The type */
xmlElementContentPtr content; /* the allowed element content */
+ xmlAttributePtr attributes; /* List of the declared attributes */
} xmlElement;
typedef xmlElement *xmlElementPtr;
@@ -188,7 +190,7 @@ typedef struct xmlAttr {
#endif
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
- struct xmlAttr *next; /* parent->childs link */
+ struct xmlAttr *next; /* attribute list link */
const CHAR *name; /* the name of the property */
struct xmlNode *val; /* the value of the property */
} xmlAttr;
@@ -310,6 +312,7 @@ xmlNodePtr xmlNewDocTextLen(xmlDocPtr doc, const CHAR *content, int len);
xmlNodePtr xmlNewTextLen(const CHAR *content, int len);
xmlNodePtr xmlNewDocComment(xmlDocPtr doc, const CHAR *content);
xmlNodePtr xmlNewComment(const CHAR *content);
+xmlNodePtr xmlNewCDataBlock(xmlDocPtr doc, const CHAR *content, int len);
xmlNodePtr xmlNewReference(xmlDocPtr doc, const CHAR *name);
xmlNodePtr xmlCopyNode(xmlNodePtr node, int recursive);
xmlNodePtr xmlCopyNodeList(xmlNodePtr node);
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index 084d97fa..7d58459e 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -11,6 +11,22 @@
#define __XML_VALID_H__
#include "tree.h"
+/**
+ * an xmlValidCtxt is used for error reporting when validating
+ */
+
+typedef void (*xmlValidityErrorFunc) (void *ctx, const char *msg, ...);
+typedef void (*xmlValidityWarningFunc) (void *ctx, const char *msg, ...);
+
+typedef struct xmlValidCtxt {
+ void *userData; /* user specific data block */
+ xmlValidityErrorFunc error; /* the callback in case of errors */
+ xmlValidityWarningFunc warning; /* the callback in case of warning */
+} xmlValidCtxt, *xmlValidCtxtPtr;
+
+extern void xmlParserValidityError(void *ctx, const char *msg, ...);
+extern void xmlParserValidityWarning(void *ctx, const char *msg, ...);
+
/*
* ALl notation declarations are stored in a table
* there is one table per DTD
@@ -21,7 +37,7 @@
typedef struct xmlNotationTable {
int nb_notations; /* number of notations stored */
int max_notations; /* maximum number of notations */
- xmlNotationPtr table; /* the table of attributes */
+ xmlNotationPtr *table; /* the table of attributes */
} xmlNotationTable;
typedef xmlNotationTable *xmlNotationTablePtr;
@@ -35,7 +51,7 @@ typedef xmlNotationTable *xmlNotationTablePtr;
typedef struct xmlElementTable {
int nb_elements; /* number of elements stored */
int max_elements; /* maximum number of elements */
- xmlElementPtr table; /* the table of elements */
+ xmlElementPtr *table; /* the table of elements */
} xmlElementTable;
typedef xmlElementTable *xmlElementTablePtr;
@@ -49,13 +65,13 @@ typedef xmlElementTable *xmlElementTablePtr;
typedef struct xmlAttributeTable {
int nb_attributes; /* number of attributes stored */
int max_attributes; /* maximum number of attributes */
- xmlAttributePtr table; /* the table of attributes */
+ xmlAttributePtr *table; /* the table of attributes */
} xmlAttributeTable;
typedef xmlAttributeTable *xmlAttributeTablePtr;
/* Notation */
-xmlNotationPtr xmlAddNotationDecl(xmlDtdPtr dtd, const CHAR *name,
- const CHAR *PublicID, const CHAR *SystemID);
+xmlNotationPtr xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *name, const CHAR *PublicID, const CHAR *SystemID);
xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table);
void xmlFreeNotationTable(xmlNotationTablePtr table);
void xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table);
@@ -66,8 +82,8 @@ xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
void xmlFreeElementContent(xmlElementContentPtr cur);
/* Element */
-xmlElementPtr xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
- xmlElementContentPtr content);
+xmlElementPtr xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *name, int type, xmlElementContentPtr content);
xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table);
void xmlFreeElementTable(xmlElementTablePtr table);
void xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table);
@@ -78,11 +94,32 @@ void xmlFreeEnumeration(xmlEnumerationPtr cur);
xmlEnumerationPtr xmlCopyEnumeration(xmlEnumerationPtr cur);
/* Attribute */
-xmlAttributePtr xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem,
- const CHAR *name, int type, int def,
+xmlAttributePtr xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *elem, const CHAR *name, int type, int def,
const CHAR *defaultValue, xmlEnumerationPtr tree);
xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table);
void xmlFreeAttributeTable(xmlAttributeTablePtr table);
void xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table);
+/**
+ * The public function calls related to validity checking
+ */
+
+int xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
+int xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlElementPtr elem);
+int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlAttributePtr attr);
+int xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNotationPtr nota);
+int xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd);
+
+int xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
+int xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem);
+int xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem);
+int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value);
+
+int xmlIsMixedElement(xmlDocPtr doc, const CHAR *name);
#endif /* __XML_VALID_H__ */
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index bdeecc3f..0e086d77 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -45,6 +45,7 @@ int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
+char *xmlParserGetDirectory(const char *filename);
#ifdef __cplusplus
}
diff --git a/libxml.spec.in b/libxml.spec.in
index 8f9f9412..6486dd0f 100644
--- a/libxml.spec.in
+++ b/libxml.spec.in
@@ -12,6 +12,7 @@ Copyright: LGPL
Group: X11/Libraries
Source: ftp://ftp.gnome.org/pub/GNOME/sources/libxml/libxml-%{ver}.tar.gz
BuildRoot: /var/tmp/libxml-%{PACKAGE_VERSION}-root
+Provides: libxml.so.0
URL: http://www.gnome.org
Prereq: /sbin/install-info
@@ -76,6 +77,14 @@ fi
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
+#
+# hack to get libxml.so.0 too !
+# Get rid of it once deps to libxml.so.0 have disapeared.
+#
+if [ -f $RPM_BUILD_ROOT/%{prefix}/lib/libxml.so.@VERSION@ ]
+then
+ (cd $RPM_BUILD_ROOT/%{prefix}/lib/ ; cp libxml.so.@VERSION@ libxml.so.0.99.0 ; ln -sf libxml.so.0.99.0 libxml.so.0)
+fi
%clean
@@ -97,5 +106,4 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/lib/lib*.so
%{prefix}/lib/*a
-%{prefix}/lib/*.sh
%{prefix}/include/*
diff --git a/parser.c b/parser.c
index 2bc3d879..8fd47977 100644
--- a/parser.c
+++ b/parser.c
@@ -47,13 +47,12 @@ const char *xmlParserVersion = LIBXML_VERSION;
/* #define DEBUG_INPUT */
-#define INPUT_CHUNK 50
+#define INPUT_CHUNK 250
+/* we need to keep enough input to show errors in context */
+#define LINE_LEN 80
#ifdef DEBUG_INPUT
#define CHECK_BUFFER(in) check_buffer(in)
-#else
-#define CHECK_BUFFER(in)
-#endif
void check_buffer(xmlParserInputPtr in) {
if (in->base != in->buf->buffer->content) {
@@ -70,6 +69,10 @@ void check_buffer(xmlParserInputPtr in) {
in->buf->buffer->use, in->buf->buffer->size);
}
+#else
+#define CHECK_BUFFER(in)
+#endif
+
/**
* xmlParserInputRead:
@@ -191,7 +194,7 @@ xmlParserInputShrink(xmlParserInputPtr in) {
used = in->cur - in->buf->buffer->content;
if (used > INPUT_CHUNK) {
- ret = xmlBufferShrink(in->buf->buffer, used);
+ ret = xmlBufferShrink(in->buf->buffer, used - LINE_LEN);
if (ret > 0) {
in->cur -= ret;
in->consumed += ret;
@@ -223,6 +226,7 @@ xmlParserInputShrink(xmlParserInputPtr in) {
************************************************************************/
int xmlSubstituteEntitiesDefaultValue = 0;
+int xmlDoValidityCheckingDefaultValue = 0;
/*
* Generic function for accessing stacks in the Parser Context
@@ -285,19 +289,31 @@ PUSH_AND_POP(xmlNodePtr, node)
* COPY(to) copy one char to *to, increment CUR_PTR and to accordingly
*/
-#define CUR (*ctxt->input->cur)
+#define CUR (ctxt->token ? ctxt->token : (*ctxt->input->cur))
#define SKIP(val) ctxt->input->cur += (val)
#define NXT(val) ctxt->input->cur[(val)]
#define CUR_PTR ctxt->input->cur
-#define SHRINK xmlParserInputShrink(ctxt->input)
-#define GROW xmlParserInputGrow(ctxt->input, INPUT_CHUNK)
+#define SHRINK xmlParserInputShrink(ctxt->input); \
+ if ((*ctxt->input->cur == 0) && \
+ (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) \
+ xmlPopInput(ctxt)
+
+#define GROW xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
+ if ((*ctxt->input->cur == 0) && \
+ (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) \
+ xmlPopInput(ctxt)
#define SKIP_BLANKS \
- while (IS_BLANK(*(ctxt->input->cur))) NEXT
+ do { \
+ while (IS_BLANK(CUR)) NEXT; \
+ if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \
+ if (*ctxt->input->cur == '&') xmlParserHandleReference(ctxt); \
+ } while (IS_BLANK(CUR));
-#ifndef USE_UTF_8
#define CURRENT (*ctxt->input->cur)
#define NEXT { \
+ if (ctxt->token != 0) ctxt->token = 0; \
+ else { \
if ((*ctxt->input->cur == 0) && \
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) { \
xmlPopInput(ctxt); \
@@ -308,26 +324,18 @@ PUSH_AND_POP(xmlNodePtr, node)
ctxt->input->cur++; \
if (*ctxt->input->cur == 0) \
xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
- }}
-
-/****************************************
-#define NEXT ((*ctxt->input->cur) ? \
- (((*(ctxt->input->cur) == '\n') ? \
- (ctxt->input->line++, ctxt->input->col = 1) : \
- (ctxt->input->col++)), \
- (ctxt->input->cur++), \
- ((*ctxt->input->cur) ? \
- (xmlParserInputGrow(ctxt->input, 100), \
- ctxt->input->cur): \
- (ctxt->input->cur))) : \
- ((xmlParserInputGrow(ctxt->input, 100) > 0) ? \
- ctxt->input->cur: \
- (xmlPopInput(ctxt), ctxt->input->cur)))
- ****************************************/
-#else
-#endif
+ } \
+ if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \
+ if (*ctxt->input->cur == '&') xmlParserHandleReference(ctxt); \
+}}
+/************************************************************************
+ * *
+ * Commodity functions to handle entities processing *
+ * *
+ ************************************************************************/
+
/**
* xmlPopInput:
* @ctxt: an XML parser context
@@ -335,14 +343,15 @@ PUSH_AND_POP(xmlNodePtr, node)
* xmlPopInput: the current input pointed by ctxt->input came to an end
* pop it and return the next char.
*
- * TODO A deallocation of the popped Input structure is needed
- *
* Returns the current CHAR in the parser context
*/
CHAR
xmlPopInput(xmlParserCtxtPtr ctxt) {
if (ctxt->inputNr == 1) return(0); /* End of main Input */
xmlFreeInputStream(inputPop(ctxt));
+ if ((*ctxt->input->cur == 0) &&
+ (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0))
+ return(xmlPopInput(ctxt));
return(CUR);
}
@@ -362,7 +371,7 @@ xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
/**
* xmlFreeInputStream:
- * @input: an xmlParserInputPtr
+ * @input: an xmlP arserInputPtr
*
* Free up an input stream.
*/
@@ -371,6 +380,7 @@ xmlFreeInputStream(xmlParserInputPtr input) {
if (input == NULL) return;
if (input->filename != NULL) free((char *) input->filename);
+ if (input->directory != NULL) free((char *) input->directory);
if ((input->free != NULL) && (input->base != NULL))
input->free((char *) input->base);
if (input->buf != NULL)
@@ -380,6 +390,36 @@ xmlFreeInputStream(xmlParserInputPtr input) {
}
/**
+ * xmlNewInputStream:
+ * @ctxt: an XML parser context
+ *
+ * Create a new input stream structure
+ * Returns the new input stream or NULL
+ */
+xmlParserInputPtr
+xmlNewInputStream(xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr input;
+
+ input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+ if (input == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "malloc: couldn't allocate a new input stream\n");
+ return(NULL);
+ }
+ input->filename = NULL;
+ input->directory = NULL;
+ input->base = NULL;
+ input->cur = NULL;
+ input->buf = NULL;
+ input->line = 1;
+ input->col = 1;
+ input->buf = NULL;
+ input->free = NULL;
+ input->consumed = 0;
+ return(input);
+}
+
+/**
* xmlNewEntityInputStream:
* @ctxt: an XML parser context
* @entity: an Entity pointer
@@ -403,56 +443,40 @@ xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
"internal: xmlNewEntityInputStream entity->input = NULL\n");
return(NULL);
}
- input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+ input = xmlNewInputStream(ctxt);
if (input == NULL) {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "malloc: couldn't allocate a new input stream\n");
return(NULL);
}
input->filename = entity->SystemID; /* TODO !!! char <- CHAR */
input->base = entity->content;
input->cur = entity->content;
- input->buf = NULL;
- input->line = 1;
- input->col = 1;
- input->buf = NULL;
- input->free = NULL;
- input->consumed = 0;
return(input);
}
/**
* xmlNewStringInputStream:
* @ctxt: an XML parser context
- * @entity: an Entity memory buffer
+ * @buffer: an memory buffer
*
* Create a new input stream based on a memory buffer.
* Returns the new input stream
*/
xmlParserInputPtr
-xmlNewStringInputStream(xmlParserCtxtPtr ctxt, CHAR *entity) {
+xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const CHAR *buffer) {
xmlParserInputPtr input;
- if (entity == NULL) {
+ if (buffer == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"internal: xmlNewStringInputStream string = NULL\n");
return(NULL);
}
- input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+ input = xmlNewInputStream(ctxt);
if (input == NULL) {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "malloc: couldn't allocate a new input stream\n");
return(NULL);
}
- input->filename = NULL;
- input->base = entity;
- input->cur = entity;
- input->buf = NULL;
- input->line = 1;
- input->col = 1;
- input->free = NULL;
- input->consumed = 0;
+ input->base = buffer;
+ input->cur = buffer;
return(input);
}
@@ -469,36 +493,639 @@ xmlParserInputPtr
xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
xmlParserInputBufferPtr buf;
xmlParserInputPtr inputStream;
+ char *directory = NULL;
+ if (ctxt == NULL) return(NULL);
buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE);
- if (buf == NULL) return(NULL);
+ if (buf == NULL) {
+ char name[1024];
- inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+ if ((ctxt->input != NULL) && (ctxt->input->directory != NULL)) {
+#ifdef WIN32
+ sprintf(name, "%s\\%s", ctxt->input->directory, filename);
+#else
+ sprintf(name, "%s/%s", ctxt->input->directory, filename);
+#endif
+ buf = xmlParserInputBufferCreateFilename(name,
+ XML_CHAR_ENCODING_NONE);
+ if (buf != NULL)
+ directory = strdup(ctxt->input->directory);
+ }
+ if ((buf == NULL) && (ctxt->directory != NULL)) {
+#ifdef WIN32
+ sprintf(name, "%s\\%s", ctxt->directory, filename);
+#else
+ sprintf(name, "%s/%s", ctxt->directory, filename);
+#endif
+ buf = xmlParserInputBufferCreateFilename(name,
+ XML_CHAR_ENCODING_NONE);
+ if (buf != NULL)
+ directory = strdup(ctxt->directory);
+ }
+ if (buf == NULL)
+ return(NULL);
+ }
+ if (directory == NULL)
+ directory = xmlParserGetDirectory(filename);
+
+ inputStream = xmlNewInputStream(ctxt);
if (inputStream == NULL) {
- perror("malloc");
- free(ctxt);
+ if (directory != NULL) free((char *) directory);
return(NULL);
}
inputStream->filename = strdup(filename);
- inputStream->line = 1;
- inputStream->col = 1;
+ inputStream->directory = directory;
inputStream->buf = buf;
inputStream->base = inputStream->buf->buffer->content;
inputStream->cur = inputStream->buf->buffer->content;
- inputStream->free = NULL;
- inputStream->consumed = 0;
-
+ if ((ctxt->directory == NULL) && (directory != NULL))
+ ctxt->directory = directory;
return(inputStream);
}
/************************************************************************
* *
+ * Commodity functions to handle parser contexts *
+ * *
+ ************************************************************************/
+
+/**
+ * xmlInitParserCtxt:
+ * @ctxt: an XML parser context
+ *
+ * Initialize a parser context
+ */
+
+void
+xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
+{
+ xmlSAXHandler *sax;
+
+ sax = (xmlSAXHandler *) malloc(sizeof(xmlSAXHandler));
+ if (sax == NULL) {
+ fprintf(stderr, "xmlInitParserCtxt: out of memory\n");
+ }
+
+ /* Allocate the Input stack */
+ ctxt->inputTab = (xmlParserInputPtr *) malloc(5 * sizeof(xmlParserInputPtr));
+ ctxt->inputNr = 0;
+ ctxt->inputMax = 5;
+ ctxt->input = NULL;
+ ctxt->version = NULL;
+ ctxt->encoding = NULL;
+ ctxt->standalone = -1;
+ ctxt->hasExternalSubset = 0;
+ ctxt->hasPErefs = 0;
+ ctxt->html = 0;
+ ctxt->external = 0;
+ ctxt->instate = XML_PARSER_PROLOG;
+ ctxt->token = 0;
+ ctxt->directory = NULL;
+
+ /* Allocate the Node stack */
+ ctxt->nodeTab = (xmlNodePtr *) malloc(10 * sizeof(xmlNodePtr));
+ ctxt->nodeNr = 0;
+ ctxt->nodeMax = 10;
+ ctxt->node = NULL;
+
+ if (sax == NULL) ctxt->sax = &xmlDefaultSAXHandler;
+ else {
+ ctxt->sax = sax;
+ memcpy(sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler));
+ }
+ ctxt->userData = ctxt;
+ ctxt->myDoc = NULL;
+ ctxt->wellFormed = 1;
+ ctxt->valid = 1;
+ ctxt->validate = xmlDoValidityCheckingDefaultValue;
+ ctxt->vctxt.userData = ctxt;
+ ctxt->vctxt.error = xmlParserValidityError;
+ ctxt->vctxt.warning = xmlParserValidityWarning;
+ ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
+ ctxt->record_info = 0;
+ xmlInitNodeInfoSeq(&ctxt->node_seq);
+}
+
+/**
+ * xmlFreeParserCtxt:
+ * @ctxt: an XML parser context
+ *
+ * Free all the memory used by a parser context. However the parsed
+ * document in ctxt->myDoc is not freed.
+ */
+
+void
+xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
+{
+ xmlParserInputPtr input;
+
+ if (ctxt == NULL) return;
+
+ while ((input = inputPop(ctxt)) != NULL) {
+ xmlFreeInputStream(input);
+ }
+
+ if (ctxt->nodeTab != NULL) free(ctxt->nodeTab);
+ if (ctxt->inputTab != NULL) free(ctxt->inputTab);
+ if (ctxt->version != NULL) free((char *) ctxt->version);
+ if (ctxt->encoding != NULL) free((char *) ctxt->encoding);
+ if ((ctxt->sax != NULL) && (ctxt->sax != &xmlDefaultSAXHandler))
+ free(ctxt->sax);
+ if (ctxt->directory != NULL) free((char *) ctxt->directory);
+ free(ctxt);
+}
+
+/**
+ * xmlNewParserCtxt:
+ *
+ * Allocate and initialize a new parser context.
+ *
+ * Returns the xmlParserCtxtPtr or NULL
+ */
+
+xmlParserCtxtPtr
+xmlNewParserCtxt()
+{
+ xmlParserCtxtPtr ctxt;
+
+ ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+ if (ctxt == NULL) {
+ fprintf(stderr, "xmlNewParserCtxt : cannot allocate context\n");
+ perror("malloc");
+ return(NULL);
+ }
+ xmlInitParserCtxt(ctxt);
+ return(ctxt);
+}
+
+/**
+ * xmlClearParserCtxt:
+ * @ctxt: an XML parser context
+ *
+ * Clear (release owned resources) and reinitialize a parser context
+ */
+
+void
+xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
+{
+ xmlClearNodeInfoSeq(&ctxt->node_seq);
+ xmlInitParserCtxt(ctxt);
+}
+
+/************************************************************************
+ * *
* Commodity functions to handle entities *
* *
************************************************************************/
+void xmlParserHandleReference(xmlParserCtxtPtr ctxt);
+void xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
+
+/**
+ * xmlParseCharRef:
+ * @ctxt: an XML parser context
+ *
+ * parse Reference declarations
+ *
+ * [66] CharRef ::= '&#' [0-9]+ ';' |
+ * '&#x' [0-9a-fA-F]+ ';'
+ *
+ * [ WFC: Legal Character ]
+ * Characters referred to using character references must match the
+ * production for Char.
+ *
+ * Returns the value parsed (as an int)
+ */
+int
+xmlParseCharRef(xmlParserCtxtPtr ctxt) {
+ int val = 0;
+
+ if (ctxt->token != 0) {
+ val = ctxt->token;
+ ctxt->token = 0;
+ return(val);
+ }
+ if ((CUR == '&') && (NXT(1) == '#') &&
+ (NXT(2) == 'x')) {
+ SKIP(3);
+ while (CUR != ';') {
+ if ((CUR >= '0') && (CUR <= '9'))
+ val = val * 16 + (CUR - '0');
+ else if ((CUR >= 'a') && (CUR <= 'f'))
+ val = val * 16 + (CUR - 'a') + 10;
+ else if ((CUR >= 'A') && (CUR <= 'F'))
+ val = val * 16 + (CUR - 'A') + 10;
+ else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid hexadecimal value\n");
+ ctxt->wellFormed = 0;
+ val = 0;
+ break;
+ }
+ NEXT;
+ }
+ if (CUR == ';')
+ NEXT;
+ } else if ((CUR == '&') && (NXT(1) == '#')) {
+ SKIP(2);
+ while (CUR != ';') {
+ if ((CUR >= '0') && (CUR <= '9'))
+ val = val * 10 + (CUR - '0');
+ else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid decimal value\n");
+ ctxt->wellFormed = 0;
+ val = 0;
+ break;
+ }
+ NEXT;
+ }
+ if (CUR == ';')
+ NEXT;
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid value\n");
+ ctxt->wellFormed = 0;
+ }
+
+ /*
+ * [ WFC: Legal Character ]
+ * Characters referred to using character references must match the
+ * production for Char.
+ */
+ if (IS_CHAR(val)) {
+ return(val);
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "CharRef: invalid CHAR value %d\n",
+ val);
+ ctxt->wellFormed = 0;
+ }
+ return(0);
+}
+
+/**
+ * xmlParserHandleReference:
+ * @ctxt: the parser context
+ *
+ * [67] Reference ::= EntityRef | CharRef
+ *
+ * [68] EntityRef ::= '&' Name ';'
+ *
+ * [ WFC: Entity Declared ]
+ * the Name given in the entity reference must match that in an entity
+ * declaration, except that well-formed documents need not declare any
+ * of the following entities: amp, lt, gt, apos, quot.
+ *
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an unparsed entity
+ *
+ * [66] CharRef ::= '&#' [0-9]+ ';' |
+ * '&#x' [0-9a-fA-F]+ ';'
+ *
+ * A PEReference may have been detectect in the current input stream
+ * the handling is done accordingly to
+ * http://www.w3.org/TR/REC-xml#entproc
+ */
+void
+xmlParserHandleReference(xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr input;
+ CHAR *name;
+ xmlEntityPtr ent = NULL;
+
+ if (ctxt->token != 0) return;
+ if (CUR != '&') return;
+ GROW;
+ if ((CUR == '&') && (NXT(1) == '#')) {
+ switch(ctxt->instate) {
+ case XML_PARSER_CDATA_SECTION:
+ return;
+ case XML_PARSER_COMMENT:
+ return;
+ case XML_PARSER_EOF:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "CharRef at EOF\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_PROLOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "CharRef in prolog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_EPILOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "CharRef in epilog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_DTD:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "CharRef are forbiden in DTDs!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_ENTITY_DECL:
+ /* we just ignore it there */
+ return;
+ case XML_PARSER_ENTITY_VALUE:
+ /*
+ * NOTE: in the case of entity values, we don't do the
+ * substitution here since we need the litteral
+ * entity value to be able to save the internal
+ * subset of the document.
+ * This will be handled by xmlDecodeEntities
+ */
+ return;
+ case XML_PARSER_CONTENT:
+ case XML_PARSER_ATTRIBUTE_VALUE:
+ /* TODO this may not be Ok for UTF-8, multibyte sequence */
+ ctxt->token = xmlParseCharRef(ctxt);
+ return;
+ }
+ return;
+ }
+
+ switch(ctxt->instate) {
+ case XML_PARSER_CDATA_SECTION:
+ return;
+ case XML_PARSER_COMMENT:
+ return;
+ case XML_PARSER_EOF:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Reference at EOF\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_PROLOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Reference in prolog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_EPILOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Reference in epilog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_ENTITY_VALUE:
+ /*
+ * NOTE: in the case of entity values, we don't do the
+ * substitution here since we need the litteral
+ * entity value to be able to save the internal
+ * subset of the document.
+ * This will be handled by xmlDecodeEntities
+ */
+ return;
+ case XML_PARSER_ATTRIBUTE_VALUE:
+ /*
+ * NOTE: in the case of attributes values, we don't do the
+ * substitution here unless we are in a mode where
+ * the parser is explicitely asked to substitute
+ * entities. The SAX callback is called with values
+ * without entity substitution.
+ * This will then be handled by xmlDecodeEntities
+ */
+ if (ctxt->replaceEntities == 0) return;
+ break;
+ case XML_PARSER_ENTITY_DECL:
+ /*
+ * we just ignore it there
+ * the substitution will be done once the entity is referenced
+ */
+ return;
+ case XML_PARSER_DTD:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity references are forbiden in DTDs!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_CONTENT:
+ if (ctxt->replaceEntities == 0) return;
+ break;
+ }
+
+ NEXT;
+ name = xmlScanName(ctxt);
+ if (name == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Entity reference: no name\n");
+ ctxt->wellFormed = 0;
+ ctxt->token = '&';
+ return;
+ }
+ if (NXT(xmlStrlen(name)) != ';') {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity reference: ';' expected\n");
+ ctxt->wellFormed = 0;
+ ctxt->token = '&';
+ free(name);
+ return;
+ }
+ SKIP(xmlStrlen(name) + 1);
+ if (ctxt->sax != NULL) {
+ if (ctxt->sax->getEntity != NULL)
+ ent = ctxt->sax->getEntity(ctxt->userData, name);
+ }
+
+ /*
+ * [ WFC: Entity Declared ]
+ * the Name given in the entity reference must match that in an entity
+ * declaration, except that well-formed documents need not declare any
+ * of the following entities: amp, lt, gt, apos, quot.
+ */
+ if (ent == NULL)
+ ent = xmlGetPredefinedEntity(name);
+ if (ent == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity reference: entity %s not declared\n",
+ name);
+ ctxt->wellFormed = 0;
+ free(name);
+ return;
+ }
+
+ /*
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an unparsed entity
+ */
+ if (ent->type == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity reference to unparsed entity %s\n", name);
+ ctxt->wellFormed = 0;
+ }
+
+ if (ent->type == XML_INTERNAL_PREDEFINED_ENTITY) {
+ ctxt->token = ent->content[0];
+ free(name);
+ return;
+ }
+ input = xmlNewEntityInputStream(ctxt, ent);
+ xmlPushInput(ctxt, input);
+ free(name);
+ return;
+}
+
+/**
+ * xmlParserHandlePEReference:
+ * @ctxt: the parser context
+ *
+ * [69] PEReference ::= '%' Name ';'
+ *
+ * [ WFC: No Recursion ]
+ * TODO A parsed entity must not contain a recursive
+ * reference to itself, either directly or indirectly.
+ *
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an internal DTD
+ * subset which contains no parameter entity references, or a document
+ * with "standalone='yes'", ... ... The declaration of a parameter
+ * entity must precede any reference to it...
+ *
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external parameter entities
+ * with "standalone='no'", ... ... The declaration of a parameter entity
+ * must precede any reference to it...
+ *
+ * [ WFC: In DTD ]
+ * Parameter-entity references may only appear in the DTD.
+ * NOTE: misleading but this is handled.
+ *
+ * A PEReference may have been detected in the current input stream
+ * the handling is done accordingly to
+ * http://www.w3.org/TR/REC-xml#entproc
+ * i.e.
+ * - Included in literal in entity values
+ * - Included as Paraemeter Entity reference within DTDs
+ */
+void
+xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
+ CHAR *name;
+ xmlEntityPtr entity = NULL;
+ xmlParserInputPtr input;
+
+ if (ctxt->token != 0) return;
+ if (CUR != '%') return;
+ switch(ctxt->instate) {
+ case XML_PARSER_CDATA_SECTION:
+ return;
+ case XML_PARSER_COMMENT:
+ return;
+ case XML_PARSER_EOF:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "PEReference at EOF\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_PROLOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "PEReference in prolog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_ENTITY_DECL:
+ case XML_PARSER_CONTENT:
+ case XML_PARSER_ATTRIBUTE_VALUE:
+ /* we just ignore it there */
+ return;
+ case XML_PARSER_EPILOG:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "PEReference in epilog!\n");
+ ctxt->wellFormed = 0;
+ return;
+ case XML_PARSER_ENTITY_VALUE:
+ /*
+ * NOTE: in the case of entity values, we don't do the
+ * substitution here since we need the litteral
+ * entity value to be able to save the internal
+ * subset of the document.
+ * This will be handled by xmlDecodeEntities
+ */
+ return;
+ case XML_PARSER_DTD:
+ /*
+ * [WFC: Well-Formedness Constraint: PEs in Internal Subset]
+ * In the internal DTD subset, parameter-entity references
+ * can occur only where markup declarations can occur, not
+ * within markup declarations.
+ * In that case this is handled in xmlParseMarkupDecl
+ */
+ if ((ctxt->external == 0) && (ctxt->inputNr == 1))
+ return;
+ }
+
+ NEXT;
+ name = xmlParseName(ctxt);
+ if (name == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "xmlHandlePEReference: no name\n");
+ ctxt->wellFormed = 0;
+ } else {
+ if (CUR == ';') {
+ NEXT;
+ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL))
+ entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
+ if (entity == NULL) {
+
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->wellFormed = 0;
+ } else {
+ /*
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external
+ * parameter entities with "standalone='no'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->valid = 0;
+ }
+ } else {
+ if ((entity->type == XML_INTERNAL_PARAMETER_ENTITY) ||
+ (entity->type == XML_EXTERNAL_PARAMETER_ENTITY)) {
+ /*
+ * TODO !!!! handle the extra spaces added before and after
+ * c.f. http://www.w3.org/TR/REC-xml#as-PE
+ * TODO !!!! Avoid quote processing in parameters value
+ * c.f. http://www.w3.org/TR/REC-xml#inliteral
+ */
+ input = xmlNewEntityInputStream(ctxt, entity);
+ xmlPushInput(ctxt, input);
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlHandlePEReference: %s is not a parameter entity\n",
+ name);
+ ctxt->wellFormed = 0;
+ }
+ }
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlHandlePEReference: expecting ';'\n");
+ ctxt->wellFormed = 0;
+ }
+ free(name);
+ }
+}
+
/*
* Macro used to grow the current buffer.
*/
@@ -511,7 +1138,6 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
} \
}
-
/**
* xmlDecodeEntities:
* @ctxt: the parser context
@@ -535,10 +1161,11 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
int buffer_size = 0;
CHAR *out = NULL;
- CHAR *cur = NULL;
+ CHAR *current = NULL;
xmlEntityPtr ent;
int nbchars = 0;
unsigned int max = (unsigned int) len;
+ CHAR cur;
/*
* allocate a translation buffer.
@@ -554,32 +1181,47 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
/*
* Ok loop until we reach one of the ending char or a size limit.
*/
- while ((nbchars < 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;
- nbchars += 3; /* !!!! */
- } 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];
- }
+ cur = CUR;
+ while ((nbchars < max) && (cur != end) &&
+ (cur != end2) && (cur != end3)) {
+
+ if (cur == 0) break;
+ if ((cur == '&') && (NXT(1) == '#')) {
+ int val = xmlParseCharRef(ctxt);
+ *out++ = val;
+ nbchars += 3;
+ } else if ((cur == '&') && (what & XML_SUBSTITUTE_REF)) {
+ ent = xmlParseEntityRef(ctxt);
+ if ((ent != NULL) &&
+ (ctxt->replaceEntities != 0)) {
+ current = ent->content;
+ while (*current != 0) {
+ *out++ = *current++;
+ if (out - buffer > buffer_size - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
}
- nbchars += 3 + xmlStrlen(ent->name);
}
+ nbchars += 3 + xmlStrlen(ent->name);
+ } else if (ent != NULL) {
+ int i = xmlStrlen(ent->name);
+ const CHAR *cur = ent->name;
+
+ nbchars += i + 2;
+ *out++ = '&';
+ if (out - buffer > buffer_size - i - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
+ }
+ for (;i > 0;i--)
+ *out++ = *cur++;
+ *out++ = ';';
}
- } else if (CUR == '%' && (what & XML_SUBSTITUTE_PEREF)) {
+ } 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
@@ -595,10 +1237,10 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
while ((CUR == 0) && (ctxt->inputNr > 1))
xmlPopInput(ctxt);
- break;
+ break;
} else {
/* TODO: invalid for UTF-8 , use COPY(out); */
- *out++ = CUR;
+ *out++ = cur;
nbchars++;
if (out - buffer > buffer_size - 100) {
int index = out - buffer;
@@ -608,6 +1250,7 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
}
NEXT;
}
+ cur = CUR;
}
*out++ = 0;
return(buffer);
@@ -1045,13 +1688,14 @@ xmlStrcat(CHAR *cur, const CHAR *add) {
*
* Is this a sequence of blank chars that one can ignore ?
*
- * TODO: to be corrected accodingly to DTD information if available
+ * TODO: Whether white space are significant has to be checked accordingly
+ * to DTD informations if available
*
* Returns 1 if ignorable 0 otherwise.
*/
static int areBlanks(xmlParserCtxtPtr ctxt, const CHAR *str, int len) {
- int i;
+ int i, ret;
xmlNodePtr lastChild;
for (i = 0;i < len;i++)
@@ -1059,11 +1703,22 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const CHAR *str, int len) {
if (CUR != '<') return(0);
if (ctxt->node == NULL) return(0);
+ if (ctxt->myDoc != NULL) {
+ ret = xmlIsMixedElement(ctxt->myDoc, ctxt->node->name);
+ if (ret == 0) return(1);
+ if (ret == 1) return(0);
+ }
+ /*
+ * heuristic
+ */
lastChild = xmlGetLastChild(ctxt->node);
if (lastChild == NULL) {
if (ctxt->node->content != NULL) return(0);
} else if (xmlNodeIsText(lastChild))
return(0);
+ else if ((ctxt->node->childs != NULL) &&
+ (xmlNodeIsText(ctxt->node->childs)))
+ return(0);
return(1);
}
@@ -1074,7 +1729,8 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const CHAR *str, int len) {
*
* Default handling of defined entities, when should we define a new input
* stream ? When do we just handle that as a set of chars ?
- * TODO: we should call the SAX handler here and have it resolve the issue
+ *
+ * OBSOLETE: to be removed at some point.
*/
void
@@ -1285,6 +1941,7 @@ xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt) {
* @ctxt: an XML parser context
*
* [OLD] Parse and return a string between quotes or doublequotes
+ * To be removed at next drop of binary compatibility
*
* Returns the string parser or NULL.
*/
@@ -1330,6 +1987,8 @@ xmlParseQuotedString(xmlParserCtxtPtr ctxt) {
* This is what the older xml-name Working Draft specified, a bunch of
* other stuff may still rely on it, so support is still here as
* if ot was declared on the root of the Tree:-(
+ *
+ * To be removed at next drop of binary compatibility
*/
void
@@ -1432,6 +2091,56 @@ xmlParseNamespace(xmlParserCtxtPtr ctxt) {
************************************************************************/
/**
+ * xmlScanName:
+ * @ctxt: an XML parser context
+ *
+ * Trickery: parse an XML name but without consuming the input flow
+ * Needed for rollback cases.
+ *
+ * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
+ * CombiningChar | Extender
+ *
+ * [5] Name ::= (Letter | '_' | ':') (NameChar)*
+ *
+ * [6] Names ::= Name (S Name)*
+ *
+ * Returns the Name parsed or NULL
+ */
+
+CHAR *
+xmlScanName(xmlParserCtxtPtr ctxt) {
+ CHAR buf[XML_MAX_NAMELEN];
+ int len = 0;
+
+ GROW;
+ if (!IS_LETTER(CUR) && (CUR != '_') &&
+ (CUR != ':')) {
+ return(NULL);
+ }
+
+ while ((IS_LETTER(NXT(len))) || (IS_DIGIT(NXT(len))) ||
+ (NXT(len) == '.') || (NXT(len) == '-') ||
+ (NXT(len) == '_') || (NXT(len) == ':') ||
+ (IS_COMBINING(NXT(len))) ||
+ (IS_EXTENDER(NXT(len)))) {
+ buf[len] = NXT(len);
+ len++;
+ if (len >= XML_MAX_NAMELEN) {
+ fprintf(stderr,
+ "xmlScanName: reached XML_MAX_NAMELEN limit\n");
+ while ((IS_LETTER(NXT(len))) || (IS_DIGIT(NXT(len))) ||
+ (NXT(len) == '.') || (NXT(len) == '-') ||
+ (NXT(len) == '_') || (NXT(len) == ':') ||
+ (IS_COMBINING(NXT(len))) ||
+ (IS_EXTENDER(NXT(len))))
+ len++;
+ break;
+ }
+ }
+ return(xmlStrndup(buf, len));
+}
+
+/**
* xmlParseName:
* @ctxt: an XML parser context
*
@@ -1451,29 +2160,34 @@ CHAR *
xmlParseName(xmlParserCtxtPtr ctxt) {
CHAR buf[XML_MAX_NAMELEN];
int len = 0;
+ CHAR cur;
GROW;
- if (!IS_LETTER(CUR) && (CUR != '_') &&
- (CUR != ':')) {
+ cur = CUR;
+ if (!IS_LETTER(cur) && (cur != '_') &&
+ (cur != ':')) {
return(NULL);
}
- while ((IS_LETTER(CUR)) || (IS_DIGIT(CUR)) ||
- (CUR == '.') || (CUR == '-') ||
- (CUR == '_') || (CUR == ':') ||
- (IS_COMBINING(CUR)) ||
- (IS_EXTENDER(CUR))) {
- buf[len++] = CUR;
+ while ((IS_LETTER(cur)) || (IS_DIGIT(cur)) ||
+ (cur == '.') || (cur == '-') ||
+ (cur == '_') || (cur == ':') ||
+ (IS_COMBINING(cur)) ||
+ (IS_EXTENDER(cur))) {
+ buf[len++] = cur;
NEXT;
+ cur = CUR;
if (len >= XML_MAX_NAMELEN) {
fprintf(stderr,
"xmlParseName: reached XML_MAX_NAMELEN limit\n");
- while ((IS_LETTER(CUR)) || (IS_DIGIT(CUR)) ||
- (CUR == '.') || (CUR == '-') ||
- (CUR == '_') || (CUR == ':') ||
- (IS_COMBINING(CUR)) ||
- (IS_EXTENDER(CUR)))
- NEXT;
+ while ((IS_LETTER(cur)) || (IS_DIGIT(cur)) ||
+ (cur == '.') || (cur == '-') ||
+ (cur == '_') || (cur == ':') ||
+ (IS_COMBINING(cur)) ||
+ (IS_EXTENDER(cur))) {
+ NEXT;
+ cur = CUR;
+ }
break;
}
}
@@ -1540,44 +2254,125 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, CHAR **orig) {
const CHAR *org = NULL;
const CHAR *tst = NULL;
const CHAR *temp = NULL;
+ xmlParserInputPtr input;
SHRINK;
if (CUR == '"') {
+ ctxt->instate = XML_PARSER_ENTITY_VALUE;
+ input = ctxt->input;
NEXT;
org = CUR_PTR;
- while (CUR != '"') {
+ /*
+ * NOTE: 4.4.5 Included in Literal
+ * When a parameter entity reference appears in a literal entity
+ * value, ... a single or double quote character in the replacement
+ * text is always treated as a normal data character and will not
+ * terminate the literal.
+ * In practice it means we stop the loop only when back at parsing
+ * the initial entity and the quote is found
+ */
+ while ((CUR != '"') || (ctxt->input != input)) {
tst = CUR_PTR;
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_BOTH, '"', 0, 0);
- if ((temp == NULL) && (tst == CUR_PTR)) break;
+ /*
+ * NOTE: 4.4.7 Bypassed
+ * When a general entity reference appears in the EntityValue in
+ * an entity declaration, it is bypassed and left as is.
+ * so XML_SUBSTITUTE_REF is not set.
+ */
+ if (ctxt->input != input)
+ temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
+ 0, 0, 0);
+ else
+ temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
+ '"', 0, 0);
+
+ /*
+ * Pop-up of finished entities.
+ */
+ while ((CUR == 0) && (ctxt->inputNr > 1))
+ xmlPopInput(ctxt);
+
+ if ((temp == NULL) && (tst == CUR_PTR)) {
+ ret = xmlStrndup("", 0);
+ break;
+ }
+ if ((temp[0] == 0) && (tst == CUR_PTR)) {
+ free((char *)temp);
+ ret = xmlStrndup("", 0);
+ break;
+ }
ret = xmlStrcat(ret, temp);
if (temp != NULL) free((char *)temp);
+ GROW;
}
if (CUR != '"') {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "EntityValue: \" expected\n");
ctxt->wellFormed = 0;
} else {
- if (orig != NULL)
+ if (orig != NULL) /* !!!!!!!!! */
*orig = xmlStrndup(org, CUR_PTR - org);
+ if (ret == NULL)
+ ret = xmlStrndup("", 0);
NEXT;
}
} else if (CUR == '\'') {
+ ctxt->instate = XML_PARSER_ENTITY_VALUE;
+ input = ctxt->input;
NEXT;
org = CUR_PTR;
- while (CUR != '\'') {
+ /*
+ * NOTE: 4.4.5 Included in Literal
+ * When a parameter entity reference appears in a literal entity
+ * value, ... a single or double quote character in the replacement
+ * text is always treated as a normal data character and will not
+ * terminate the literal.
+ * In practice it means we stop the loop only when back at parsing
+ * the initial entity and the quote is found
+ */
+ while ((CUR != '\'') || (ctxt->input != input)) {
tst = CUR_PTR;
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_BOTH, '\'', 0, 0);
- if ((temp == NULL) && (tst == CUR_PTR)) break;
+ /*
+ * NOTE: 4.4.7 Bypassed
+ * When a general entity reference appears in the EntityValue in
+ * an entity declaration, it is bypassed and left as is.
+ * so XML_SUBSTITUTE_REF is not set.
+ */
+ if (ctxt->input != input)
+ temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
+ 0, 0, 0);
+ else
+ temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
+ '\'', 0, 0);
+
+ /*
+ * Pop-up of finished entities.
+ */
+ while ((CUR == 0) && (ctxt->inputNr > 1))
+ xmlPopInput(ctxt);
+
+ if ((temp == NULL) && (tst == CUR_PTR)) {
+ ret = xmlStrndup("", 0);
+ break;
+ }
+ if ((temp[0] == 0) && (tst == CUR_PTR)) {
+ free((char *)temp);
+ ret = xmlStrndup("", 0);
+ break;
+ }
ret = xmlStrcat(ret, temp);
if (temp != NULL) free((char *)temp);
+ GROW;
}
if (CUR != '\'') {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "EntityValue: ' expected\n");
ctxt->wellFormed = 0;
} else {
- if (orig != NULL)
+ if (orig != NULL) /* !!!!!!!!! */
*orig = xmlStrndup(org, CUR_PTR - org);
+ if (ret == NULL)
+ ret = xmlStrndup("", 0);
NEXT;
}
} else {
@@ -1610,11 +2405,9 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
SHRINK;
if (CUR == '"') {
+ ctxt->instate = XML_PARSER_ATTRIBUTE_VALUE;
NEXT;
- if (ctxt->replaceEntities != 0)
- ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '"', '<', 0);
- else
- ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_NONE, '"', '<', 0);
+ ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '"', '<', 0);
if (CUR == '<') {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -1628,11 +2421,9 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
} else
NEXT;
} else if (CUR == '\'') {
+ ctxt->instate = XML_PARSER_ATTRIBUTE_VALUE;
NEXT;
- if (ctxt->replaceEntities != 0)
- ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '\'', '<', 0);
- else
- ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_NONE, '\'', '<', 0);
+ ret = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_REF, '\'', '<', 0);
if (CUR == '<') {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -1774,11 +2565,18 @@ void
xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata) {
CHAR buf[1000];
int nbchar = 0;
+ CHAR cur;
SHRINK;
- while ((IS_CHAR(CUR)) && (CUR != '<') &&
- (CUR != '&')) {
- if ((CUR == ']') && (NXT(1) == ']') &&
+ /*
+ * !!!!!!!!!!!!
+ * NOTE: NXT(0) is used here to avoid breaking on &lt; or &amp;
+ * entities substitutions.
+ */
+ cur = CUR;
+ while ((IS_CHAR(cur)) && (cur != '<') &&
+ (cur != '&')) {
+ if ((cur == ']') && (NXT(1) == ']') &&
(NXT(2) == '>')) {
if (cdata) break;
else {
@@ -1806,6 +2604,7 @@ xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata) {
nbchar = 0;
}
NEXT;
+ cur = CUR;
}
if (nbchar != 0) {
/*
@@ -1944,6 +2743,7 @@ xmlParseComment(xmlParserCtxtPtr ctxt, int create) {
if ((CUR != '<') || (NXT(1) != '!') ||
(NXT(2) != '-') || (NXT(3) != '-')) return;
+ ctxt->instate = XML_PARSER_COMMENT;
SHRINK;
SKIP(4);
start = q = CUR_PTR;
@@ -2028,9 +2828,6 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
/*
* Parse the target name and check for special support like
* namespace.
- *
- * TODO : PI handling should be dynamically redefinable using an
- * API. Only namespace should be in the code IMHO ...
*/
target = xmlParsePITarget(ctxt);
if (target != NULL) {
@@ -2055,24 +2852,16 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
*/
if ((ctxt->sax) &&
(ctxt->sax->processingInstruction != NULL))
- ctxt->sax->processingInstruction(ctxt->userData, target, data);
+ ctxt->sax->processingInstruction(ctxt->userData,
+ target, data);
free(data);
}
free(target);
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "xmlParsePI : no target name\n");
+ ctxt->sax->error(ctxt->userData,
+ "xmlParsePI : no target name\n");
ctxt->wellFormed = 0;
-
- /********* Should we try to complete parsing the PI ???
- while (IS_CHAR(CUR) &&
- (CUR != '?') && (CUR != '>'))
- NEXT;
- if (!IS_CHAR(CUR)) {
- fprintf(stderr, "xmlParsePI: PI %s never end ...\n",
- target);
- }
- ********************************************************/
}
}
}
@@ -2169,6 +2958,9 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
* [74] PEDef ::= EntityValue | ExternalID
*
* [76] NDataDecl ::= S 'NDATA' S Name
+ *
+ * [ VC: Notation Declared ]
+ * TODO The Name must match the declared name of a notation.
*/
void
@@ -2180,10 +2972,12 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
int isParameter = 0;
CHAR *orig = NULL;
+ GROW;
if ((CUR == '<') && (NXT(1) == '!') &&
(NXT(2) == 'E') && (NXT(3) == 'N') &&
(NXT(4) == 'T') && (NXT(5) == 'I') &&
(NXT(6) == 'T') && (NXT(7) == 'Y')) {
+ ctxt->instate = XML_PARSER_ENTITY_DECL;
SHRINK;
SKIP(8);
if (!IS_BLANK(CUR)) {
@@ -2290,15 +3084,25 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
NEXT;
if (orig != NULL) {
/*
- * TODO: somwhat unclean, extending the SAx API would be better !
+ * Ugly mechanism to save the raw entity value.
*/
xmlEntityPtr cur = NULL;
- if ((ctxt->sax != NULL) && (ctxt->sax->getEntity != NULL))
- cur = ctxt->sax->getEntity(ctxt, name);
- if (cur != NULL)
- cur->orig = orig;
- else
+ if (isParameter) {
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getParameterEntity != NULL))
+ cur = ctxt->sax->getParameterEntity(ctxt, name);
+ } else {
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getEntity != NULL))
+ cur = ctxt->sax->getEntity(ctxt, name);
+ }
+ if (cur != NULL) {
+ if (cur->orig != NULL)
+ free(orig);
+ else
+ cur->orig = orig;
+ } else
free(orig);
}
if (name != NULL) free(name);
@@ -2318,6 +3122,22 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
*
* [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
*
+ * [ VC: Required Attribute ]
+ * TODO if the default declaration is the keyword #REQUIRED, then the
+ * attribute must be specified for all elements of the type in the
+ * attribute-list declaration.
+ *
+ * [ VC: Attribute Default Legal ]
+ * The declared default value must meet the lexical constraints of
+ * the declared attribute type c.f. xmlValidateAttributeDecl()
+ *
+ * [ VC: Fixed Attribute Default ]
+ * TODO if an attribute has a default value declared with the #FIXED
+ * keyword, instances of that attribute must match the default value.
+ *
+ * [ WFC: No < in Attribute Values ]
+ * handled in xmlParseAttValue()
+ *
* returns: XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED
* or XML_ATTRIBUTE_FIXED.
*/
@@ -2357,6 +3177,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, CHAR **value) {
SKIP_BLANKS;
}
ret = xmlParseAttValue(ctxt);
+ ctxt->instate = XML_PARSER_DTD;
if (ret == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -2373,9 +3194,13 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, CHAR **value) {
*
* parse an Notation attribute type.
*
+ * Note: the leading 'NOTATION' S part has already being parsed...
+ *
* [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
*
- * Note: the leading 'NOTATION' S part has already being parsed...
+ * [ VC: Notation Attributes ]
+ * TODO Values of this type must match one of the notation names included
+ * in the declaration; all notation names in the declaration must be declared.
*
* Returns: the notation attribute tree built while parsing
*/
@@ -2432,6 +3257,10 @@ xmlParseNotationType(xmlParserCtxtPtr ctxt) {
*
* [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
*
+ * [ VC: Enumeration ]
+ * TODO Values of this type must match one of the Nmtoken tokens in
+ * the declaration
+ *
* Returns: the enumeration attribute tree built while parsing
*/
@@ -2532,6 +3361,35 @@ xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
* [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' |
* 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
*
+ * Validity constraints for attribute values syntax are checked in
+ * xmlValidateAttributeValue()
+ *
+ * [ VC: ID ]
+ * Values of type ID must match the Name production. TODO A name must not
+ * appear more than once in an XML document as a value of this type;
+ * i.e., ID values must uniquely identify the elements which bear them.
+ *
+ * [ VC: One ID per Element Type ]
+ * TODO No element type may have more than one ID attribute specified.
+ *
+ * [ VC: ID Attribute Default ]
+ * TODO An ID attribute must have a declared default of #IMPLIED or #REQUIRED.
+ *
+ * [ VC: IDREF ]
+ * Values of type IDREF must match the Name production, and values
+ * of type IDREFS must match Names; TODO each Name must match the value of
+ * an ID attribute on some element in the XML document; i.e. IDREF
+ * values must match the value of some ID attribute.
+ *
+ * [ VC: Entity Name ]
+ * Values of type ENTITY must match the Name production, values
+ * of type ENTITIES must match Names; TODO each Name must match the name of
+ * an unparsed entity declared in the DTD.
+ *
+ * [ VC: Name Token ]
+ * Values of type NMTOKEN must match the Nmtoken production; values
+ * of type NMTOKENS must match Nmtokens.
+ *
* Returns the attribute type
*/
int
@@ -2544,17 +3402,17 @@ xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
return(XML_ATTRIBUTE_CDATA);
} else if ((CUR == 'I') && (NXT(1) == 'D') &&
(NXT(2) == 'R') && (NXT(3) == 'E') &&
+ (NXT(4) == 'F') && (NXT(5) == 'S')) {
+ SKIP(6);
+ return(XML_ATTRIBUTE_IDREFS);
+ } else if ((CUR == 'I') && (NXT(1) == 'D') &&
+ (NXT(2) == 'R') && (NXT(3) == 'E') &&
(NXT(4) == 'F')) {
SKIP(5);
return(XML_ATTRIBUTE_IDREF);
} else if ((CUR == 'I') && (NXT(1) == 'D')) {
SKIP(2);
return(XML_ATTRIBUTE_ID);
- } else if ((CUR == 'I') && (NXT(1) == 'D') &&
- (NXT(2) == 'R') && (NXT(3) == 'E') &&
- (NXT(4) == 'F') && (NXT(5) == 'S')) {
- SKIP(6);
- return(XML_ATTRIBUTE_IDREFS);
} else if ((CUR == 'E') && (NXT(1) == 'N') &&
(NXT(2) == 'T') && (NXT(3) == 'I') &&
(NXT(4) == 'T') && (NXT(5) == 'Y')) {
@@ -2597,7 +3455,7 @@ void
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
CHAR *elemName;
CHAR *attrName;
- xmlEnumerationPtr tree = NULL;
+ xmlEnumerationPtr tree;
if ((CUR == '<') && (NXT(1) == '!') &&
(NXT(2) == 'A') && (NXT(3) == 'T') &&
@@ -2625,6 +3483,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
int def;
CHAR *defaultValue = NULL;
+ tree = NULL;
attrName = xmlParseName(ctxt);
if (attrName == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
@@ -2632,6 +3491,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
ctxt->wellFormed = 0;
break;
}
+ GROW;
if (!IS_BLANK(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -2644,6 +3504,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
type = xmlParseAttributeType(ctxt, &tree);
if (type <= 0) break;
+ GROW;
if (!IS_BLANK(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -2656,6 +3517,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
def = xmlParseDefaultDecl(ctxt, &defaultValue);
if (def <= 0) break;
+ GROW;
if (CUR != '>') {
if (!IS_BLANK(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
@@ -2679,6 +3541,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
free(attrName);
if (defaultValue != NULL)
free(defaultValue);
+ GROW;
}
if (CUR == '>')
NEXT;
@@ -2697,6 +3560,12 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
* [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' |
* '(' S? '#PCDATA' S? ')'
*
+ * [ VC: Proper Group/PE Nesting ] applies to [51] too (see [49])
+ *
+ * [ VC: No Duplicate Types ]
+ * TODO The same name must not appear more than once in a single
+ * mixed-content declaration.
+ *
* returns: the list of the xmlElementContentPtr describing the element choices
*/
xmlElementContentPtr
@@ -2704,6 +3573,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) {
xmlElementContentPtr ret = NULL, cur = NULL, n;
CHAR *elem = NULL;
+ GROW;
if ((CUR == '#') && (NXT(1) == 'P') &&
(NXT(2) == 'C') && (NXT(3) == 'D') &&
(NXT(4) == 'A') && (NXT(5) == 'T') &&
@@ -2719,13 +3589,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) {
if ((CUR == '(') || (CUR == '|')) {
ret = cur = xmlNewElementContent(NULL, XML_ELEMENT_CONTENT_PCDATA);
if (ret == NULL) return(NULL);
- } /********** else {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData,
- "xmlParseElementMixedContentDecl : '|' or ')' expected\n");
- ctxt->wellFormed = 0;
- return(NULL);
- } **********/
+ }
while (CUR == '|') {
NEXT;
if (elem == NULL) {
@@ -2752,6 +3616,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) {
return(NULL);
}
SKIP_BLANKS;
+ GROW;
}
if ((CUR == ')') && (NXT(1) == '*')) {
if (elem != NULL) {
@@ -2796,6 +3661,17 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) {
*
* [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
*
+ * [ VC: Proper Group/PE Nesting ] applies to [49] and [50]
+ * TODO Parameter-entity replacement text must be properly nested
+ * with parenthetized groups. That is to say, if either of the
+ * opening or closing parentheses in a choice, seq, or Mixed
+ * construct is contained in the replacement text for a parameter
+ * entity, both must be contained in the same replacement text. For
+ * interoperability, if a parameter-entity reference appears in a
+ * choice, seq, or Mixed construct, its replacement text should not
+ * be empty, and neither the first nor last non-blank character of
+ * the replacement text should be a connector (| or ,).
+ *
* returns: the tree of xmlElementContentPtr describing the element
* hierarchy.
*/
@@ -2806,12 +3682,14 @@ xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
CHAR type = 0;
SKIP_BLANKS;
+ GROW;
if (CUR == '(') {
/* Recurse on first child */
NEXT;
SKIP_BLANKS;
cur = ret = xmlParseElementChildrenContentDecl(ctxt);
SKIP_BLANKS;
+ GROW;
} else {
elem = xmlParseName(ctxt);
if (elem == NULL) {
@@ -2822,19 +3700,21 @@ xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
return(NULL);
}
cur = ret = xmlNewElementContent(elem, XML_ELEMENT_CONTENT_ELEMENT);
+ GROW;
if (CUR == '?') {
- ret->ocur = XML_ELEMENT_CONTENT_OPT;
+ cur->ocur = XML_ELEMENT_CONTENT_OPT;
NEXT;
} else if (CUR == '*') {
- ret->ocur = XML_ELEMENT_CONTENT_MULT;
+ cur->ocur = XML_ELEMENT_CONTENT_MULT;
NEXT;
} else if (CUR == '+') {
- ret->ocur = XML_ELEMENT_CONTENT_PLUS;
+ cur->ocur = XML_ELEMENT_CONTENT_PLUS;
NEXT;
} else {
- ret->ocur = XML_ELEMENT_CONTENT_ONCE;
+ cur->ocur = XML_ELEMENT_CONTENT_ONCE;
}
free(elem);
+ GROW;
}
SKIP_BLANKS;
SHRINK;
@@ -2912,7 +3792,9 @@ xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
xmlFreeElementContent(ret);
return(NULL);
}
+ GROW;
SKIP_BLANKS;
+ GROW;
if (CUR == '(') {
/* Recurse on second child */
NEXT;
@@ -2930,20 +3812,21 @@ xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
}
last = xmlNewElementContent(elem, XML_ELEMENT_CONTENT_ELEMENT);
free(elem);
- }
- if (CUR == '?') {
- ret->ocur = XML_ELEMENT_CONTENT_OPT;
- NEXT;
- } else if (CUR == '*') {
- ret->ocur = XML_ELEMENT_CONTENT_MULT;
- NEXT;
- } else if (CUR == '+') {
- ret->ocur = XML_ELEMENT_CONTENT_PLUS;
- NEXT;
- } else {
- ret->ocur = XML_ELEMENT_CONTENT_ONCE;
+ if (CUR == '?') {
+ last->ocur = XML_ELEMENT_CONTENT_OPT;
+ NEXT;
+ } else if (CUR == '*') {
+ last->ocur = XML_ELEMENT_CONTENT_MULT;
+ NEXT;
+ } else if (CUR == '+') {
+ last->ocur = XML_ELEMENT_CONTENT_PLUS;
+ NEXT;
+ } else {
+ last->ocur = XML_ELEMENT_CONTENT_ONCE;
+ }
}
SKIP_BLANKS;
+ GROW;
}
if ((cur != NULL) && (last != NULL)) {
cur->c2 = last;
@@ -2958,8 +3841,6 @@ xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
} else if (CUR == '+') {
ret->ocur = XML_ELEMENT_CONTENT_PLUS;
NEXT;
- } else {
- ret->ocur = XML_ELEMENT_CONTENT_ONCE;
}
return(ret);
}
@@ -2995,6 +3876,7 @@ xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, CHAR *name,
return(-1);
}
NEXT;
+ GROW;
SKIP_BLANKS;
if ((CUR == '#') && (NXT(1) == 'P') &&
(NXT(2) == 'C') && (NXT(3) == 'D') &&
@@ -3028,7 +3910,8 @@ xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, CHAR *name,
*
* [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
*
- * TODO There is a check [ VC: Unique Element Type Declaration ]
+ * [ VC: Unique Element Type Declaration ]
+ * TODO No element type may be declared more than once
*
* Returns the type of the element, or -1 in case of error
*/
@@ -3038,6 +3921,7 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) {
int ret = -1;
xmlElementContentPtr content = NULL;
+ GROW;
if ((CUR == '<') && (NXT(1) == '!') &&
(NXT(2) == 'E') && (NXT(3) == 'L') &&
(NXT(4) == 'E') && (NXT(5) == 'M') &&
@@ -3084,9 +3968,19 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) {
} else if (CUR == '(') {
ret = xmlParseElementContentDecl(ctxt, name, &content);
} else {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData,
- "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
+ /*
+ * [ WFC: PEs in Internal Subset ] error handling.
+ */
+ if ((CUR == '%') && (ctxt->external == 0) &&
+ (ctxt->inputNr == 1)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "PEReference: forbidden within markup decl in internal subset\n");
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
+ }
ctxt->wellFormed = 0;
if (name != NULL) free(name);
return(-1);
@@ -3122,16 +4016,35 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) {
* [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl |
* NotationDecl | PI | Comment
*
- * TODO There is a check [ VC: Proper Declaration/PE Nesting ]
+ * [ VC: Proper Declaration/PE Nesting ]
+ * TODO Parameter-entity replacement text must be properly nested with
+ * markup declarations. That is to say, if either the first character
+ * or the last character of a markup declaration (markupdecl above) is
+ * contained in the replacement text for a parameter-entity reference,
+ * both must be contained in the same replacement text.
+ *
+ * [ WFC: PEs in Internal Subset ]
+ * In the internal DTD subset, parameter-entity references can occur
+ * only where markup declarations can occur, not within markup declarations.
+ * (This does not apply to references that occur in external parameter
+ * entities or to the external subset.)
*/
void
xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) {
+ GROW;
xmlParseElementDecl(ctxt);
xmlParseAttributeListDecl(ctxt);
xmlParseEntityDecl(ctxt);
xmlParseNotationDecl(ctxt);
xmlParsePI(ctxt);
xmlParseComment(ctxt, 0);
+ /*
+ * This is only for internal subset. On external entities,
+ * the replacement is done before parsing stage
+ */
+ if ((ctxt->external == 0) && (ctxt->inputNr == 1))
+ xmlParsePEReference(ctxt);
+ ctxt->instate = XML_PARSER_DTD;
}
/**
@@ -3166,11 +4079,13 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
* 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);
@@ -3260,6 +4175,8 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
+ ctxt->instate = XML_PARSER_DTD;
+ ctxt->external = 1;
while (((CUR == '<') && (NXT(1) == '?')) ||
((CUR == '<') && (NXT(1) == '!')) ||
IS_BLANK(CUR)) {
@@ -3290,79 +4207,6 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
}
/**
- * xmlParseCharRef:
- * @ctxt: an XML parser context
- *
- * parse Reference declarations
- *
- * [66] CharRef ::= '&#' [0-9]+ ';' |
- * '&#x' [0-9a-fA-F]+ ';'
- *
- * Returns the value parsed (as an int)
- */
-int
-xmlParseCharRef(xmlParserCtxtPtr ctxt) {
- int val = 0;
-
- if ((CUR == '&') && (NXT(1) == '#') &&
- (NXT(2) == 'x')) {
- SKIP(3);
- while (CUR != ';') {
- if ((CUR >= '0') && (CUR <= '9'))
- val = val * 16 + (CUR - '0');
- else if ((CUR >= 'a') && (CUR <= 'f'))
- val = val * 16 + (CUR - 'a') + 10;
- else if ((CUR >= 'A') && (CUR <= 'F'))
- val = val * 16 + (CUR - 'A') + 10;
- else {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData,
- "xmlParseCharRef: invalid hexadecimal value\n");
- ctxt->wellFormed = 0;
- val = 0;
- break;
- }
- NEXT;
- }
- if (CUR == ';')
- NEXT;
- } else if ((CUR == '&') && (NXT(1) == '#')) {
- SKIP(2);
- while (CUR != ';') {
- if ((CUR >= '0') && (CUR <= '9'))
- val = val * 10 + (CUR - '0');
- else {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData,
- "xmlParseCharRef: invalid decimal value\n");
- ctxt->wellFormed = 0;
- val = 0;
- break;
- }
- NEXT;
- }
- if (CUR == ';')
- NEXT;
- } else {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "xmlParseCharRef: invalid value\n");
- ctxt->wellFormed = 0;
- }
- /*
- * Check the value IS_CHAR ...
- */
- if (IS_CHAR(val)) {
- 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(0);
-}
-
-/**
* xmlParseReference:
* @ctxt: an XML parser context
*
@@ -3419,6 +4263,24 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
*
* [68] EntityRef ::= '&' Name ';'
*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an internal DTD
+ * subset which contains no parameter entity references, or a document
+ * with "standalone='yes'", the Name given in the entity reference
+ * must match that in an entity declaration, except that well-formed
+ * documents need not declare any of the following entities: amp, lt,
+ * gt, apos, quot. The declaration of a parameter entity must precede
+ * any reference to it. Similarly, the declaration of a general entity
+ * must precede any reference to it which appears in a default value in an
+ * attribute-list declaration. Note that if entities are declared in the
+ * external subset or in external parameter entities, a non-validating
+ * processor is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be declared is a
+ * well-formedness constraint only if standalone='yes'.
+ *
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an unparsed entity
+ *
* Returns the xmlEntityPtr if found, or NULL otherwise.
*/
xmlEntityPtr
@@ -3427,12 +4289,14 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
xmlEntityPtr ent = NULL;
GROW;
+
if (CUR == '&') {
NEXT;
name = xmlParseName(ctxt);
if (name == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "xmlParseEntityRef: no name\n");
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseEntityRef: no name\n");
ctxt->wellFormed = 0;
} else {
if (CUR == ';') {
@@ -3447,42 +4311,86 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
if (ent == NULL)
ent = xmlGetPredefinedEntity(name);
}
-
/*
- * Well Formedness Constraint if:
- * - standalone
- * or
- * - no external subset and no external parameter entities
- * referenced
- * then
- * the entity referenced must have been declared
- *
- * TODO: to be double checked !!! This is wrong !
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", the
+ * Name given in the entity reference must match that in an
+ * entity declaration, except that well-formed documents
+ * need not declare any of the following entities: amp, lt,
+ * gt, apos, quot.
+ * The declaration of a parameter entity must precede any
+ * reference to it.
+ * Similarly, the declaration of a general entity must
+ * precede any reference to it which appears in a default
+ * value in an attribute-list declaration. Note that if
+ * entities are declared in the external subset or in
+ * external parameter entities, a non-validating processor
+ * is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be
+ * declared is a well-formedness constraint only if
+ * standalone='yes'.
*/
if (ent == NULL) {
- if (ctxt->sax != NULL) {
- if (((ctxt->sax->isStandalone != NULL) &&
- 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 (ctxt->sax->error != NULL)
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Entity '%s' not defined\n", name);
ctxt->wellFormed = 0;
- }
} else {
- fprintf(stderr, "Entity '%s' not defined\n", name);
- ctxt->wellFormed = 0;
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "Entity '%s' not defined\n", name);
}
}
/*
- * Well Formedness Constraint :
- * The referenced entity must be a parsed entity.
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an
+ * unparsed entity
+ */
+ else if (ent->type == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity reference to unparsed entity %s\n", name);
+ ctxt->wellFormed = 0;
+ }
+
+ /*
+ * [ WFC: No External Entity References ]
+ * Attribute values cannot contain direct or indirect
+ * entity references to external entities.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent->type == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Attribute references external entity '%s'\n", name);
+ ctxt->wellFormed = 0;
+ }
+ /*
+ * [ WFC: No < in Attribute Values ]
+ * The replacement text of any entity referred to directly or
+ * indirectly in an attribute value (other than "&lt;") must
+ * not contain a <.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent != NULL) && (xmlStrcmp(ent->name, "lt")) &&
+ (ent->content != NULL) &&
+ (xmlStrchr(ent->content, '<'))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "'<' in entity '%s' is not allowed in attributes values\n", name);
+ ctxt->wellFormed = 0;
+ }
+
+ /*
+ * Internal check, no parameter entities here ...
*/
- if (ent != NULL) {
+ else {
switch (ent->type) {
case XML_INTERNAL_PARAMETER_ENTITY:
case XML_EXTERNAL_PARAMETER_ENTITY:
@@ -3491,22 +4399,14 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
"Attempt to reference the parameter entity '%s'\n", name);
ctxt->wellFormed = 0;
break;
-
- case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData,
- "Attempt to reference unparsed entity '%s'\n", name);
- ctxt->wellFormed = 0;
- break;
}
}
/*
- * TODO: !!!
- * Well Formedness Constraint :
- * The referenced entity must not lead to recursion !
+ * [ WFC: No Recursion ]
+ * TODO A parsed entity must not contain a recursive
+ * reference to itself, either directly or indirectly.
*/
-
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
@@ -3530,6 +4430,24 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
*
* [69] PEReference ::= '%' Name ';'
*
+ * [ WFC: No Recursion ]
+ * TODO A parsed entity must not contain a recursive
+ * reference to itself, either directly or indirectly.
+ *
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an internal DTD
+ * subset which contains no parameter entity references, or a document
+ * with "standalone='yes'", ... ... The declaration of a parameter
+ * entity must precede any reference to it...
+ *
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external parameter entities
+ * with "standalone='no'", ... ... The declaration of a parameter entity
+ * must precede any reference to it...
+ *
+ * [ WFC: In DTD ]
+ * Parameter-entity references may only appear in the DTD.
+ * NOTE: misleading but this is handled.
*/
void
xmlParsePEReference(xmlParserCtxtPtr ctxt) {
@@ -3547,17 +4465,54 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) {
} else {
if (CUR == ';') {
NEXT;
- if ((ctxt->sax != NULL) && (ctxt->sax->getEntity != NULL))
- entity = ctxt->sax->getEntity(ctxt->userData, name);
- /* TODO !!!! Must check that it's of the proper type !!! */
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getParameterEntity != NULL))
+ entity = ctxt->sax->getParameterEntity(ctxt->userData,
+ name);
if (entity == NULL) {
- if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
- ctxt->sax->warning(ctxt->userData,
- "xmlParsePEReference: %%%s; not found\n", name);
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->wellFormed = 0;
+ } else {
+ /*
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external
+ * parameter entities with "standalone='no'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->valid = 0;
+ }
} else {
- input = xmlNewEntityInputStream(ctxt, entity);
- xmlPushInput(ctxt, input);
+ /*
+ * Internal checking in case the entity quest barfed
+ */
+ if ((entity->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (entity->type != XML_EXTERNAL_PARAMETER_ENTITY)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "Internal: %%%s; is not a parameter entity\n", name);
+ } else {
+ input = xmlNewEntityInputStream(ctxt, entity);
+ xmlPushInput(ctxt, input);
+ }
}
+ ctxt->hasPErefs = 1;
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -3577,6 +4532,10 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) {
*
* [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S?
* ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
+ *
+ * [ VC: Root Element Type ]
+ * The Name in the document type declaration must match the element
+ * type of the root element.
*/
void
@@ -3608,6 +4567,11 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
* Check for SystemID and ExternalID
*/
URI = xmlParseExternalID(ctxt, &ExternalID, 1);
+
+ if ((URI != NULL) || (ExternalID != NULL)) {
+ ctxt->hasExternalSubset = 1;
+ }
+
SKIP_BLANKS;
/*
@@ -3621,6 +4585,7 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
* Is there any DTD definition ?
*/
if (CUR == '[') {
+ ctxt->instate = XML_PARSER_DTD;
NEXT;
/*
* Parse the succession of Markup declarations and
@@ -3664,8 +4629,7 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
NEXT;
/*
- * Cleanup, since we don't use all those identifiers
- * TODO : the DOCTYPE if available should be stored !
+ * Cleanup
*/
if (URI != NULL) free(URI);
if (ExternalID != NULL) free(ExternalID);
@@ -3681,6 +4645,18 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
*
* [41] Attribute ::= Name Eq AttValue
*
+ * [ WFC: No External Entity References ]
+ * Attribute values cannot contain direct or indirect entity references
+ * to external entities.
+ *
+ * [ WFC: No < in Attribute Values ]
+ * The replacement text of any entity referred to directly or indirectly in
+ * an attribute value (other than "&lt;") must not contain a <.
+ *
+ * [ VC: Attribute Value Type ]
+ * TODO The attribute must have been declared; the value must be of the type
+ * declared for it.
+ *
* [25] Eq ::= S? '=' S?
*
* With namespace:
@@ -3714,6 +4690,7 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value) {
NEXT;
SKIP_BLANKS;
val = xmlParseAttValue(ctxt);
+ ctxt->instate = XML_PARSER_CONTENT;
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
@@ -3735,8 +4712,16 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value) {
*
* [40] STag ::= '<' Name (S Attribute)* S? '>'
*
+ * [ WFC: Unique Att Spec ]
+ * No attribute name may appear more than once in the same start-tag or
+ * empty-element tag.
+ *
* [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
*
+ * [ WFC: Unique Att Spec ]
+ * No attribute name may appear more than once in the same start-tag or
+ * empty-element tag.
+ *
* With namespace:
*
* [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
@@ -3784,17 +4769,20 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
attname = xmlParseAttribute(ctxt, &attvalue);
if ((attname != NULL) && (attvalue != NULL)) {
/*
- * Well formedness requires at most one declaration of an attribute
+ * [ WFC: Unique Att Spec ]
+ * No attribute name may appear more than once in the same
+ * start-tag or empty-element tag.
*/
for (i = 0; i < nbatts;i += 2) {
if (!xmlStrcmp(atts[i], attname)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "Attribute %s redefined\n",
- name);
+ ctxt->sax->error(ctxt->userData,
+ "Attribute %s redefined\n",
+ attname);
ctxt->wellFormed = 0;
free(attname);
free(attvalue);
- break;
+ goto failed;
}
}
@@ -3822,6 +4810,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
atts[nbatts++] = attvalue;
atts[nbatts] = NULL;
atts[nbatts + 1] = NULL;
+failed:
}
SKIP_BLANKS;
@@ -3890,7 +4879,10 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname) {
NEXT;
/*
- * Well formedness constraints, opening and closing must match.
+ * [ WFC: Element Type Match ]
+ * The Name in an element's end-tag must match the element type in the
+ * start-tag.
+ *
*/
if (xmlStrcmp(name, tagname)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
@@ -3927,9 +4919,11 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname) {
*/
void
xmlParseCDSect(xmlParserCtxtPtr ctxt) {
- const CHAR *r, *s, *base;
+ const CHAR *base;
+ CHAR r, s;
+ CHAR cur;
- if ((CUR == '<') && (NXT(1) == '!') &&
+ if ((NXT(0) == '<') && (NXT(1) == '!') &&
(NXT(2) == '[') && (NXT(3) == 'C') &&
(NXT(4) == 'D') && (NXT(5) == 'A') &&
(NXT(6) == 'T') && (NXT(7) == 'A') &&
@@ -3937,46 +4931,50 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
SKIP(9);
} else
return;
+
+ ctxt->instate = XML_PARSER_CDATA_SECTION;
base = CUR_PTR;
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "CData section not finished\n%.50s\n", base);
ctxt->wellFormed = 0;
+ ctxt->instate = XML_PARSER_CONTENT;
return;
}
- r = CUR_PTR;
+ r = CUR;
NEXT;
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "CData section not finished\n%.50s\n", base);
ctxt->wellFormed = 0;
+ ctxt->instate = XML_PARSER_CONTENT;
return;
}
- s = CUR_PTR;
+ s = CUR;
NEXT;
- while (IS_CHAR(CUR) &&
- ((*r != ']') || (*s != ']') || (CUR != '>'))) {
- r++;s++;NEXT;
+ cur = CUR;
+ while (IS_CHAR(cur) &&
+ ((r != ']') || (s != ']') || (cur != '>'))) {
+ r = s;
+ s = cur;
+ NEXT;
+ cur = CUR;
}
+ ctxt->instate = XML_PARSER_CONTENT;
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "CData section not finished\n%.50s\n", base);
ctxt->wellFormed = 0;
return;
}
+ NEXT;
/*
* Ok the segment [base CUR_PTR] is to be consumed as chars.
*/
if (ctxt->sax != NULL) {
- if (areBlanks(ctxt, base, CUR_PTR - base)) {
- if (ctxt->sax->ignorableWhitespace != NULL)
- ctxt->sax->ignorableWhitespace(ctxt->userData, base,
- (CUR_PTR - base) - 2);
- } else {
- if (ctxt->sax->characters != NULL)
- ctxt->sax->characters(ctxt->userData, base, (CUR_PTR - base) - 2);
- }
+ if (ctxt->sax->cdataBlock != NULL)
+ ctxt->sax->cdataBlock(ctxt->userData, base, (CUR_PTR - base) - 3);
}
}
@@ -3991,6 +4989,7 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
void
xmlParseContent(xmlParserCtxtPtr ctxt) {
+ GROW;
while ((CUR != '<') || (NXT(1) != '/')) {
const CHAR *test = CUR_PTR;
int cons = ctxt->input->consumed;
@@ -4019,6 +5018,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
else if ((CUR == '<') && (NXT(1) == '!') &&
(NXT(2) == '-') && (NXT(3) == '-')) {
xmlParseComment(ctxt, 1);
+ ctxt->instate = XML_PARSER_CONTENT;
}
/*
@@ -4032,6 +5032,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
* Fifth case : a reference. If if has not been resolved,
* parsing returns it's Name, create the node
*/
+
else if (CUR == '&') {
xmlParseReference(ctxt);
}
@@ -4068,7 +5069,22 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
*
* [39] element ::= EmptyElemTag | STag content ETag
*
- * [41] Attribute ::= Name Eq AttValue
+ * [ WFC: Element Type Match ]
+ * The Name in an element's end-tag must match the element type in the
+ * start-tag.
+ *
+ * [ VC: Element Valid ]
+ * TODO An element is valid if there is a declaration matching elementdecl
+ * where the Name matches the element type and one of the following holds:
+ * - The declaration matches EMPTY and the element has no content.
+ * - The declaration matches children and the sequence of child elements
+ * belongs to the language generated by the regular expression in the
+ * content model, with optional white space (characters matching the
+ * nonterminal S) between each pair of child elements.
+ * - The declaration matches Mixed and the content consists of character
+ * data and child elements whose types match names in the content model.
+ * - The declaration matches ANY, and the types of any child elements have
+ * been declared.
*/
void
@@ -4087,6 +5103,15 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
}
/*
+ * [ VC: Root Element Type ]
+ * The Name in the document type declaration must match the element
+ * type of the root element.
+ */
+ if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
+ ctxt->node && (ctxt->node == ctxt->myDoc->root))
+ ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
+
+ /*
* Check for an Empty Element.
*/
if ((CUR == '/') && (NXT(1) == '>')) {
@@ -4328,6 +5353,20 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
* [32] SDDecl ::= S 'standalone' Eq
* (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"'))
*
+ * [ VC: Standalone Document Declaration ]
+ * TODO The standalone document declaration must have the value "no"
+ * if any external markup declarations contain declarations of:
+ * - attributes with default values, if elements to which these
+ * attributes apply appear in the document without specifications
+ * of values for these attributes, or
+ * - entities (other than amp, lt, gt, apos, quot), if references
+ * to those entities appear in the document, or
+ * - attributes with values subject to normalization, where the
+ * attribute appears in the document with a value which will change
+ * as a result of normalization, or
+ * - element types with element content, if white space occurs directly
+ * within any instance of those types.
+ *
* Returns 1 if standalone, 0 otherwise
*/
@@ -4599,6 +5638,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
(NXT(6) == 'Y') && (NXT(7) == 'P') &&
(NXT(8) == 'E')) {
xmlParseDocTypeDecl(ctxt);
+ ctxt->instate = XML_PARSER_PROLOG;
xmlParseMisc(ctxt);
}
@@ -4606,7 +5646,9 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
* Time to start parsing the tree itself
*/
GROW;
+ ctxt->instate = XML_PARSER_CONTENT;
xmlParseElement(ctxt);
+ ctxt->instate = XML_PARSER_EPILOG;
/*
* The Misc part at the end
@@ -4619,6 +5661,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
"Extra content at the end of the document\n");
ctxt->wellFormed = 0;
}
+ ctxt->instate = XML_PARSER_EOF;
/*
* SAX: end of the document processing.
@@ -4629,6 +5672,12 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
return(0);
}
+/************************************************************************
+ * *
+ * I/O front end functions to the parser *
+ * *
+ ************************************************************************/
+
/**
* xmlCreateDocParserCtxt :
* @cur: a pointer to an array of CHAR
@@ -4643,16 +5692,13 @@ xmlCreateDocParserCtxt(CHAR *cur) {
xmlParserInputPtr input;
xmlCharEncoding enc;
- ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+ ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
- perror("malloc");
return(NULL);
}
- xmlInitParserCtxt(ctxt);
- input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+ input = xmlNewInputStream(ctxt);
if (input == NULL) {
- perror("malloc");
- free(ctxt);
+ xmlFreeParserCtxt(ctxt);
return(NULL);
}
@@ -4662,14 +5708,8 @@ xmlCreateDocParserCtxt(CHAR *cur) {
enc = xmlDetectCharEncoding(cur);
xmlSwitchEncoding(ctxt, enc);
- input->filename = NULL;
- input->line = 1;
- input->col = 1;
input->base = cur;
input->cur = cur;
- input->buf = NULL;
- input->free = NULL;
- input->consumed = 0;
inputPush(ctxt, input);
return(ctxt);
@@ -4753,12 +5793,10 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
if ((ExternalID == NULL) && (SystemID == NULL)) return(NULL);
- ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+ ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
- perror("malloc");
return(NULL);
}
- xmlInitParserCtxt(ctxt);
/*
* Set-up the SAX context
@@ -4790,7 +5828,8 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
enc = xmlDetectCharEncoding(ctxt->input->cur);
xmlSwitchEncoding(ctxt, enc);
- input->filename = xmlStrdup(SystemID);
+ if (input->filename == NULL)
+ input->filename = xmlStrdup(SystemID);
input->line = 1;
input->col = 1;
input->base = ctxt->input->cur;
@@ -4864,34 +5903,33 @@ xmlCreateFileParserCtxt(const char *filename)
xmlParserCtxtPtr ctxt;
xmlParserInputPtr inputStream;
xmlParserInputBufferPtr buf;
+ char *directory = NULL;
buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE);
if (buf == NULL) return(NULL);
- ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+ ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
- perror("malloc");
return(NULL);
}
- xmlInitParserCtxt(ctxt);
- inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+
+ inputStream = xmlNewInputStream(ctxt);
if (inputStream == NULL) {
- perror("malloc");
- free(ctxt);
+ xmlFreeParserCtxt(ctxt);
return(NULL);
}
inputStream->filename = strdup(filename);
- inputStream->line = 1;
- inputStream->col = 1;
inputStream->buf = buf;
- inputStream->consumed = 0;
-
inputStream->base = inputStream->buf->buffer->content;
inputStream->cur = inputStream->buf->buffer->content;
- inputStream->free = NULL;
inputPush(ctxt, inputStream);
+ if ((ctxt->directory == NULL) && (directory == NULL))
+ directory = xmlParserGetDirectory(filename);
+ if ((ctxt->directory == NULL) && (directory != NULL))
+ ctxt->directory = directory;
+
return(ctxt);
}
@@ -4915,6 +5953,7 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
int recovery) {
xmlDocPtr ret;
xmlParserCtxtPtr ctxt;
+ char *directory = NULL;
ctxt = xmlCreateFileParserCtxt(filename);
if (ctxt == NULL) return(NULL);
@@ -4925,6 +5964,11 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
ctxt->userData = NULL;
}
+ if ((ctxt->directory == NULL) && (directory == NULL))
+ directory = xmlParserGetDirectory(filename);
+ if ((ctxt->directory == NULL) && (directory != NULL))
+ ctxt->directory = xmlStrdup(directory);
+
xmlParseDocument(ctxt);
if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc;
@@ -4972,28 +6016,6 @@ xmlRecoverFile(const char *filename) {
}
/**
- * 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
@@ -5010,24 +6032,21 @@ xmlCreateMemoryParserCtxt(char *buffer, int size) {
buffer[size - 1] = '\0';
- ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
+ ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
- perror("malloc");
return(NULL);
}
- xmlInitParserCtxt(ctxt);
- input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
+
+ input = xmlNewInputStream(ctxt);
if (input == NULL) {
- perror("malloc");
- free(ctxt->nodeTab);
- free(ctxt->inputTab);
- free(ctxt);
+ xmlFreeParserCtxt(ctxt);
return(NULL);
}
input->filename = NULL;
input->line = 1;
input->col = 1;
+ input->buf = NULL;
input->consumed = 0;
/*
@@ -5114,92 +6133,6 @@ xmlDocPtr xmlRecoverMemory(char *buffer, int size) {
return(xmlSAXParseMemory(NULL, buffer, size, 1));
}
-/**
- * xmlInitParserCtxt:
- * @ctxt: an XML parser context
- *
- * Initialize a parser context
- */
-
-void
-xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
-{
- xmlSAXHandler *sax;
-
- sax = (xmlSAXHandler *) malloc(sizeof(xmlSAXHandler));
- if (sax == NULL) {
- fprintf(stderr, "xmlInitParserCtxt: out of memory\n");
- }
-
- /* Allocate the Input stack */
- ctxt->inputTab = (xmlParserInputPtr *) malloc(5 * sizeof(xmlParserInputPtr));
- ctxt->inputNr = 0;
- ctxt->inputMax = 5;
- ctxt->input = NULL;
- ctxt->version = NULL;
- ctxt->encoding = NULL;
- ctxt->standalone = -1;
-
- /* Allocate the Node stack */
- ctxt->nodeTab = (xmlNodePtr *) malloc(10 * sizeof(xmlNodePtr));
- ctxt->nodeNr = 0;
- ctxt->nodeMax = 10;
- ctxt->node = NULL;
-
- if (sax == NULL) ctxt->sax = &xmlDefaultSAXHandler;
- else {
- ctxt->sax = sax;
- memcpy(sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler));
- }
- ctxt->userData = ctxt;
- ctxt->myDoc = NULL;
- ctxt->wellFormed = 1;
- ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
- ctxt->record_info = 0;
- xmlInitNodeInfoSeq(&ctxt->node_seq);
-}
-
-/**
- * xmlFreeParserCtxt:
- * @ctxt: an XML parser context
- *
- * Free all the memory used by a parser context. However the parsed
- * document in ctxt->myDoc is not freed.
- */
-
-void
-xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
-{
- xmlParserInputPtr input;
-
- if (ctxt == NULL) return;
-
- while ((input = inputPop(ctxt)) != NULL) {
- xmlFreeInputStream(input);
- }
-
- if (ctxt->nodeTab != NULL) free(ctxt->nodeTab);
- if (ctxt->inputTab != NULL) free(ctxt->inputTab);
- if (ctxt->version != NULL) free((char *) ctxt->version);
- if ((ctxt->sax != NULL) && (ctxt->sax != &xmlDefaultSAXHandler))
- free(ctxt->sax);
- free(ctxt);
-}
-
-/**
- * xmlClearParserCtxt:
- * @ctxt: an XML parser context
- *
- * Clear (release owned resources) and reinitialize a parser context
- */
-
-void
-xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
-{
- xmlClearNodeInfoSeq(&ctxt->node_seq);
- xmlInitParserCtxt(ctxt);
-}
-
/**
* xmlSetupParserForBuffer:
@@ -5215,27 +6148,29 @@ void
xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const CHAR* buffer,
const char* filename)
{
- xmlParserInputPtr input;
+ xmlParserInputPtr input;
- input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
- if (input == NULL) {
- perror("malloc");
- free(ctxt);
- exit(1);
- }
+ input = xmlNewInputStream(ctxt);
+ if (input == NULL) {
+ perror("malloc");
+ free(ctxt);
+ exit(1);
+ }
+
+ xmlClearParserCtxt(ctxt);
+ if (filename != NULL)
+ input->filename = strdup(filename);
+ input->base = buffer;
+ input->cur = buffer;
+ inputPush(ctxt, input);
+}
- xmlClearParserCtxt(ctxt);
- if (input->filename != NULL)
- input->filename = strdup(filename);
- else
- input->filename = NULL;
- input->line = 1;
- input->col = 1;
- input->base = buffer;
- input->cur = buffer;
- inputPush(ctxt, input);
-}
+/************************************************************************
+ * *
+ * Miscelaneous *
+ * *
+ ************************************************************************/
/**
@@ -5388,3 +6323,25 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
}
+/**
+ * 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);
+}
+
diff --git a/parser.h b/parser.h
index 43d183e0..6659cdf7 100644
--- a/parser.h
+++ b/parser.h
@@ -1,5 +1,5 @@
/*
- * parser.h : constants and stuff related to the XML parser.
+ * parser.h : Interfaces, constants and types related to the XML parser.
*
* See Copyright for the status of this software.
*
@@ -10,6 +10,7 @@
#define __XML_PARSER_H__
#include "tree.h"
+#include "valid.h"
#include "xmlIO.h"
#ifdef __cplusplus
@@ -21,12 +22,22 @@ extern "C" {
*/
#define XML_DEFAULT_VERSION "1.0"
+/**
+ * an xmlParserInput is an input flow for the XML processor.
+ * Each entity parsed is associated an xmlParserInput (except the
+ * few predefined ones). This is the case both for internal entities
+ * - in which case the flow is already completely in memory - or
+ * external entities - in which case we use the buf structure for
+ * progressive reading and I18N conversions to the internal UTF-8 format.
+ */
+
typedef void (* xmlParserInputDeallocate)(CHAR *);
typedef struct xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
+ const char *directory; /* the directory/base of teh file */
const CHAR *base; /* Base of the array to parse */
const CHAR *cur; /* Current char being parsed */
int line; /* Current line */
@@ -36,6 +47,11 @@ typedef struct xmlParserInput {
} xmlParserInput;
typedef xmlParserInput *xmlParserInputPtr;
+/**
+ * the parser can be asked to collect Node informations, i.e. at what
+ * place in the file they were detected.
+ * NOTE: This is off by default and not very well tested.
+ */
typedef struct _xmlParserNodeInfo {
const struct xmlNode* node;
/* Position & line # that text that created the node begins & ends on */
@@ -54,24 +70,63 @@ typedef struct xmlParserNodeInfoSeq {
typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
+/**
+ * The parser is not a state based parser, but we need to maintain
+ * minimum state informations, especially for entities processing.
+ */
+typedef enum xmlParserInputState {
+ XML_PARSER_EOF = 0,
+ XML_PARSER_PROLOG,
+ XML_PARSER_CONTENT,
+ XML_PARSER_ENTITY_DECL,
+ XML_PARSER_ENTITY_VALUE,
+ XML_PARSER_ATTRIBUTE_VALUE,
+ XML_PARSER_DTD,
+ XML_PARSER_EPILOG,
+ XML_PARSER_COMMENT,
+ XML_PARSER_CDATA_SECTION,
+} xmlParserInputState;
+
+/**
+ * The parser context.
+ * NOTE This doesn't completely defines the parser state, the (current ?)
+ * design of the parser uses recursive function calls since this allow
+ * and easy mapping from the production rules of the specification
+ * to the actual code. The drawback is that the actual function call
+ * also reflect the parser state. However most of the parsing routines
+ * takes as the only argument the parser context pointer, so migrating
+ * to a state based parser for progressive parsing shouldn't be too hard.
+ */
typedef struct _xmlParserCtxt {
struct xmlSAXHandler *sax; /* The SAX handler */
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 */
- int html; /* are we parsing an HTML document */
+ const CHAR *version; /* the XML version string */
+ const CHAR *encoding; /* encoding, if any */
+ int standalone; /* standalone document */
+ int hasExternalSubset; /* reference and external subset */
+ int hasPErefs; /* the internal subset has PE refs */
+ int html; /* are we parsing an HTML document */
+ int external; /* are we parsing an external entity */
+
+ int wellFormed; /* is the document well formed */
+ int valid; /* is the document valid */
+ int validate; /* shall we try to validate ? */
+ xmlValidCtxt vctxt; /* The validity context */
+
+ xmlParserInputState instate; /* current type of input */
+ int token; /* next char look-ahead */
+ char *directory; /* the data directory */
+
/* Input stream stack */
xmlParserInputPtr input; /* Current input stream */
int inputNr; /* Number of current input streams */
int inputMax; /* Max number of input streams */
xmlParserInputPtr *inputTab; /* stack of inputs */
- /* Node analysis stack */
+ /* Node analysis stack only used for DOM building */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
@@ -83,10 +138,9 @@ typedef struct _xmlParserCtxt {
typedef _xmlParserCtxt xmlParserCtxt;
typedef xmlParserCtxt *xmlParserCtxtPtr;
-/*
+/**
* a SAX Locator.
*/
-
typedef struct xmlSAXLocator {
const CHAR *(*getPublicId)(void *ctx);
const CHAR *(*getSystemId)(void *ctx);
@@ -96,8 +150,9 @@ typedef struct xmlSAXLocator {
typedef _xmlSAXLocator xmlSAXLocator;
typedef xmlSAXLocator *xmlSAXLocatorPtr;
-/*
- * a SAX Exception.
+/**
+ * a SAX handler is bunch of callbacks called by the parser when processing
+ * of the input generate data or structure informations.
*/
#include "entities.h"
@@ -108,6 +163,8 @@ typedef void (*internalSubsetSAXFunc) (void *ctx, const CHAR *name,
const CHAR *ExternalID, const CHAR *SystemID);
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
const CHAR *name);
+typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
+ const CHAR *name);
typedef void (*entityDeclSAXFunc) (void *ctx,
const CHAR *name, int type, const CHAR *publicId,
const CHAR *systemId, CHAR *content);
@@ -138,6 +195,7 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
typedef void (*processingInstructionSAXFunc) (void *ctx,
const CHAR *target, const CHAR *data);
typedef void (*commentSAXFunc) (void *ctx, const CHAR *value);
+typedef void (*cdataBlockSAXFunc) (void *ctx, const CHAR *value, int len);
typedef void (*warningSAXFunc) (void *ctx, const char *msg, ...);
typedef void (*errorSAXFunc) (void *ctx, const char *msg, ...);
typedef void (*fatalErrorSAXFunc) (void *ctx, const char *msg, ...);
@@ -170,12 +228,13 @@ typedef struct xmlSAXHandler {
warningSAXFunc warning;
errorSAXFunc error;
fatalErrorSAXFunc fatalError;
+ getParameterEntitySAXFunc getParameterEntity;
+ cdataBlockSAXFunc cdataBlock;
} xmlSAXHandler;
typedef xmlSAXHandler *xmlSAXHandlerPtr;
-/*
- * Global variables: just the SAX interface tables we are looking for full
- * reentrancy of the code and version infos.
+/**
+ * Global variables: just the default SAX interface tables and XML version infos.
*/
extern const char *xmlParserVersion;
@@ -186,14 +245,14 @@ extern xmlSAXHandler htmlDefaultSAXHandler;
#include "entities.h"
#include "xml-error.h"
-/*
+/**
* Input functions
*/
int xmlParserInputRead(xmlParserInputPtr in, int len);
int xmlParserInputGrow(xmlParserInputPtr in, int len);
-/*
+/**
* CHAR handling
*/
CHAR *xmlStrdup(const CHAR *cur);
@@ -207,23 +266,23 @@ int xmlStrlen(const CHAR *str);
CHAR *xmlStrcat(CHAR *cur, const CHAR *add);
CHAR *xmlStrncat(CHAR *cur, const CHAR *add, int len);
-/*
- * Interfaces
+/**
+ * Basic parsing Interfaces
*/
xmlDocPtr xmlParseDoc(CHAR *cur);
xmlDocPtr xmlParseMemory(char *buffer, int size);
xmlDocPtr xmlParseFile(const char *filename);
int xmlSubstituteEntitiesDefault(int val);
-/*
+/**
* Recovery mode
*/
xmlDocPtr xmlRecoverDoc(CHAR *cur);
xmlDocPtr xmlRecoverMemory(char *buffer, int size);
xmlDocPtr xmlRecoverFile(const char *filename);
-/*
- * Internal routines
+/**
+ * Less common routines and SAX interfaces
*/
int xmlParseDocument(xmlParserCtxtPtr ctxt);
xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur, int recovery);
diff --git a/parserInternals.h b/parserInternals.h
index b1077188..ae8e2cc2 100644
--- a/parserInternals.h
+++ b/parserInternals.h
@@ -18,6 +18,26 @@ extern "C" {
/**
* A few macros needed to help building the parser.
*/
+/* #define UNICODE */
+
+#ifdef UNICODE
+typedef unsigned long CHARVAL;
+
+#define NEXTCHARVAL(p) (unsigned long) \
+ ((*(p) == 0) ? (unsigned long) 0 : \
+ ((*(p) < 0x80) ? (unsigned long) (*(p)++) : \
+ (*(p) < 0xC0) ? (unsigned long) 0 : \
+ (*(p) < 0xE0) ? ((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) : \
+ (*(p) < 0xF0) ? (((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) << 6 + \
+ (*(p)++ & 0x3F)) : \
+ (*(p) < 0xF8) ? ((((((unsigned long) *(p)++) << 6) + (*(p)++ & 0x3F)) << 6 + \
+ (*(p)++ & 0x3F)) << 6 + (*(p)++ & 0x3F)) : 0))
+#else
+typedef unsigned char CHARVAL;
+
+#define NEXTCHARVAL(p) (unsigned long) *(p);
+#define SKIPCHARVAL(p) (p)++;
+#endif
#ifdef UNICODE
/************************************************************************
@@ -402,7 +422,6 @@ extern "C" {
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
#else
-#ifndef USE_UTF_8
/************************************************************************
* *
* 8bits / ISO-Latin version of the macros. *
@@ -453,15 +472,6 @@ extern "C" {
*/
#define IS_EXTENDER(c) ((c) == 0xb7)
-#else /* USE_UTF_8 */
-/************************************************************************
- * *
- * 8bits / UTF-8 version of the macros. *
- * *
- ************************************************************************/
-
-TODO !!!
-#endif /* USE_UTF_8 */
#endif /* !UNICODE */
/*
@@ -513,6 +523,10 @@ xmlParserCtxtPtr
xmlCreateMemoryParserCtxt(char *buffer, int size);
void
xmlFreeParserCtxt(xmlParserCtxtPtr ctxt);
+xmlParserCtxtPtr
+xmlNewParserCtxt();
+void
+xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc);
/**
* Entities
@@ -554,6 +568,8 @@ xmlParseNamespace(xmlParserCtxtPtr ctxt);
* Generic production rules
*/
CHAR *
+xmlScanName(xmlParserCtxtPtr ctxt);
+CHAR *
xmlParseName(xmlParserCtxtPtr ctxt);
CHAR *
xmlParseNmtoken(xmlParserCtxtPtr ctxt);
@@ -638,6 +654,9 @@ void
xmlParseXMLDecl(xmlParserCtxtPtr ctxt);
void
xmlParseMisc(xmlParserCtxtPtr ctxt);
+void
+xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const CHAR *ExternalID,
+ const CHAR *SystemID);
/*
* Entities substitution
diff --git a/result/XPath/tests/chaptersbase b/result/XPath/tests/chaptersbase
index 43cc0538..c9a10f96 100644
--- a/result/XPath/tests/chaptersbase
+++ b/result/XPath/tests/chaptersbase
@@ -1,5 +1,22 @@
Object is a Node Set :
Set contains 1 nodes:
+1 ELEMENT EXAMPLE
+ ATTRIBUTE prop1
+ TEXT
+ content=gnome is great
+ ATTRIBUTE prop2
+ TEXT
+ content=& linux too
+Object is a Node Set :
+Set contains 6 nodes:
+1 ELEMENT head
+2 ELEMENT chapter
+3 ELEMENT chapter
+4 ELEMENT chapter
+5 ELEMENT chapter
+6 ELEMENT chapter
+Object is a Node Set :
+Set contains 1 nodes:
1 ELEMENT head
Object is a Node Set :
Set contains 6 nodes:
diff --git a/result/XPath/tests/simpleabbr b/result/XPath/tests/simpleabbr
index 774addb9..aeb5f54d 100644
--- a/result/XPath/tests/simpleabbr
+++ b/result/XPath/tests/simpleabbr
@@ -1,5 +1,17 @@
Object is a Node Set :
Set contains 1 nodes:
+1 ELEMENT EXAMPLE
+ ATTRIBUTE prop1
+ TEXT
+ content=gnome is great
+ ATTRIBUTE prop2
+ TEXT
+ content=& linux too
+Object is a Node Set :
+Set contains 1 nodes:
+1 ELEMENT chapter
+Object is a Node Set :
+Set contains 1 nodes:
1 ELEMENT chapter
Object is a Node Set :
Set contains 2 nodes:
diff --git a/result/XPath/tests/simplebase b/result/XPath/tests/simplebase
index 32a84bbb..3dcdcd46 100644
--- a/result/XPath/tests/simplebase
+++ b/result/XPath/tests/simplebase
@@ -1,5 +1,17 @@
Object is a Node Set :
Set contains 1 nodes:
+1 ELEMENT EXAMPLE
+ ATTRIBUTE prop1
+ TEXT
+ content=gnome is great
+ ATTRIBUTE prop2
+ TEXT
+ content=& linux too
+Object is a Node Set :
+Set contains 1 nodes:
+1 ELEMENT chapter
+Object is a Node Set :
+Set contains 1 nodes:
1 ELEMENT head
Object is a Node Set :
Set contains 2 nodes:
diff --git a/test/HTML/fp40.htm b/test/HTML/fp40.htm
new file mode 100644
index 00000000..840b81e9
--- /dev/null
+++ b/test/HTML/fp40.htm
@@ -0,0 +1,166 @@
+<!doctype html public "-//IETF//DTD HTML//EN">
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
+<title>README - Microsoft FrontPage 2000 Server Extensions</title>
+<meta name="Microsoft Theme" content="none">
+</head>
+
+<body>
+<font face="Verdana">
+<h1><a name="top">Microsoft FrontPage 2000 Server Extensions, UNIX</a></h1>
+
+<font size="2"><i>© Copyright Microsoft Corporation, 1999&nbsp;</i></font>
+
+
+<p>The FrontPage Server Extensions are a set of programs on the Web server that support:
+
+<ul>
+ <li>Authoring FrontPage webs</li>
+ <li>Administering FrontPage webs</li>
+ <li>Browse-time FrontPage web functionality</li>
+</ul>
+
+
+<h2>Contents&nbsp;</h2>
+
+<a href="#relnotes">Release Notes</a><br>
+<a href="#moreinfo">Resources for More Information</a>
+<p>&nbsp;</p>
+<hr>
+<h2><a name="relnotes">Release Notes</a></h2>
+
+<p>This section provides complementary or late-breaking
+information to supplement the Microsoft FrontPage Server Extensions documentation.</p>
+
+<p><a href="#apache">Apache 1.3.4 Support</a><br>
+<a href="#upgrading">Upgrading from previous version of FrontPage Server Extensions</a><br>
+<a href="#executables">Uploading files into executable folders</a></p>
+
+
+<p align="right"><font size="1"><a href="#top">Top of Page</a></font></p>
+
+
+<h3><a name="apache">Apache 1.3.4 Support</a></h3>
+
+<p>You need to take some special steps to run the FrontPage Server Extensions with Apache 1.3.4.
+FrontPage Server Extensions expect to find all resource directives in the main server
+configuration file, usually http.conf. To prevent the server extensions from using any secondary
+configuration files (access.conf, srm.conf), add the following lines to http.conf:</p>
+
+
+</font>
+<blockquote>
+ <font face="Courier New">
+ResourceConfig /dev/null&nbsp;<br>
+AccessConfig /dev/null</font>
+</blockquote>
+<font face="Verdana">
+
+
+<p>If you have some settings stored in secondary configuration files, move them to http.conf.</p>
+
+<p>You must stop and restart the web server for your changes to http.conf to take effect.</p>
+
+
+
+<p align="right"><font size="1"><a href="#relnotes">Top of Section</a></font></p>
+
+
+
+<h3><a name="upgrading">Upgrading from previous version of FrontPage Server Extensions</a></h3>
+
+<p>Custom entries in frontpage.cnf are not migrated to FrontPage 2000.</p>
+
+<p>When you install FrontPage 2000 Server Extensions, a new frontpage.cnf file is created in the /usr/local/frontpage/version4.0 directory.
+Any custom settings stored in a previous-version frontpage.cnf are not used. However, you can copy
+your custom settings from the previous-version frontpage.cnf file after you install the FrontPage 2000 Server Extensions.</p>
+
+<p>Do not overwrite the FrontPage 2000 frontpage.cnf file with a frontpage.cnf file from an
+earlier version of the FrontPage Server Extensions.</p>
+
+
+
+<p align="right"><font size="1"><a href="#relnotes">Top of Section</a></font></p>
+
+
+
+<h3><a name="executables">Uploading files into executable folders</a></h3>
+
+
+<p>After upgrading to FrontPage 2000, FrontPage authors will not be able to upload files into
+executable folders. For security reasons, the default setting on FrontPage 2000 webs does not
+allow authors to upload executable files into executable folders in a FrontPage web. This
+setting protects servers so that authors do not inadvertently upload a program containing a bug
+or a virus.</p>
+
+<p>To allow FrontPage authors to upload executables, set the NoExecutableCgiUpload configuration
+variable to zero (0). For information about FrontPage Server Extension configuration variables,
+see the FrontPage 2000 Server Extensions Resource Kit at <a href="http://officeupdate.microsoft.com/frontpage/wpp/serk/">http://officeupdate.microsoft.com/frontpage/wpp/serk/</a>.</p>
+
+
+
+<p align="right"><font size="1"><a href="#relnotes">Top of Section</a></font></p>
+
+
+
+<hr>
+
+
+
+<h2><a name="moreinfo">Resources for More Information</a></h2>
+
+<p>This section lists sources of more information about the
+FrontPage Server Extensions.</p>
+
+<p><a href="#serk">Server Extensions Resource Kit</a><br>
+<a href="#serkupdate">Server Extensions Resource Kit Update</a><br>
+<a href="#kb">Knowledge Base</a></p>
+
+
+<p align="right"><font size="1"><a href="#top">Top of Page</a></font></p>
+
+
+<h3><a name="serk">Server Extensions Resource Kit</a></h3>
+
+<p>The FrontPage 2000 Server Extensions include a full set of documentation: the Server
+Extensions Resource Kit. This is an HTML document installed on the server machine (by
+default) in /usr/local/frontpage/version4.0/serk. To view the Server Extensions Resource
+Kit, open /usr/local/frontpage/version4.0/serk/default.htm in your Web browser.</p>
+
+<p>The Server Extensions Resource Kit contains detailed information about installing and
+administering the FrontPage Server Extensions along with an overview of the Server
+Extensions, a detailed discussion of Server Extensions security on UNIX and Windows,
+troubleshooting information, and a full set of appendixes.</p>
+
+<p align="right"><font size="1"><a href="#moreinfo">Top of Section</a></font></p>
+
+
+<h3><a name="serkupdate">Server Extensions Resource Kit Update</a></h3>
+
+<p>For updated information about installing, setting up, and administrating the FrontPage Server
+Extensions, see the Server Extensions Resource Kit Update at: <a href="http://officeupdate.microsoft.com/frontpage/wpp/serk/">http://officeupdate.microsoft.com/frontpage/wpp/serk/</a>.</p>
+
+
+<p align="right"><font size="1"><a href="#moreinfo">Top of Section</a></font></p>
+
+
+<h3><a name="kb">Microsoft Knowledge Base</a></h3>
+
+<p>For further technical information on FrontPage, please consult Support Online. Use Support
+Online to easily search Microsoft Product Support Services' collection of resources including
+technical articles from Microsoft's extensive Knowledge Base, FAQs, & troubleshooters to find
+fast, accurate answers. You can also customize the site to control your search using either
+keywords or the site's natural language search engine, which uses normal everyday language for
+answering inquiries, so you can write your question in your own words. To begin, go to
+<a href="http://support.microsoft.com/support/">http://support.microsoft.com/support/</a>.</p>
+
+<p align="right"><font size="1"><a href="#moreinfo">Top of Section</a></font></p>
+
+
+<p>&nbsp;</p>
+
+</font>
+</body>
+</html>
diff --git a/test/VC/AttributeDefaultLegal b/test/VC/AttributeDefaultLegal
new file mode 100644
index 00000000..471eb201
--- /dev/null
+++ b/test/VC/AttributeDefaultLegal
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc At NMTOKEN "$$$">
+<!ATTLIST doc Ok NMTOKEN "1abc_2">
+<!ATTLIST doc bad IDREF "1abc_2">
+<!ATTLIST doc ok2 IDREF "abc_2">
+<!ATTLIST doc bad2 IDREFS "abc:1 1abc_2">
+<!ATTLIST doc ok3 IDREFS "abc:1 a1bc_2">
+]>
+<doc val="v1"/>
+
diff --git a/test/VC/DuplicateType b/test/VC/DuplicateType
new file mode 100644
index 00000000..4b288048
--- /dev/null
+++ b/test/VC/DuplicateType
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA | b | c | d | c)*>
+]>
+<a> violates [ VC: No Duplicate Types ] </a>
diff --git a/test/VC/ElementValid b/test/VC/ElementValid
new file mode 100644
index 00000000..c297ce63
--- /dev/null
+++ b/test/VC/ElementValid
@@ -0,0 +1,3 @@
+<!DOCTYPE doc [
+]>
+<doc/>
diff --git a/test/VC/ElementValid2 b/test/VC/ElementValid2
new file mode 100644
index 00000000..672a0f52
--- /dev/null
+++ b/test/VC/ElementValid2
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (p)*>
+]>
+<doc><p/></doc>
diff --git a/test/VC/ElementValid3 b/test/VC/ElementValid3
new file mode 100644
index 00000000..67cbab48
--- /dev/null
+++ b/test/VC/ElementValid3
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc EMPTY>
+]>
+<doc>Oops, this element was declared EMPTY</doc>
diff --git a/test/VC/ElementValid4 b/test/VC/ElementValid4
new file mode 100644
index 00000000..56df55a2
--- /dev/null
+++ b/test/VC/ElementValid4
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA | a | b)*>
+<!ELEMENT a EMPTY>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+]>
+<doc> This <b>seems</b> Ok <a/> but this <c>was not declared</c></doc>
diff --git a/test/VC/ElementValid5 b/test/VC/ElementValid5
new file mode 100644
index 00000000..2cef3c49
--- /dev/null
+++ b/test/VC/ElementValid5
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a , b* , c+)>
+<!ELEMENT a EMPTY>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+]>
+<doc><a/><b> but this</b><c>was not declared</c><b>seems</b></doc>
diff --git a/test/VC/ElementValid6 b/test/VC/ElementValid6
new file mode 100644
index 00000000..fbf721dc
--- /dev/null
+++ b/test/VC/ElementValid6
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a , b? , c+)?>
+<!ELEMENT a EMPTY>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+]>
+<doc><a/><b>lacks c</b></doc>
diff --git a/test/VC/ElementValid7 b/test/VC/ElementValid7
new file mode 100644
index 00000000..a88115f3
--- /dev/null
+++ b/test/VC/ElementValid7
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((a | b)* , c+, a, b?, c, a?)>
+<!ELEMENT a EMPTY>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+]>
+<doc><a/><b/><a/><c/><c/><a/></doc>
diff --git a/test/VC/Enumeration b/test/VC/Enumeration
new file mode 100644
index 00000000..6c639680
--- /dev/null
+++ b/test/VC/Enumeration
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc val (v1 | v2 | v3) #IMPLIED>
+]>
+<doc val="v4"></doc>
diff --git a/test/VC/OneID b/test/VC/OneID
new file mode 100644
index 00000000..e9cbc0c8
--- /dev/null
+++ b/test/VC/OneID
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc val ID #IMPLIED>
+<!ATTLIST doc id ID #IMPLIED>
+]>
+<doc val="v1"></doc>
diff --git a/test/VC/OneID2 b/test/VC/OneID2
new file mode 100644
index 00000000..ffa9d1fa
--- /dev/null
+++ b/test/VC/OneID2
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ATTLIST doc val ID #IMPLIED>
+<!ATTLIST doc id ID #IMPLIED>
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc val="v1"></doc>
diff --git a/test/VC/OneID3 b/test/VC/OneID3
new file mode 100644
index 00000000..96967360
--- /dev/null
+++ b/test/VC/OneID3
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "dtds/doc.dtd" [
+<!ATTLIST doc id ID #IMPLIED>
+]>
+<doc val="v1"></doc>
diff --git a/test/VC/PENesting b/test/VC/PENesting
new file mode 100644
index 00000000..17332ae8
--- /dev/null
+++ b/test/VC/PENesting
@@ -0,0 +1,2 @@
+<!ENTITY % pe1 "EMPTY> <!ELEMENT e2 EMPTY>">
+<!ELEMENT e1 %pe1;
diff --git a/test/VC/PENesting2 b/test/VC/PENesting2
new file mode 100644
index 00000000..27b0cca2
--- /dev/null
+++ b/test/VC/PENesting2
@@ -0,0 +1,3 @@
+<!ENTITY % p1 "(A|B">
+<!ENTITY % p2 "|C|D)">
+<!ELEMENT X %p1;%p2;>
diff --git a/test/VC/UniqueElementTypeDeclaration b/test/VC/UniqueElementTypeDeclaration
new file mode 100644
index 00000000..2246f177
--- /dev/null
+++ b/test/VC/UniqueElementTypeDeclaration
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE a SYSTEM "dtds/a.dtd" [
+<!ELEMENT a (#PCDATA | b | c)*>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+]>
+<a> violates [ VC: Unique Element Type Declaration ] </a>
diff --git a/test/VC/UniqueElementTypeDeclaration2 b/test/VC/UniqueElementTypeDeclaration2
new file mode 100644
index 00000000..0805f8dc
--- /dev/null
+++ b/test/VC/UniqueElementTypeDeclaration2
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ELEMENT a (#PCDATA | b | c)*>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT c (#PCDATA)>
+<!ELEMENT a (#PCDATA | b | c)*>
+]>
+<a> violates [ VC: Unique Element Type Declaration ] </a>
diff --git a/test/VC/dtds/a.dtd b/test/VC/dtds/a.dtd
new file mode 100644
index 00000000..b8571a4f
--- /dev/null
+++ b/test/VC/dtds/a.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT a (#PCDATA | b | c)*>
+<!ATTLIST doc id ID #IMPLIED>
diff --git a/test/VC/dtds/doc.dtd b/test/VC/dtds/doc.dtd
new file mode 100644
index 00000000..71f8b412
--- /dev/null
+++ b/test/VC/dtds/doc.dtd
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc val ID #IMPLIED>
diff --git a/test/WFC/ElemTypeMatch b/test/WFC/ElemTypeMatch
new file mode 100644
index 00000000..11a2df34
--- /dev/null
+++ b/test/WFC/ElemTypeMatch
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<a> violates [ WFC: Element Type Match ] </b>
diff --git a/test/WFC/EntityDeclared b/test/WFC/EntityDeclared
new file mode 100644
index 00000000..e3427a13
--- /dev/null
+++ b/test/WFC/EntityDeclared
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<a> &unknown; violates [ WFC: Entity Declared ] </a>
diff --git a/test/WFC/EntityDeclared2 b/test/WFC/EntityDeclared2
new file mode 100644
index 00000000..e6d16dda
--- /dev/null
+++ b/test/WFC/EntityDeclared2
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ENTITY e "an entity">
+]>
+<a> &unknown; violates [ WFC: Entity Declared ] </a>
diff --git a/test/WFC/EntityDeclared3 b/test/WFC/EntityDeclared3
new file mode 100644
index 00000000..16709809
--- /dev/null
+++ b/test/WFC/EntityDeclared3
@@ -0,0 +1,3 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE a SYSTEM "a.dtd">
+<a> &unknown; violates [ WFC: Entity Declared ] </a>
diff --git a/test/WFC/EntityDeclared4 b/test/WFC/EntityDeclared4
new file mode 100644
index 00000000..15354aca
--- /dev/null
+++ b/test/WFC/EntityDeclared4
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+%unknown;
+<!ENTITY % unknown "<!ELEMENT a (#PCDATA)>">
+]>
+<a> violates [ WFC: Entity Declared ] </a>
diff --git a/test/WFC/EntityDeclared5 b/test/WFC/EntityDeclared5
new file mode 100644
index 00000000..f125373e
--- /dev/null
+++ b/test/WFC/EntityDeclared5
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE a SYSTEM "a.dtd" [
+%unknown;
+<!ENTITY % unknown "<!ELEMENT a (#PCDATA)>">
+]>
+<a> violates [ WFC: Entity Declared ] </a>
diff --git a/test/WFC/LegalCharacter b/test/WFC/LegalCharacter
new file mode 100644
index 00000000..67ff388a
--- /dev/null
+++ b/test/WFC/LegalCharacter
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<a> &#5; violates [ WFC: Legal Character ] </a>
diff --git a/test/WFC/NoExternalEntityRef b/test/WFC/NoExternalEntityRef
new file mode 100644
index 00000000..43cd192d
--- /dev/null
+++ b/test/WFC/NoExternalEntityRef
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ENTITY ext SYSTEM "ext.ent">
+]>
+<a att="wrong &ext; ref"> violates [ WFC: No External Entity References ] </a>
diff --git a/test/WFC/NoLtInAttValue b/test/WFC/NoLtInAttValue
new file mode 100644
index 00000000..cc459e91
--- /dev/null
+++ b/test/WFC/NoLtInAttValue
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ENTITY ext "no < workie">
+]>
+<a att="wrong &ext; ref"> violates [ WFC: No < in Attribute Values ] </a>
diff --git a/test/WFC/NoRecursion b/test/WFC/NoRecursion
new file mode 100644
index 00000000..970b8979
--- /dev/null
+++ b/test/WFC/NoRecursion
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY a "&b;">
+<!ENTITY b "&c;">
+<!ENTITY c "&a;">
+]>
+<doc> &a; violates [ WFC: No Recursion ] </doc>
diff --git a/test/WFC/PEintsubset b/test/WFC/PEintsubset
new file mode 100644
index 00000000..e1ea331f
--- /dev/null
+++ b/test/WFC/PEintsubset
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+<!ENTITY % pcdata "(#PCDATA)">
+<!ELEMENT e %pcdata>
+]>
+<a> violates [ WFC: PEs in Internal Subset ] </a>
diff --git a/test/WFC/UniqueAttSpec b/test/WFC/UniqueAttSpec
new file mode 100644
index 00000000..5074ff23
--- /dev/null
+++ b/test/WFC/UniqueAttSpec
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<a att="Ok" att2="Ok" att="Bad"> violates [ WFC: Unique Att Spec ] </a>
diff --git a/test/WFC/UniqueAttSpec2 b/test/WFC/UniqueAttSpec2
new file mode 100644
index 00000000..e4511f11
--- /dev/null
+++ b/test/WFC/UniqueAttSpec2
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<a> <b att="Ok" att2="Ok" att="Bad"/> violates [ WFC: Unique Att Spec ] </a>
diff --git a/test/XPath/tests/chaptersbase b/test/XPath/tests/chaptersbase
index 997d8c86..b44b2aef 100644
--- a/test/XPath/tests/chaptersbase
+++ b/test/XPath/tests/chaptersbase
@@ -1,7 +1,9 @@
-/child::head
-/child::*
-/child::head/child::title
-/child::head/child::title/child::text()
-/child::head/node()
+/child::EXAMPLE
+/child::EXAMPLE/child::*
+/child::EXAMPLE/child::head
+/child::EXAMPLE/child::*
+/child::EXAMPLE/child::head/child::title
+/child::EXAMPLE/child::head/child::title/child::text()
+/child::EXAMPLE/child::head/node()
/descendant::title
/descendant::p/ancestor::chapter
diff --git a/test/XPath/tests/simpleabbr b/test/XPath/tests/simpleabbr
index b4431229..5f885b38 100644
--- a/test/XPath/tests/simpleabbr
+++ b/test/XPath/tests/simpleabbr
@@ -1,4 +1,6 @@
-/chapter[1]
+/EXAMPLE
+/EXAMPLE/chapter
+/EXAMPLE/chapter[1]
//p
//chapter/image
//p/text()
diff --git a/test/XPath/tests/simplebase b/test/XPath/tests/simplebase
index 997d8c86..11f87223 100644
--- a/test/XPath/tests/simplebase
+++ b/test/XPath/tests/simplebase
@@ -1,7 +1,9 @@
-/child::head
-/child::*
-/child::head/child::title
-/child::head/child::title/child::text()
-/child::head/node()
+/child::EXAMPLE
+/child::EXAMPLE/child::chapter
+/child::EXAMPLE/child::head
+/child::EXAMPLE/child::*
+/child::EXAMPLE/child::head/child::title
+/child::EXAMPLE/child::head/child::title/child::text()
+/child::EXAMPLE/child::head/node()
/descendant::title
/descendant::p/ancestor::chapter
diff --git a/test/cdata b/test/cdata
new file mode 100644
index 00000000..bd8c4747
--- /dev/null
+++ b/test/cdata
@@ -0,0 +1,3 @@
+<doc>
+<![CDATA[<greeting>Hello, world!</greeting>]]>
+</doc>
diff --git a/test/dtd12 b/test/dtd12
new file mode 100644
index 00000000..033fecab
--- /dev/null
+++ b/test/dtd12
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % YN '"Yes"' >
+<!ENTITY WhatHeSaid "He said %YN;" >
+]>
+<doc>&WhatHeSaid;</doc>
diff --git a/test/dtds/eve.dtd b/test/dtds/eve.dtd
new file mode 100644
index 00000000..b1fc883f
--- /dev/null
+++ b/test/dtds/eve.dtd
@@ -0,0 +1,4 @@
+<!ENTITY % local.p.class "">
+<!ENTITY % p.class "p
+ %local.p.class;">
+
diff --git a/test/ent6 b/test/ent6
new file mode 100644
index 00000000..2c880fdc
--- /dev/null
+++ b/test/ent6
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ENTITY lt "&#38;#60;">
+<!ENTITY gt "&#62;">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY apos "&#39;">
+<!ENTITY quot "&#34;">
+]>
+<doc></doc>
diff --git a/test/ent7 b/test/ent7
new file mode 100644
index 00000000..3ef20304
--- /dev/null
+++ b/test/ent7
@@ -0,0 +1,7 @@
+<!DOCTYPE item [
+<!ENTITY % sampleEnt "<!ELEMENT item (para)+>">
+<!ENTITY sampleEnt "the hyacinth girl">
+%sampleEnt;
+<!ELEMENT para (#PCDATA)>
+]>
+<item><para>'they called me &sampleEnt;'</para></item>
diff --git a/test/errors/dtd13 b/test/errors/dtd13
new file mode 100644
index 00000000..d7658b02
--- /dev/null
+++ b/test/errors/dtd13
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY EndAttr "27'" >
+]>
+<doc>
+<element attribute='a-&EndAttr;>
+</doc>
diff --git a/test/eve.xml b/test/eve.xml
new file mode 100644
index 00000000..c6ca1c74
--- /dev/null
+++ b/test/eve.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE spec PUBLIC "-//testspec//" "dtds/eve.dtd" [
+<!ENTITY iso6.doc.date '29-May-1999'>
+]>
+<spec>
+</spec>
diff --git a/test/valid/REC-xml-19980210.xml b/test/valid/REC-xml-19980210.xml
new file mode 100644
index 00000000..4e93fb38
--- /dev/null
+++ b/test/valid/REC-xml-19980210.xml
@@ -0,0 +1,4197 @@
+<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>
+<!DOCTYPE spec SYSTEM "dtds/spec.dtd" [
+
+<!-- LAST TOUCHED BY: Tim Bray, 8 February 1997 -->
+
+<!-- The words 'FINAL EDIT' in comments mark places where changes
+need to be made after approval of the document by the ERB, before
+publication. -->
+
+<!ENTITY XML.version "1.0">
+<!ENTITY doc.date "10 February 1998">
+<!ENTITY iso6.doc.date "19980210">
+<!ENTITY w3c.doc.date "02-Feb-1998">
+<!ENTITY draft.day '10'>
+<!ENTITY draft.month 'February'>
+<!ENTITY draft.year '1998'>
+
+<!ENTITY WebSGML
+ 'WebSGML Adaptations Annex to ISO 8879'>
+
+<!ENTITY lt "<">
+<!ENTITY gt ">">
+<!ENTITY xmlpio "'&lt;?xml'">
+<!ENTITY pic "'?>'">
+<!ENTITY br "\n">
+<!ENTITY cellback '#c0d9c0'>
+<!ENTITY mdash "--"> <!-- &#x2014, but nsgmls doesn't grok hex -->
+<!ENTITY com "--">
+<!ENTITY como "--">
+<!ENTITY comc "--">
+<!ENTITY hcro "&amp;#x">
+<!-- <!ENTITY nbsp " "> -->
+<!ENTITY nbsp "&#160;">
+<!ENTITY magicents "<code>amp</code>,
+<code>lt</code>,
+<code>gt</code>,
+<code>apos</code>,
+<code>quot</code>">
+
+<!-- audience and distribution status: for use at publication time -->
+<!ENTITY doc.audience "public review and discussion">
+<!ENTITY doc.distribution "may be distributed freely, as long as
+all text and legal notices remain intact">
+
+]>
+
+<!-- for Panorama *-->
+<?VERBATIM "eg" ?>
+
+<spec>
+<header>
+<title>Extensible Markup Language (XML) 1.0</title>
+<version></version>
+<w3c-designation>REC-xml-&iso6.doc.date;</w3c-designation>
+<w3c-doctype>W3C Recommendation</w3c-doctype>
+<pubdate><day>&draft.day;</day><month>&draft.month;</month><year>&draft.year;</year></pubdate>
+
+<publoc>
+<loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;">
+http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;</loc>
+<loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.xml">
+http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.xml</loc>
+<loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.html">
+http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.html</loc>
+<loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.pdf">
+http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.pdf</loc>
+<loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.ps">
+http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.ps</loc>
+</publoc>
+<latestloc>
+<loc href="http://www.w3.org/TR/REC-xml">
+http://www.w3.org/TR/REC-xml</loc>
+</latestloc>
+<prevlocs>
+<loc href="http://www.w3.org/TR/PR-xml-971208">
+http://www.w3.org/TR/PR-xml-971208</loc>
+<!--
+<loc href='http://www.w3.org/TR/WD-xml-961114'>
+http://www.w3.org/TR/WD-xml-961114</loc>
+<loc href='http://www.w3.org/TR/WD-xml-lang-970331'>
+http://www.w3.org/TR/WD-xml-lang-970331</loc>
+<loc href='http://www.w3.org/TR/WD-xml-lang-970630'>
+http://www.w3.org/TR/WD-xml-lang-970630</loc>
+<loc href='http://www.w3.org/TR/WD-xml-970807'>
+http://www.w3.org/TR/WD-xml-970807</loc>
+<loc href='http://www.w3.org/TR/WD-xml-971117'>
+http://www.w3.org/TR/WD-xml-971117</loc>-->
+</prevlocs>
+<authlist>
+<author><name>Tim Bray</name>
+<affiliation>Textuality and Netscape</affiliation>
+<email
+href="mailto:tbray@textuality.com">tbray@textuality.com</email></author>
+<author><name>Jean Paoli</name>
+<affiliation>Microsoft</affiliation>
+<email href="mailto:jeanpa@microsoft.com">jeanpa@microsoft.com</email></author>
+<author><name>C. M. Sperberg-McQueen</name>
+<affiliation>University of Illinois at Chicago</affiliation>
+<email href="mailto:cmsmcq@uic.edu">cmsmcq@uic.edu</email></author>
+</authlist>
+<abstract>
+<p>The Extensible Markup Language (XML) is a subset of
+SGML that is completely described in this document. Its goal is to
+enable generic SGML to be served, received, and processed on the Web
+in the way that is now possible with HTML. XML has been designed for
+ease of implementation and for interoperability with both SGML and
+HTML.</p>
+</abstract>
+<status>
+<p>This document has been reviewed by W3C Members and
+other interested parties and has been endorsed by the
+Director as a W3C Recommendation. It is a stable
+document and may be used as reference material or cited
+as a normative reference from another document. W3C's
+role in making the Recommendation is to draw attention
+to the specification and to promote its widespread
+deployment. This enhances the functionality and
+interoperability of the Web.</p>
+<p>
+This document specifies a syntax created by subsetting an existing,
+widely used international text processing standard (Standard
+Generalized Markup Language, ISO 8879:1986(E) as amended and
+corrected) for use on the World Wide Web. It is a product of the W3C
+XML Activity, details of which can be found at <loc
+href='http://www.w3.org/XML'>http://www.w3.org/XML</loc>. A list of
+current W3C Recommendations and other technical documents can be found
+at <loc href='http://www.w3.org/TR'>http://www.w3.org/TR</loc>.
+</p>
+<p>This specification uses the term URI, which is defined by <bibref
+ref="Berners-Lee"/>, a work in progress expected to update <bibref
+ref="RFC1738"/> and <bibref ref="RFC1808"/>.
+</p>
+<p>The list of known errors in this specification is
+available at
+<loc href='http://www.w3.org/XML/xml-19980210-errata'>http://www.w3.org/XML/xml-19980210-errata</loc>.</p>
+<p>Please report errors in this document to
+<loc href='mailto:xml-editor@w3.org'>xml-editor@w3.org</loc>.
+</p>
+</status>
+
+
+<pubstmt>
+<p>Chicago, Vancouver, Mountain View, et al.:
+World-Wide Web Consortium, XML Working Group, 1996, 1997.</p>
+</pubstmt>
+<sourcedesc>
+<p>Created in electronic form.</p>
+</sourcedesc>
+<langusage>
+<language id='EN'>English</language>
+<language id='ebnf'>Extended Backus-Naur Form (formal grammar)</language>
+</langusage>
+<revisiondesc>
+<slist>
+<sitem>1997-12-03 : CMSMcQ : yet further changes</sitem>
+<sitem>1997-12-02 : TB : further changes (see TB to XML WG,
+2 December 1997)</sitem>
+<sitem>1997-12-02 : CMSMcQ : deal with as many corrections and
+comments from the proofreaders as possible:
+entify hard-coded document date in pubdate element,
+change expansion of entity WebSGML,
+update status description as per Dan Connolly (am not sure
+about refernece to Berners-Lee et al.),
+add 'The' to abstract as per WG decision,
+move Relationship to Existing Standards to back matter and
+combine with References,
+re-order back matter so normative appendices come first,
+re-tag back matter so informative appendices are tagged informdiv1,
+remove XXX XXX from list of 'normative' specs in prose,
+move some references from Other References to Normative References,
+add RFC 1738, 1808, and 2141 to Other References (they are not
+normative since we do not require the processor to enforce any
+rules based on them),
+add reference to 'Fielding draft' (Berners-Lee et al.),
+move notation section to end of body,
+drop URIchar non-terminal and use SkipLit instead,
+lose stray reference to defunct nonterminal 'markupdecls',
+move reference to Aho et al. into appendix (Tim's right),
+add prose note saying that hash marks and fragment identifiers are
+NOT part of the URI formally speaking, and are NOT legal in
+system identifiers (processor 'may' signal an error).
+Work through:
+Tim Bray reacting to James Clark,
+Tim Bray on his own,
+Eve Maler,
+
+NOT DONE YET:
+change binary / text to unparsed / parsed.
+handle James's suggestion about &lt; in attriubte values
+uppercase hex characters,
+namechar list,
+</sitem>
+<sitem>1997-12-01 : JB : add some column-width parameters</sitem>
+<sitem>1997-12-01 : CMSMcQ : begin round of changes to incorporate
+recent WG decisions and other corrections:
+binding sources of character encoding info (27 Aug / 3 Sept),
+correct wording of Faust quotation (restore dropped line),
+drop SDD from EncodingDecl,
+change text at version number 1.0,
+drop misleading (wrong!) sentence about ignorables and extenders,
+modify definition of PCData to make bar on msc grammatical,
+change grammar's handling of internal subset (drop non-terminal markupdecls),
+change definition of includeSect to allow conditional sections,
+add integral-declaration constraint on internal subset,
+drop misleading / dangerous sentence about relationship of
+entities with system storage objects,
+change table body tag to htbody as per EM change to DTD,
+add rule about space normalization in public identifiers,
+add description of how to generate our name-space rules from
+Unicode character database (needs further work!).
+</sitem>
+<sitem>1997-10-08 : TB : Removed %-constructs again, new rules
+for PE appearance.</sitem>
+<sitem>1997-10-01 : TB : Case-sensitive markup; cleaned up
+element-type defs, lotsa little edits for style</sitem>
+<sitem>1997-09-25 : TB : Change to elm's new DTD, with
+substantial detail cleanup as a side-effect</sitem>
+<sitem>1997-07-24 : CMSMcQ : correct error (lost *) in definition
+of ignoreSectContents (thanks to Makoto Murata)</sitem>
+<sitem>Allow all empty elements to have end-tags, consistent with
+SGML TC (as per JJC).</sitem>
+<sitem>1997-07-23 : CMSMcQ : pre-emptive strike on pending corrections:
+introduce the term 'empty-element tag', note that all empty elements
+may use it, and elements declared EMPTY must use it.
+Add WFC requiring encoding decl to come first in an entity.
+Redefine notations to point to PIs as well as binary entities.
+Change autodetection table by removing bytes 3 and 4 from
+examples with Byte Order Mark.
+Add content model as a term and clarify that it applies to both
+mixed and element content.
+</sitem>
+<sitem>1997-06-30 : CMSMcQ : change date, some cosmetic changes,
+changes to productions for choice, seq, Mixed, NotationType,
+Enumeration. Follow James Clark's suggestion and prohibit
+conditional sections in internal subset. TO DO: simplify
+production for ignored sections as a result, since we don't
+need to worry about parsers which don't expand PErefs finding
+a conditional section.</sitem>
+<sitem>1997-06-29 : TB : various edits</sitem>
+<sitem>1997-06-29 : CMSMcQ : further changes:
+Suppress old FINAL EDIT comments and some dead material.
+Revise occurrences of % in grammar to exploit Henry Thompson's pun,
+especially markupdecl and attdef.
+Remove RMD requirement relating to element content (?).
+</sitem>
+<sitem>1997-06-28 : CMSMcQ : Various changes for 1 July draft:
+Add text for draconian error handling (introduce
+the term Fatal Error).
+RE deleta est (changing wording from
+original announcement to restrict the requirement to validating
+parsers).
+Tag definition of validating processor and link to it.
+Add colon as name character.
+Change def of %operator.
+Change standard definitions of lt, gt, amp.
+Strip leading zeros from #x00nn forms.</sitem>
+<sitem>1997-04-02 : CMSMcQ : final corrections of editorial errors
+found in last night's proofreading. Reverse course once more on
+well-formed: Webster's Second hyphenates it, and that's enough
+for me.</sitem>
+<sitem>1997-04-01 : CMSMcQ : corrections from JJC, EM, HT, and self</sitem>
+<sitem>1997-03-31 : Tim Bray : many changes</sitem>
+<sitem>1997-03-29 : CMSMcQ : some Henry Thompson (on entity handling),
+some Charles Goldfarb, some ERB decisions (PE handling in miscellaneous
+declarations. Changed Ident element to accept def attribute.
+Allow normalization of Unicode characters. move def of systemliteral
+into section on literals.</sitem>
+<sitem>1997-03-28 : CMSMcQ : make as many corrections as possible, from
+Terry Allen, Norbert Mikula, James Clark, Jon Bosak, Henry Thompson,
+Paul Grosso, and self. Among other things: give in on "well formed"
+(Terry is right), tentatively rename QuotedCData as AttValue
+and Literal as EntityValue to be more informative, since attribute
+values are the <emph>only</emph> place QuotedCData was used, and
+vice versa for entity text and Literal. (I'd call it Entity Text,
+but 8879 uses that name for both internal and external entities.)</sitem>
+<sitem>1997-03-26 : CMSMcQ : resynch the two forks of this draft, reapply
+my changes dated 03-20 and 03-21. Normalize old 'may not' to 'must not'
+except in the one case where it meant 'may or may not'.</sitem>
+<sitem>1997-03-21 : TB : massive changes on plane flight from Chicago
+to Vancouver</sitem>
+<sitem>1997-03-21 : CMSMcQ : correct as many reported errors as possible.
+</sitem>
+<sitem>1997-03-20 : CMSMcQ : correct typos listed in CMSMcQ hand copy of spec.</sitem>
+<sitem>1997-03-20 : CMSMcQ : cosmetic changes preparatory to revision for
+WWW conference April 1997: restore some of the internal entity
+references (e.g. to docdate, etc.), change character xA0 to &amp;nbsp;
+and define nbsp as &amp;#160;, and refill a lot of paragraphs for
+legibility.</sitem>
+<sitem>1996-11-12 : CMSMcQ : revise using Tim's edits:
+Add list type of NUMBERED and change most lists either to
+BULLETS or to NUMBERED.
+Suppress QuotedNames, Names (not used).
+Correct trivial-grammar doc type decl.
+Rename 'marked section' as 'CDATA section' passim.
+Also edits from James Clark:
+Define the set of characters from which [^abc] subtracts.
+Charref should use just [0-9] not Digit.
+Location info needs cleaner treatment: remove? (ERB
+question).
+One example of a PI has wrong pic.
+Clarify discussion of encoding names.
+Encoding failure should lead to unspecified results; don't
+prescribe error recovery.
+Don't require exposure of entity boundaries.
+Ignore white space in element content.
+Reserve entity names of the form u-NNNN.
+Clarify relative URLs.
+And some of my own:
+Correct productions for content model: model cannot
+consist of a name, so "elements ::= cp" is no good.
+</sitem>
+<sitem>1996-11-11 : CMSMcQ : revise for style.
+Add new rhs to entity declaration, for parameter entities.</sitem>
+<sitem>1996-11-10 : CMSMcQ : revise for style.
+Fix / complete section on names, characters.
+Add sections on parameter entities, conditional sections.
+Still to do: Add compatibility note on deterministic content models.
+Finish stylistic revision.</sitem>
+<sitem>1996-10-31 : TB : Add Entity Handling section</sitem>
+<sitem>1996-10-30 : TB : Clean up term &amp; termdef. Slip in
+ERB decision re EMPTY.</sitem>
+<sitem>1996-10-28 : TB : Change DTD. Implement some of Michael's
+suggestions. Change comments back to //. Introduce language for
+XML namespace reservation. Add section on white-space handling.
+Lots more cleanup.</sitem>
+<sitem>1996-10-24 : CMSMcQ : quick tweaks, implement some ERB
+decisions. Characters are not integers. Comments are /* */ not //.
+Add bibliographic refs to 10646, HyTime, Unicode.
+Rename old Cdata as MsData since it's <emph>only</emph> seen
+in marked sections. Call them attribute-value pairs not
+name-value pairs, except once. Internal subset is optional, needs
+'?'. Implied attributes should be signaled to the app, not
+have values supplied by processor.</sitem>
+<sitem>1996-10-16 : TB : track down &amp; excise all DSD references;
+introduce some EBNF for entity declarations.</sitem>
+<sitem>1996-10-?? : TB : consistency check, fix up scraps so
+they all parse, get formatter working, correct a few productions.</sitem>
+<sitem>1996-10-10/11 : CMSMcQ : various maintenance, stylistic, and
+organizational changes:
+Replace a few literals with xmlpio and
+pic entities, to make them consistent and ensure we can change pic
+reliably when the ERB votes.
+Drop paragraph on recognizers from notation section.
+Add match, exact match to terminology.
+Move old 2.2 XML Processors and Apps into intro.
+Mention comments, PIs, and marked sections in discussion of
+delimiter escaping.
+Streamline discussion of doctype decl syntax.
+Drop old section of 'PI syntax' for doctype decl, and add
+section on partial-DTD summary PIs to end of Logical Structures
+section.
+Revise DSD syntax section to use Tim's subset-in-a-PI
+mechanism.</sitem>
+<sitem>1996-10-10 : TB : eliminate name recognizers (and more?)</sitem>
+<sitem>1996-10-09 : CMSMcQ : revise for style, consistency through 2.3
+(Characters)</sitem>
+<sitem>1996-10-09 : CMSMcQ : re-unite everything for convenience,
+at least temporarily, and revise quickly</sitem>
+<sitem>1996-10-08 : TB : first major homogenization pass</sitem>
+<sitem>1996-10-08 : TB : turn "current" attribute on div type into
+CDATA</sitem>
+<sitem>1996-10-02 : TB : remould into skeleton + entities</sitem>
+<sitem>1996-09-30 : CMSMcQ : add a few more sections prior to exchange
+ with Tim.</sitem>
+<sitem>1996-09-20 : CMSMcQ : finish transcribing notes.</sitem>
+<sitem>1996-09-19 : CMSMcQ : begin transcribing notes for draft.</sitem>
+<sitem>1996-09-13 : CMSMcQ : made outline from notes of 09-06,
+do some housekeeping</sitem>
+</slist>
+</revisiondesc>
+</header>
+<body>
+<div1 id='sec-intro'>
+<head>Introduction</head>
+<p>Extensible Markup Language, abbreviated XML, describes a class of
+data objects called <termref def="dt-xml-doc">XML documents</termref> and
+partially describes the behavior of
+computer programs which process them. XML is an application profile or
+restricted form of SGML, the Standard Generalized Markup
+Language <bibref ref='ISO8879'/>.
+By construction, XML documents
+are conforming SGML documents.
+</p>
+<p>XML documents are made up of storage units called <termref
+def="dt-entity">entities</termref>, which contain either parsed
+or unparsed data.
+Parsed data is made up of <termref def="dt-character">characters</termref>,
+some
+of which form <termref def="dt-chardata">character data</termref>,
+and some of which form <termref def="dt-markup">markup</termref>.
+Markup encodes a description of the document's storage layout and
+logical structure. XML provides a mechanism to impose constraints on
+the storage layout and logical structure.</p>
+<p><termdef id="dt-xml-proc" term="XML Processor">A software module
+called an <term>XML processor</term> is used to read XML documents
+and provide access to their content and structure.</termdef> <termdef
+id="dt-app" term="Application">It is assumed that an XML processor is
+doing its work on behalf of another module, called the
+<term>application</term>.</termdef> This specification describes the
+required behavior of an XML processor in terms of how it must read XML
+data and the information it must provide to the application.</p>
+
+<div2 id='sec-origin-goals'>
+<head>Origin and Goals</head>
+<p>XML was developed by an XML Working Group (originally known as the
+SGML Editorial Review Board) formed under the auspices of the World
+Wide Web Consortium (W3C) in 1996.
+It was chaired by Jon Bosak of Sun
+Microsystems with the active participation of an XML Special
+Interest Group (previously known as the SGML Working Group) also
+organized by the W3C. The membership of the XML Working Group is given
+in an appendix. Dan Connolly served as the WG's contact with the W3C.
+</p>
+<p>The design goals for XML are:<olist>
+<item><p>XML shall be straightforwardly usable over the
+Internet.</p></item>
+<item><p>XML shall support a wide variety of applications.</p></item>
+<item><p>XML shall be compatible with SGML.</p></item>
+<item><p>It shall be easy to write programs which process XML
+documents.</p></item>
+<item><p>The number of optional features in XML is to be kept to the
+absolute minimum, ideally zero.</p></item>
+<item><p>XML documents should be human-legible and reasonably
+clear.</p></item>
+<item><p>The XML design should be prepared quickly.</p></item>
+<item><p>The design of XML shall be formal and concise.</p></item>
+<item><p>XML documents shall be easy to create.</p></item>
+<item><p>Terseness in XML markup is of minimal importance.</p></item></olist>
+</p>
+<p>This specification,
+together with associated standards
+(Unicode and ISO/IEC 10646 for characters,
+Internet RFC 1766 for language identification tags,
+ISO 639 for language name codes, and
+ISO 3166 for country name codes),
+provides all the information necessary to understand
+XML Version &XML.version;
+and construct computer programs to process it.</p>
+<p>This version of the XML specification
+<!-- is for &doc.audience;.-->
+&doc.distribution;.</p>
+
+</div2>
+
+
+
+
+<div2 id='sec-terminology'>
+<head>Terminology</head>
+
+<p>The terminology used to describe XML documents is defined in the body of
+this specification.
+The terms defined in the following list are used in building those
+definitions and in describing the actions of an XML processor:
+<glist>
+<gitem>
+<label>may</label>
+<def><p><termdef id="dt-may" term="May">Conforming documents and XML
+processors are permitted to but need not behave as
+described.</termdef></p></def>
+</gitem>
+<gitem>
+<label>must</label>
+<def><p>Conforming documents and XML processors
+are required to behave as described; otherwise they are in error.
+<!-- do NOT change this! this is what defines a violation of
+a 'must' clause as 'an error'. -MSM -->
+</p></def>
+</gitem>
+<gitem>
+<label>error</label>
+<def><p><termdef id='dt-error' term='Error'
+>A violation of the rules of this
+specification; results are
+undefined. Conforming software may detect and report an error and may
+recover from it.</termdef></p></def>
+</gitem>
+<gitem>
+<label>fatal error</label>
+<def><p><termdef id="dt-fatal" term="Fatal Error">An error
+which a conforming <termref def="dt-xml-proc">XML processor</termref>
+must detect and report to the application.
+After encountering a fatal error, the
+processor may continue
+processing the data to search for further errors and may report such
+errors to the application. In order to support correction of errors,
+the processor may make unprocessed data from the document (with
+intermingled character data and markup) available to the application.
+Once a fatal error is detected, however, the processor must not
+continue normal processing (i.e., it must not
+continue to pass character data and information about the document's
+logical structure to the application in the normal way).
+</termdef></p></def>
+</gitem>
+<gitem>
+<label>at user option</label>
+<def><p>Conforming software may or must (depending on the modal verb in the
+sentence) behave as described; if it does, it must
+provide users a means to enable or disable the behavior
+described.</p></def>
+</gitem>
+<gitem>
+<label>validity constraint</label>
+<def><p>A rule which applies to all
+<termref def="dt-valid">valid</termref> XML documents.
+Violations of validity constraints are errors; they must, at user option,
+be reported by
+<termref def="dt-validating">validating XML processors</termref>.</p></def>
+</gitem>
+<gitem>
+<label>well-formedness constraint</label>
+<def><p>A rule which applies to all <termref
+def="dt-wellformed">well-formed</termref> XML documents.
+Violations of well-formedness constraints are
+<termref def="dt-fatal">fatal errors</termref>.</p></def>
+</gitem>
+
+<gitem>
+<label>match</label>
+<def><p><termdef id="dt-match" term="match">(Of strings or names:)
+Two strings or names being compared must be identical.
+Characters with multiple possible representations in ISO/IEC 10646 (e.g.
+characters with
+both precomposed and base+diacritic forms) match only if they have the
+same representation in both strings.
+At user option, processors may normalize such characters to
+some canonical form.
+No case folding is performed.
+(Of strings and rules in the grammar:)
+A string matches a grammatical production if it belongs to the
+language generated by that production.
+(Of content and content models:)
+An element matches its declaration when it conforms
+in the fashion described in the constraint
+<specref ref='elementvalid'/>.
+</termdef>
+</p></def>
+</gitem>
+<gitem>
+<label>for compatibility</label>
+<def><p><termdef id="dt-compat" term="For Compatibility">A feature of
+XML included solely to ensure that XML remains compatible with SGML.
+</termdef></p></def>
+</gitem>
+<gitem>
+<label>for interoperability</label>
+<def><p><termdef id="dt-interop" term="For interoperability">A
+non-binding recommendation included to increase the chances that XML
+documents can be processed by the existing installed base of SGML
+processors which predate the
+&WebSGML;.</termdef></p></def>
+</gitem>
+</glist>
+</p>
+</div2>
+
+
+</div1>
+<!-- &Docs; -->
+
+<div1 id='sec-documents'>
+<head>Documents</head>
+
+<p><termdef id="dt-xml-doc" term="XML Document">
+A data object is an
+<term>XML document</term> if it is
+<termref def="dt-wellformed">well-formed</termref>, as
+defined in this specification.
+A well-formed XML document may in addition be
+<termref def="dt-valid">valid</termref> if it meets certain further
+constraints.</termdef></p>
+
+<p>Each XML document has both a logical and a physical structure.
+Physically, the document is composed of units called <termref
+def="dt-entity">entities</termref>. An entity may <termref
+def="dt-entref">refer</termref> to other entities to cause their
+inclusion in the document. A document begins in a "root" or <termref
+def="dt-docent">document entity</termref>.
+Logically, the document is composed of declarations, elements,
+comments,
+character references, and
+processing
+instructions, all of which are indicated in the document by explicit
+markup.
+The logical and physical structures must nest properly, as described
+in <specref ref='wf-entities'/>.
+</p>
+
+<div2 id='sec-well-formed'>
+<head>Well-Formed XML Documents</head>
+
+<p><termdef id="dt-wellformed" term="Well-Formed">
+A textual object is
+a well-formed XML document if:</termdef>
+<olist>
+<item><p>Taken as a whole, it
+matches the production labeled <nt def='NT-document'>document</nt>.</p></item>
+<item><p>It
+meets all the well-formedness constraints given in this specification.</p>
+</item>
+<item><p>Each of the <termref def='dt-parsedent'>parsed entities</termref>
+which is referenced directly or indirectly within the document is
+<titleref href='wf-entities'>well-formed</titleref>.</p></item>
+</olist></p>
+<p>
+<scrap lang='ebnf' id='document'>
+<head>Document</head>
+<prod id='NT-document'><lhs>document</lhs>
+<rhs><nt def='NT-prolog'>prolog</nt>
+<nt def='NT-element'>element</nt>
+<nt def='NT-Misc'>Misc</nt>*</rhs></prod>
+</scrap>
+</p>
+<p>Matching the <nt def="NT-document">document</nt> production
+implies that:
+<olist>
+<item><p>It contains one or more
+<termref def="dt-element">elements</termref>.</p>
+</item>
+<!--* N.B. some readers (notably JC) find the following
+paragraph awkward and redundant. I agree it's logically redundant:
+it *says* it is summarizing the logical implications of
+matching the grammar, and that means by definition it's
+logically redundant. I don't think it's rhetorically
+redundant or unnecessary, though, so I'm keeping it. It
+could however use some recasting when the editors are feeling
+stronger. -MSM *-->
+<item><p><termdef id="dt-root" term="Root Element">There is exactly
+one element, called the <term>root</term>, or document element, no
+part of which appears in the <termref
+def="dt-content">content</termref> of any other element.</termdef>
+For all other elements, if the start-tag is in the content of another
+element, the end-tag is in the content of the same element. More
+simply stated, the elements, delimited by start- and end-tags, nest
+properly within each other.
+</p></item>
+</olist>
+</p>
+<p><termdef id="dt-parentchild" term="Parent/Child">As a consequence
+of this,
+for each non-root element
+<code>C</code> in the document, there is one other element <code>P</code>
+in the document such that
+<code>C</code> is in the content of <code>P</code>, but is not in
+the content of any other element that is in the content of
+<code>P</code>.
+<code>P</code> is referred to as the
+<term>parent</term> of <code>C</code>, and <code>C</code> as a
+<term>child</term> of <code>P</code>.</termdef></p></div2>
+
+<div2 id="charsets">
+<head>Characters</head>
+
+<p><termdef id="dt-text" term="Text">A parsed entity contains
+<term>text</term>, a sequence of
+<termref def="dt-character">characters</termref>,
+which may represent markup or character data.</termdef>
+<termdef id="dt-character" term="Character">A <term>character</term>
+is an atomic unit of text as specified by
+ISO/IEC 10646 <bibref ref="ISO10646"/>.
+Legal characters are tab, carriage return, line feed, and the legal
+graphic characters of Unicode and ISO/IEC 10646.
+The use of "compatibility characters", as defined in section 6.8
+of <bibref ref='Unicode'/>, is discouraged.
+</termdef>
+<scrap lang="ebnf" id="char32">
+<head>Character Range</head>
+<prodgroup pcw2="4" pcw4="17.5" pcw5="11">
+<prod id="NT-Char"><lhs>Char</lhs>
+<rhs>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
+| [#x10000-#x10FFFF]</rhs>
+<com>any Unicode character, excluding the
+surrogate blocks, FFFE, and FFFF.</com> </prod>
+</prodgroup>
+</scrap>
+</p>
+
+<p>The mechanism for encoding character code points into bit patterns may
+vary from entity to entity. All XML processors must accept the UTF-8
+and UTF-16 encodings of 10646; the mechanisms for signaling which of
+the two is in use, or for bringing other encodings into play, are
+discussed later, in <specref ref='charencoding'/>.
+</p>
+<!--
+<p>Regardless of the specific encoding used, any character in the ISO/IEC
+10646 character set may be referred to by the decimal or hexadecimal
+equivalent of its
+UCS-4 code value.
+</p>-->
+</div2>
+
+<div2 id='sec-common-syn'>
+<head>Common Syntactic Constructs</head>
+
+<p>This section defines some symbols used widely in the grammar.</p>
+<p><nt def="NT-S">S</nt> (white space) consists of one or more space (#x20)
+characters, carriage returns, line feeds, or tabs.
+
+<scrap lang="ebnf" id='white'>
+<head>White Space</head>
+<prodgroup pcw2="4" pcw4="17.5" pcw5="11">
+<prod id='NT-S'><lhs>S</lhs>
+<rhs>(#x20 | #x9 | #xD | #xA)+</rhs>
+</prod>
+</prodgroup>
+</scrap></p>
+<p>Characters are classified for convenience as letters, digits, or other
+characters. Letters consist of an alphabetic or syllabic
+base character possibly
+followed by one or more combining characters, or of an ideographic
+character.
+Full definitions of the specific characters in each class
+are given in <specref ref='CharClasses'/>.</p>
+<p><termdef id="dt-name" term="Name">A <term>Name</term> is a token
+beginning with a letter or one of a few punctuation characters, and continuing
+with letters, digits, hyphens, underscores, colons, or full stops, together
+known as name characters.</termdef>
+Names beginning with the string "<code>xml</code>", or any string
+which would match <code>(('X'|'x') ('M'|'m') ('L'|'l'))</code>, are
+reserved for standardization in this or future versions of this
+specification.
+</p>
+<note>
+<p>The colon character within XML names is reserved for experimentation with
+name spaces.
+Its meaning is expected to be
+standardized at some future point, at which point those documents
+using the colon for experimental purposes may need to be updated.
+(There is no guarantee that any name-space mechanism
+adopted for XML will in fact use the colon as a name-space delimiter.)
+In practice, this means that authors should not use the colon in XML
+names except as part of name-space experiments, but that XML processors
+should accept the colon as a name character.</p>
+</note>
+<p>An
+<nt def='NT-Nmtoken'>Nmtoken</nt> (name token) is any mixture of
+name characters.
+<scrap lang='ebnf'>
+<head>Names and Tokens</head>
+<prod id='NT-NameChar'><lhs>NameChar</lhs>
+<rhs><nt def="NT-Letter">Letter</nt>
+| <nt def='NT-Digit'>Digit</nt>
+| '.' | '-' | '_' | ':'
+| <nt def='NT-CombiningChar'>CombiningChar</nt>
+| <nt def='NT-Extender'>Extender</nt></rhs>
+</prod>
+<prod id='NT-Name'><lhs>Name</lhs>
+<rhs>(<nt def='NT-Letter'>Letter</nt> | '_' | ':')
+(<nt def='NT-NameChar'>NameChar</nt>)*</rhs></prod>
+<prod id='NT-Names'><lhs>Names</lhs>
+<rhs><nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>)*</rhs></prod>
+<prod id='NT-Nmtoken'><lhs>Nmtoken</lhs>
+<rhs>(<nt def='NT-NameChar'>NameChar</nt>)+</rhs></prod>
+<prod id='NT-Nmtokens'><lhs>Nmtokens</lhs>
+<rhs><nt def='NT-Nmtoken'>Nmtoken</nt> (<nt def='NT-S'>S</nt> <nt def='NT-Nmtoken'>Nmtoken</nt>)*</rhs></prod>
+</scrap>
+</p>
+<p>Literal data is any quoted string not containing
+the quotation mark used as a delimiter for that string.
+Literals are used
+for specifying the content of internal entities
+(<nt def='NT-EntityValue'>EntityValue</nt>),
+the values of attributes (<nt def='NT-AttValue'>AttValue</nt>),
+and external identifiers
+(<nt def="NT-SystemLiteral">SystemLiteral</nt>).
+Note that a <nt def='NT-SystemLiteral'>SystemLiteral</nt>
+can be parsed without scanning for markup.
+<scrap lang='ebnf'>
+<head>Literals</head>
+<prod id='NT-EntityValue'><lhs>EntityValue</lhs>
+<rhs>'"'
+([^%&amp;"]
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+'"'
+</rhs>
+<rhs>|&nbsp;
+"'"
+([^%&amp;']
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+"'"</rhs>
+</prod>
+<prod id='NT-AttValue'><lhs>AttValue</lhs>
+<rhs>'"'
+([^&lt;&amp;"]
+| <nt def='NT-Reference'>Reference</nt>)*
+'"'
+</rhs>
+<rhs>|&nbsp;
+"'"
+([^&lt;&amp;']
+| <nt def='NT-Reference'>Reference</nt>)*
+"'"</rhs>
+</prod>
+<prod id="NT-SystemLiteral"><lhs>SystemLiteral</lhs>
+<rhs>('"' [^"]* '"') |&nbsp;("'" [^']* "'")
+</rhs>
+</prod>
+<prod id="NT-PubidLiteral"><lhs>PubidLiteral</lhs>
+<rhs>'"' <nt def='NT-PubidChar'>PubidChar</nt>*
+'"'
+| "'" (<nt def='NT-PubidChar'>PubidChar</nt> - "'")* "'"</rhs>
+</prod>
+<prod id="NT-PubidChar"><lhs>PubidChar</lhs>
+<rhs>#x20 | #xD | #xA
+|&nbsp;[a-zA-Z0-9]
+|&nbsp;[-'()+,./:=?;!*#@$_%]</rhs>
+</prod>
+</scrap>
+</p>
+
+</div2>
+
+<div2 id='syntax'>
+<head>Character Data and Markup</head>
+
+<p><termref def='dt-text'>Text</termref> consists of intermingled
+<termref def="dt-chardata">character
+data</termref> and markup.
+<termdef id="dt-markup" term="Markup"><term>Markup</term> takes the form of
+<termref def="dt-stag">start-tags</termref>,
+<termref def="dt-etag">end-tags</termref>,
+<termref def="dt-empty">empty-element tags</termref>,
+<termref def="dt-entref">entity references</termref>,
+<termref def="dt-charref">character references</termref>,
+<termref def="dt-comment">comments</termref>,
+<termref def="dt-cdsection">CDATA section</termref> delimiters,
+<termref def="dt-doctype">document type declarations</termref>, and
+<termref def="dt-pi">processing instructions</termref>.
+</termdef>
+</p>
+<p><termdef id="dt-chardata" term="Character Data">All text that is not markup
+constitutes the <term>character data</term> of
+the document.</termdef></p>
+<p>The ampersand character (&amp;) and the left angle bracket (&lt;)
+may appear in their literal form <emph>only</emph> when used as markup
+delimiters, or within a <termref def="dt-comment">comment</termref>, a
+<termref def="dt-pi">processing instruction</termref>,
+or a <termref def="dt-cdsection">CDATA section</termref>.
+
+They are also legal within the <termref def='dt-litentval'>literal entity
+value</termref> of an internal entity declaration; see
+<specref ref='wf-entities'/>.
+<!-- FINAL EDIT: restore internal entity decl or leave it out. -->
+If they are needed elsewhere,
+they must be <termref def="dt-escape">escaped</termref>
+using either <termref def='dt-charref'>numeric character references</termref>
+or the strings
+"<code>&amp;amp;</code>" and "<code>&amp;lt;</code>" respectively.
+The right angle
+bracket (>) may be represented using the string
+"<code>&amp;gt;</code>", and must, <termref def='dt-compat'>for
+compatibility</termref>,
+be escaped using
+"<code>&amp;gt;</code>" or a character reference
+when it appears in the string
+"<code>]]&gt;</code>"
+in content,
+when that string is not marking the end of
+a <termref def="dt-cdsection">CDATA section</termref>.
+</p>
+<p>
+In the content of elements, character data
+is any string of characters which does
+not contain the start-delimiter of any markup.
+In a CDATA section, character data
+is any string of characters not including the CDATA-section-close
+delimiter, "<code>]]&gt;</code>".</p>
+<p>
+To allow attribute values to contain both single and double quotes, the
+apostrophe or single-quote character (') may be represented as
+"<code>&amp;apos;</code>", and the double-quote character (") as
+"<code>&amp;quot;</code>".
+<scrap lang="ebnf">
+<head>Character Data</head>
+<prod id='NT-CharData'>
+<lhs>CharData</lhs>
+<rhs>[^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)</rhs>
+</prod>
+</scrap>
+</p>
+</div2>
+
+<div2 id='sec-comments'>
+<head>Comments</head>
+
+<p><termdef id="dt-comment" term="Comment"><term>Comments</term> may
+appear anywhere in a document outside other
+<termref def='dt-markup'>markup</termref>; in addition,
+they may appear within the document type declaration
+at places allowed by the grammar.
+They are not part of the document's <termref def="dt-chardata">character
+data</termref>; an XML
+processor may, but need not, make it possible for an application to
+retrieve the text of comments.
+<termref def="dt-compat">For compatibility</termref>, the string
+"<code>--</code>" (double-hyphen) must not occur within
+comments.
+<scrap lang="ebnf">
+<head>Comments</head>
+<prod id='NT-Comment'><lhs>Comment</lhs>
+<rhs>'&lt;!--'
+((<nt def='NT-Char'>Char</nt> - '-')
+| ('-' (<nt def='NT-Char'>Char</nt> - '-')))*
+'-->'</rhs>
+</prod>
+</scrap>
+</termdef></p>
+<p>An example of a comment:
+<eg>&lt;!&como; declarations for &lt;head> &amp; &lt;body> &comc;&gt;</eg>
+</p>
+</div2>
+
+<div2 id='sec-pi'>
+<head>Processing Instructions</head>
+
+<p><termdef id="dt-pi" term="Processing instruction"><term>Processing
+instructions</term> (PIs) allow documents to contain instructions
+for applications.
+
+<scrap lang="ebnf">
+<head>Processing Instructions</head>
+<prod id='NT-PI'><lhs>PI</lhs>
+<rhs>'&lt;?' <nt def='NT-PITarget'>PITarget</nt>
+(<nt def='NT-S'>S</nt>
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*)))?
+&pic;</rhs></prod>
+<prod id='NT-PITarget'><lhs>PITarget</lhs>
+<rhs><nt def='NT-Name'>Name</nt> -
+(('X' | 'x') ('M' | 'm') ('L' | 'l'))</rhs>
+</prod>
+</scrap></termdef>
+PIs are not part of the document's <termref def="dt-chardata">character
+data</termref>, but must be passed through to the application. The
+PI begins with a target (<nt def='NT-PITarget'>PITarget</nt>) used
+to identify the application to which the instruction is directed.
+The target names "<code>XML</code>", "<code>xml</code>", and so on are
+reserved for standardization in this or future versions of this
+specification.
+The
+XML <termref def='dt-notation'>Notation</termref> mechanism
+may be used for
+formal declaration of PI targets.
+</p>
+</div2>
+
+<div2 id='sec-cdata-sect'>
+<head>CDATA Sections</head>
+
+<p><termdef id="dt-cdsection" term="CDATA Section"><term>CDATA sections</term>
+may occur
+anywhere character data may occur; they are
+used to escape blocks of text containing characters which would
+otherwise be recognized as markup. CDATA sections begin with the
+string "<code>&lt;![CDATA[</code>" and end with the string
+"<code>]]&gt;</code>":
+<scrap lang="ebnf">
+<head>CDATA Sections</head>
+<prod id='NT-CDSect'><lhs>CDSect</lhs>
+<rhs><nt def='NT-CDStart'>CDStart</nt>
+<nt def='NT-CData'>CData</nt>
+<nt def='NT-CDEnd'>CDEnd</nt></rhs></prod>
+<prod id='NT-CDStart'><lhs>CDStart</lhs>
+<rhs>'&lt;![CDATA['</rhs>
+</prod>
+<prod id='NT-CData'><lhs>CData</lhs>
+<rhs>(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-Char'>Char</nt>*))
+</rhs>
+</prod>
+<prod id='NT-CDEnd'><lhs>CDEnd</lhs>
+<rhs>']]&gt;'</rhs>
+</prod>
+</scrap>
+
+Within a CDATA section, only the <nt def='NT-CDEnd'>CDEnd</nt> string is
+recognized as markup, so that left angle brackets and ampersands may occur in
+their literal form; they need not (and cannot) be escaped using
+"<code>&amp;lt;</code>" and "<code>&amp;amp;</code>". CDATA sections
+cannot nest.</termdef>
+</p>
+
+<p>An example of a CDATA section, in which "<code>&lt;greeting></code>" and
+"<code>&lt;/greeting></code>"
+are recognized as <termref def='dt-chardata'>character data</termref>, not
+<termref def='dt-markup'>markup</termref>:
+<eg>&lt;![CDATA[&lt;greeting>Hello, world!&lt;/greeting>]]&gt;</eg>
+</p>
+</div2>
+
+<div2 id='sec-prolog-dtd'>
+<head>Prolog and Document Type Declaration</head>
+
+<p><termdef id='dt-xmldecl' term='XML Declaration'>XML documents
+may, and should,
+begin with an <term>XML declaration</term> which specifies
+the version of
+XML being used.</termdef>
+For example, the following is a complete XML document, <termref
+def="dt-wellformed">well-formed</termref> but not
+<termref def="dt-valid">valid</termref>:
+<eg><![CDATA[<?xml version="1.0"?>
+<greeting>Hello, world!</greeting>
+]]></eg>
+and so is this:
+<eg><![CDATA[<greeting>Hello, world!</greeting>
+]]></eg>
+</p>
+
+<p>The version number "<code>1.0</code>" should be used to indicate
+conformance to this version of this specification; it is an error
+for a document to use the value "<code>1.0</code>"
+if it does not conform to this version of this specification.
+It is the intent
+of the XML working group to give later versions of this specification
+numbers other than "<code>1.0</code>", but this intent does not
+indicate a
+commitment to produce any future versions of XML, nor if any are produced, to
+use any particular numbering scheme.
+Since future versions are not ruled out, this construct is provided
+as a means to allow the possibility of automatic version recognition, should
+it become necessary.
+Processors may signal an error if they receive documents labeled with
+versions they do not support.
+</p>
+<p>The function of the markup in an XML document is to describe its
+storage and logical structure and to associate attribute-value pairs
+with its logical structures. XML provides a mechanism, the <termref
+def="dt-doctype">document type declaration</termref>, to define
+constraints on the logical structure and to support the use of
+predefined storage units.
+
+<termdef id="dt-valid" term="Validity">An XML document is
+<term>valid</term> if it has an associated document type
+declaration and if the document
+complies with the constraints expressed in it.</termdef></p>
+<p>The document type declaration must appear before
+the first <termref def="dt-element">element</termref> in the document.
+<scrap lang="ebnf" id='xmldoc'>
+<head>Prolog</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-prolog'><lhs>prolog</lhs>
+<rhs><nt def='NT-XMLDecl'>XMLDecl</nt>?
+<nt def='NT-Misc'>Misc</nt>*
+(<nt def='NT-doctypedecl'>doctypedecl</nt>
+<nt def='NT-Misc'>Misc</nt>*)?</rhs></prod>
+<prod id='NT-XMLDecl'><lhs>XMLDecl</lhs>
+<rhs>&xmlpio;
+<nt def='NT-VersionInfo'>VersionInfo</nt>
+<nt def='NT-EncodingDecl'>EncodingDecl</nt>?
+<nt def='NT-SDDecl'>SDDecl</nt>?
+<nt def="NT-S">S</nt>?
+&pic;</rhs>
+</prod>
+<prod id='NT-VersionInfo'><lhs>VersionInfo</lhs>
+<rhs><nt def="NT-S">S</nt> 'version' <nt def='NT-Eq'>Eq</nt>
+(' <nt def="NT-VersionNum">VersionNum</nt> '
+| " <nt def="NT-VersionNum">VersionNum</nt> ")</rhs>
+</prod>
+<prod id='NT-Eq'><lhs>Eq</lhs>
+<rhs><nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>?</rhs></prod>
+<prod id="NT-VersionNum">
+<lhs>VersionNum</lhs>
+<rhs>([a-zA-Z0-9_.:] | '-')+</rhs>
+</prod>
+<prod id='NT-Misc'><lhs>Misc</lhs>
+<rhs><nt def='NT-Comment'>Comment</nt> | <nt def='NT-PI'>PI</nt> |
+<nt def='NT-S'>S</nt></rhs></prod>
+</prodgroup>
+</scrap></p>
+
+<p><termdef id="dt-doctype" term="Document Type Declaration">The XML
+<term>document type declaration</term>
+contains or points to
+<termref def='dt-markupdecl'>markup declarations</termref>
+that provide a grammar for a
+class of documents.
+This grammar is known as a document type definition,
+or <term>DTD</term>.
+The document type declaration can point to an external subset (a
+special kind of
+<termref def='dt-extent'>external entity</termref>) containing markup
+declarations, or can
+contain the markup declarations directly in an internal subset, or can do
+both.
+The DTD for a document consists of both subsets taken
+together.</termdef>
+</p>
+<p><termdef id="dt-markupdecl" term="markup declaration">
+A <term>markup declaration</term> is
+an <termref def="dt-eldecl">element type declaration</termref>,
+an <termref def="dt-attdecl">attribute-list declaration</termref>,
+an <termref def="dt-entdecl">entity declaration</termref>, or
+a <termref def="dt-notdecl">notation declaration</termref>.
+</termdef>
+These declarations may be contained in whole or in part
+within <termref def='dt-PE'>parameter entities</termref>,
+as described in the well-formedness and validity constraints below.
+For fuller information, see
+<specref ref="sec-physical-struct"/>.</p>
+<scrap lang="ebnf" id='dtd'>
+<head>Document Type Definition</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-doctypedecl'><lhs>doctypedecl</lhs>
+<rhs>'&lt;!DOCTYPE' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt>
+<nt def='NT-ExternalID'>ExternalID</nt>)?
+<nt def='NT-S'>S</nt>? ('['
+(<nt def='NT-markupdecl'>markupdecl</nt>
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-S'>S</nt>)*
+']'
+<nt def='NT-S'>S</nt>?)? '>'</rhs>
+<vc def="vc-roottype"/>
+</prod>
+<prod id='NT-markupdecl'><lhs>markupdecl</lhs>
+<rhs><nt def='NT-elementdecl'>elementdecl</nt>
+| <nt def='NT-AttlistDecl'>AttlistDecl</nt>
+| <nt def='NT-EntityDecl'>EntityDecl</nt>
+| <nt def='NT-NotationDecl'>NotationDecl</nt>
+| <nt def='NT-PI'>PI</nt>
+| <nt def='NT-Comment'>Comment</nt>
+</rhs>
+<vc def='vc-PEinMarkupDecl'/>
+<wfc def="wfc-PEinInternalSubset"/>
+</prod>
+
+</prodgroup>
+</scrap>
+
+<p>The markup declarations may be made up in whole or in part of
+the <termref def='dt-repltext'>replacement text</termref> of
+<termref def='dt-PE'>parameter entities</termref>.
+The productions later in this specification for
+individual nonterminals (<nt def='NT-elementdecl'>elementdecl</nt>,
+<nt def='NT-AttlistDecl'>AttlistDecl</nt>, and so on) describe
+the declarations <emph>after</emph> all the parameter entities have been
+<termref def='dt-include'>included</termref>.</p>
+
+<vcnote id="vc-roottype">
+<head>Root Element Type</head>
+<p>
+The <nt def='NT-Name'>Name</nt> in the document type declaration must
+match the element type of the <termref def='dt-root'>root element</termref>.
+</p>
+</vcnote>
+
+<vcnote id='vc-PEinMarkupDecl'>
+<head>Proper Declaration/PE Nesting</head>
+<p>Parameter-entity
+<termref def='dt-repltext'>replacement text</termref> must be properly nested
+with markup declarations.
+That is to say, if either the first character
+or the last character of a markup
+declaration (<nt def='NT-markupdecl'>markupdecl</nt> above)
+is contained in the replacement text for a
+<termref def='dt-PERef'>parameter-entity reference</termref>,
+both must be contained in the same replacement text.</p>
+</vcnote>
+<wfcnote id="wfc-PEinInternalSubset">
+<head>PEs in Internal Subset</head>
+<p>In the internal DTD subset,
+<termref def='dt-PERef'>parameter-entity references</termref>
+can occur only where markup declarations can occur, not
+within markup declarations. (This does not apply to
+references that occur in
+external parameter entities or to the external subset.)
+</p>
+</wfcnote>
+<p>
+Like the internal subset, the external subset and
+any external parameter entities referred to in the DTD
+must consist of a series of complete markup declarations of the types
+allowed by the non-terminal symbol
+<nt def="NT-markupdecl">markupdecl</nt>, interspersed with white space
+or <termref def="dt-PERef">parameter-entity references</termref>.
+However, portions of the contents
+of the
+external subset or of external parameter entities may conditionally be ignored
+by using
+the <termref def="dt-cond-section">conditional section</termref>
+construct; this is not allowed in the internal subset.
+
+<scrap id="ext-Subset">
+<head>External Subset</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-extSubset'><lhs>extSubset</lhs>
+<rhs><nt def='NT-TextDecl'>TextDecl</nt>?
+<nt def='NT-extSubsetDecl'>extSubsetDecl</nt></rhs></prod>
+<prod id='NT-extSubsetDecl'><lhs>extSubsetDecl</lhs>
+<rhs>(
+<nt def='NT-markupdecl'>markupdecl</nt>
+| <nt def='NT-conditionalSect'>conditionalSect</nt>
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-S'>S</nt>
+)*</rhs>
+</prod>
+</prodgroup>
+</scrap></p>
+<p>The external subset and external parameter entities also differ
+from the internal subset in that in them,
+<termref def="dt-PERef">parameter-entity references</termref>
+are permitted <emph>within</emph> markup declarations,
+not only <emph>between</emph> markup declarations.</p>
+<p>An example of an XML document with a document type declaration:
+<eg><![CDATA[<?xml version="1.0"?>
+<!DOCTYPE greeting SYSTEM "hello.dtd">
+<greeting>Hello, world!</greeting>
+]]></eg>
+The <termref def="dt-sysid">system identifier</termref>
+"<code>hello.dtd</code>" gives the URI of a DTD for the document.</p>
+<p>The declarations can also be given locally, as in this
+example:
+<eg><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE greeting [
+ <!ELEMENT greeting (#PCDATA)>
+]>
+<greeting>Hello, world!</greeting>
+]]></eg>
+If both the external and internal subsets are used, the
+internal subset is considered to occur before the external subset.
+<!-- 'is considered to'? boo. whazzat mean? -->
+This has the effect that entity and attribute-list declarations in the
+internal subset take precedence over those in the external subset.
+</p>
+</div2>
+
+<div2 id='sec-rmd'>
+<head>Standalone Document Declaration</head>
+<p>Markup declarations can affect the content of the document,
+as passed from an <termref def="dt-xml-proc">XML processor</termref>
+to an application; examples are attribute defaults and entity
+declarations.
+The standalone document declaration,
+which may appear as a component of the XML declaration, signals
+whether or not there are such declarations which appear external to
+the <termref def='dt-docent'>document entity</termref>.
+<scrap lang="ebnf" id='fulldtd'>
+<head>Standalone Document Declaration</head>
+<prodgroup pcw2="4" pcw4="19.5" pcw5="9">
+<prod id='NT-SDDecl'><lhs>SDDecl</lhs>
+<rhs>
+<nt def="NT-S">S</nt>
+'standalone' <nt def='NT-Eq'>Eq</nt>
+(("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
+</rhs>
+<vc def='vc-check-rmd'/></prod>
+</prodgroup>
+</scrap></p>
+<p>
+In a standalone document declaration, the value "<code>yes</code>" indicates
+that there
+are no markup declarations external to the <termref def='dt-docent'>document
+entity</termref> (either in the DTD external subset, or in an
+external parameter entity referenced from the internal subset)
+which affect the information passed from the XML processor to
+the application.
+The value "<code>no</code>" indicates that there are or may be such
+external markup declarations.
+Note that the standalone document declaration only
+denotes the presence of external <emph>declarations</emph>; the presence, in a
+document, of
+references to external <emph>entities</emph>, when those entities are
+internally declared,
+does not change its standalone status.</p>
+<p>If there are no external markup declarations, the standalone document
+declaration has no meaning.
+If there are external markup declarations but there is no standalone
+document declaration, the value "<code>no</code>" is assumed.</p>
+<p>Any XML document for which <code>standalone="no"</code> holds can
+be converted algorithmically to a standalone document,
+which may be desirable for some network delivery applications.</p>
+<vcnote id='vc-check-rmd'>
+<head>Standalone Document Declaration</head>
+<p>The standalone document declaration must have
+the value "<code>no</code>" if any external markup declarations
+contain declarations of:</p><ulist>
+<item><p>attributes with <termref def="dt-default">default</termref> values, if
+elements to which
+these attributes apply appear in the document without
+specifications of values for these attributes, or</p></item>
+<item><p>entities (other than &magicents;),
+if <termref def="dt-entref">references</termref> to those
+entities appear in the document, or</p>
+</item>
+<item><p>attributes with values subject to
+<titleref href='AVNormalize'>normalization</titleref>, where the
+attribute appears in the document with a value which will
+change as a result of normalization, or</p>
+</item>
+<item>
+<p>element types with <termref def="dt-elemcontent">element content</termref>,
+if white space occurs
+directly within any instance of those types.
+</p></item>
+</ulist>
+
+</vcnote>
+<p>An example XML declaration with a standalone document declaration:<eg
+>&lt;?xml version="&XML.version;" standalone='yes'?></eg></p>
+</div2>
+<div2 id='sec-white-space'>
+<head>White Space Handling</head>
+
+<p>In editing XML documents, it is often convenient to use "white space"
+(spaces, tabs, and blank lines, denoted by the nonterminal
+<nt def='NT-S'>S</nt> in this specification) to
+set apart the markup for greater readability. Such white space is typically
+not intended for inclusion in the delivered version of the document.
+On the other hand, "significant" white space that should be preserved in the
+delivered version is common, for example in poetry and
+source code.</p>
+<p>An <termref def='dt-xml-proc'>XML processor</termref>
+must always pass all characters in a document that are not
+markup through to the application. A <termref def='dt-validating'>
+validating XML processor</termref> must also inform the application
+which of these characters constitute white space appearing
+in <termref def="dt-elemcontent">element content</termref>.
+</p>
+<p>A special <termref def='dt-attr'>attribute</termref>
+named <kw>xml:space</kw> may be attached to an element
+to signal an intention that in that element,
+white space should be preserved by applications.
+In valid documents, this attribute, like any other, must be
+<termref def="dt-attdecl">declared</termref> if it is used.
+When declared, it must be given as an
+<termref def='dt-enumerated'>enumerated type</termref> whose only
+possible values are "<code>default</code>" and "<code>preserve</code>".
+For example:<eg><![CDATA[ <!ATTLIST poem xml:space (default|preserve) 'preserve'>]]></eg></p>
+<p>The value "<code>default</code>" signals that applications'
+default white-space processing modes are acceptable for this element; the
+value "<code>preserve</code>" indicates the intent that applications preserve
+all the white space.
+This declared intent is considered to apply to all elements within the content
+of the element where it is specified, unless overriden with another instance
+of the <kw>xml:space</kw> attribute.
+</p>
+<p>The <termref def='dt-root'>root element</termref> of any document
+is considered to have signaled no intentions as regards application space
+handling, unless it provides a value for
+this attribute or the attribute is declared with a default value.
+</p>
+
+</div2>
+<div2 id='sec-line-ends'>
+<head>End-of-Line Handling</head>
+<p>XML <termref def='dt-parsedent'>parsed entities</termref> are often stored in
+computer files which, for editing convenience, are organized into lines.
+These lines are typically separated by some combination of the characters
+carriage-return (#xD) and line-feed (#xA).</p>
+<p>To simplify the tasks of <termref def='dt-app'>applications</termref>,
+wherever an external parsed entity or the literal entity value
+of an internal parsed entity contains either the literal
+two-character sequence "#xD#xA" or a standalone literal
+#xD, an <termref def='dt-xml-proc'>XML processor</termref> must
+pass to the application the single character #xA.
+(This behavior can
+conveniently be produced by normalizing all
+line breaks to #xA on input, before parsing.)
+</p>
+</div2>
+<div2 id='sec-lang-tag'>
+<head>Language Identification</head>
+<p>In document processing, it is often useful to
+identify the natural or formal language
+in which the content is
+written.
+A special <termref def="dt-attr">attribute</termref> named
+<kw>xml:lang</kw> may be inserted in
+documents to specify the
+language used in the contents and attribute values
+of any element in an XML document.
+In valid documents, this attribute, like any other, must be
+<termref def="dt-attdecl">declared</termref> if it is used.
+The values of the attribute are language identifiers as defined
+by <bibref ref="RFC1766"/>, "Tags for the Identification of Languages":
+<scrap lang='ebnf'>
+<head>Language Identification</head>
+<prod id='NT-LanguageID'><lhs>LanguageID</lhs>
+<rhs><nt def='NT-Langcode'>Langcode</nt>
+('-' <nt def='NT-Subcode'>Subcode</nt>)*</rhs></prod>
+<prod id='NT-Langcode'><lhs>Langcode</lhs>
+<rhs><nt def='NT-ISO639Code'>ISO639Code</nt> |
+<nt def='NT-IanaCode'>IanaCode</nt> |
+<nt def='NT-UserCode'>UserCode</nt></rhs>
+</prod>
+<prod id='NT-ISO639Code'><lhs>ISO639Code</lhs>
+<rhs>([a-z] | [A-Z]) ([a-z] | [A-Z])</rhs></prod>
+<prod id='NT-IanaCode'><lhs>IanaCode</lhs>
+<rhs>('i' | 'I') '-' ([a-z] | [A-Z])+</rhs></prod>
+<prod id='NT-UserCode'><lhs>UserCode</lhs>
+<rhs>('x' | 'X') '-' ([a-z] | [A-Z])+</rhs></prod>
+<prod id='NT-Subcode'><lhs>Subcode</lhs>
+<rhs>([a-z] | [A-Z])+</rhs></prod>
+</scrap>
+The <nt def='NT-Langcode'>Langcode</nt> may be any of the following:
+<ulist>
+<item><p>a two-letter language code as defined by
+<bibref ref="ISO639"/>, "Codes
+for the representation of names of languages"</p></item>
+<item><p>a language identifier registered with the Internet
+Assigned Numbers Authority <bibref ref='IANA'/>; these begin with the
+prefix "<code>i-</code>" (or "<code>I-</code>")</p></item>
+<item><p>a language identifier assigned by the user, or agreed on
+between parties in private use; these must begin with the
+prefix "<code>x-</code>" or "<code>X-</code>" in order to ensure that they do not conflict
+with names later standardized or registered with IANA</p></item>
+</ulist></p>
+<p>There may be any number of <nt def='NT-Subcode'>Subcode</nt> segments; if
+the first
+subcode segment exists and the Subcode consists of two
+letters, then it must be a country code from
+<bibref ref="ISO3166"/>, "Codes
+for the representation of names of countries."
+If the first
+subcode consists of more than two letters, it must be
+a subcode for the language in question registered with IANA,
+unless the <nt def='NT-Langcode'>Langcode</nt> begins with the prefix
+"<code>x-</code>" or
+"<code>X-</code>". </p>
+<p>It is customary to give the language code in lower case, and
+the country code (if any) in upper case.
+Note that these values, unlike other names in XML documents,
+are case insensitive.</p>
+<p>For example:
+<eg><![CDATA[<p xml:lang="en">The quick brown fox jumps over the lazy dog.</p>
+<p xml:lang="en-GB">What colour is it?</p>
+<p xml:lang="en-US">What color is it?</p>
+<sp who="Faust" desc='leise' xml:lang="de">
+ <l>Habe nun, ach! Philosophie,</l>
+ <l>Juristerei, und Medizin</l>
+ <l>und leider auch Theologie</l>
+ <l>durchaus studiert mit heißem Bemüh'n.</l>
+ </sp>]]></eg></p>
+<!--<p>The xml:lang value is considered to apply both to the contents of an
+element and
+(unless otherwise via attribute default values) to the
+values of all of its attributes with free-text (CDATA) values. -->
+<p>The intent declared with <kw>xml:lang</kw> is considered to apply to
+all attributes and content of the element where it is specified,
+unless overridden with an instance of <kw>xml:lang</kw>
+on another element within that content.</p>
+<!--
+If no
+value is specified for xml:lang on an element, and no default value is
+defined for it in the DTD, then the xml:lang attribute of any element
+takes the same value it has in the parent element, if any. The two
+technical terms in the following example both have the same effective
+value for xml:lang:
+
+ <p xml:lang="en">Here the keywords are
+ <term xml:lang="en">shift</term> and
+ <term>reduce</term>. ...</p>
+
+The application, not the XML processor, is responsible for this '
+inheritance' of attribute values.
+-->
+<p>A simple declaration for <kw>xml:lang</kw> might take
+the form
+<eg>xml:lang NMTOKEN #IMPLIED</eg>
+but specific default values may also be given, if appropriate. In a
+collection of French poems for English students, with glosses and
+notes in English, the xml:lang attribute might be declared this way:
+<eg><![CDATA[ <!ATTLIST poem xml:lang NMTOKEN 'fr'>
+ <!ATTLIST gloss xml:lang NMTOKEN 'en'>
+ <!ATTLIST note xml:lang NMTOKEN 'en'>]]></eg>
+</p>
+
+</div2>
+</div1>
+<!-- &Elements; -->
+
+<div1 id='sec-logical-struct'>
+<head>Logical Structures</head>
+
+<p><termdef id="dt-element" term="Element">Each <termref
+def="dt-xml-doc">XML document</termref> contains one or more
+<term>elements</term>, the boundaries of which are
+either delimited by <termref def="dt-stag">start-tags</termref>
+and <termref def="dt-etag">end-tags</termref>, or, for <termref
+def="dt-empty">empty</termref> elements, by an <termref
+def="dt-eetag">empty-element tag</termref>. Each element has a type,
+identified by name, sometimes called its "generic
+identifier" (GI), and may have a set of
+attribute specifications.</termdef> Each attribute specification
+has a <termref
+def="dt-attrname">name</termref> and a <termref
+def="dt-attrval">value</termref>.
+</p>
+<scrap lang='ebnf'><head>Element</head>
+<prod id='NT-element'><lhs>element</lhs>
+<rhs><nt def='NT-EmptyElemTag'>EmptyElemTag</nt></rhs>
+<rhs>| <nt def='NT-STag'>STag</nt> <nt def='NT-content'>content</nt>
+<nt def='NT-ETag'>ETag</nt></rhs>
+<wfc def='GIMatch'/>
+<vc def='elementvalid'/>
+</prod>
+</scrap>
+<p>This specification does not constrain the semantics, use, or (beyond
+syntax) names of the element types and attributes, except that names
+beginning with a match to <code>(('X'|'x')('M'|'m')('L'|'l'))</code>
+are reserved for standardization in this or future versions of this
+specification.
+</p>
+<wfcnote id='GIMatch'>
+<head>Element Type Match</head>
+<p>
+The <nt def='NT-Name'>Name</nt> in an element's end-tag must match
+the element type in
+the start-tag.
+</p>
+</wfcnote>
+<vcnote id='elementvalid'>
+<head>Element Valid</head>
+<p>An element is
+valid if
+there is a declaration matching
+<nt def='NT-elementdecl'>elementdecl</nt> where the
+<nt def='NT-Name'>Name</nt> matches the element type, and
+one of the following holds:</p>
+<olist>
+<item><p>The declaration matches <kw>EMPTY</kw> and the element has no
+<termref def='dt-content'>content</termref>.</p></item>
+<item><p>The declaration matches <nt def='NT-children'>children</nt> and
+the sequence of
+<termref def="dt-parentchild">child elements</termref>
+belongs to the language generated by the regular expression in
+the content model, with optional white space (characters
+matching the nonterminal <nt def='NT-S'>S</nt>) between each pair
+of child elements.</p></item>
+<item><p>The declaration matches <nt def='NT-Mixed'>Mixed</nt> and
+the content consists of <termref def='dt-chardata'>character
+data</termref> and <termref def='dt-parentchild'>child elements</termref>
+whose types match names in the content model.</p></item>
+<item><p>The declaration matches <kw>ANY</kw>, and the types
+of any <termref def='dt-parentchild'>child elements</termref> have
+been declared.</p></item>
+</olist>
+</vcnote>
+
+<div2 id='sec-starttags'>
+<head>Start-Tags, End-Tags, and Empty-Element Tags</head>
+
+<p><termdef id="dt-stag" term="Start-Tag">The beginning of every
+non-empty XML element is marked by a <term>start-tag</term>.
+<scrap lang='ebnf'>
+<head>Start-tag</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5">
+<prod id='NT-STag'><lhs>STag</lhs>
+<rhs>'&lt;' <nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt> <nt def='NT-Attribute'>Attribute</nt>)*
+<nt def='NT-S'>S</nt>? '>'</rhs>
+<wfc def="uniqattspec"/>
+</prod>
+<prod id='NT-Attribute'><lhs>Attribute</lhs>
+<rhs><nt def='NT-Name'>Name</nt> <nt def='NT-Eq'>Eq</nt>
+<nt def='NT-AttValue'>AttValue</nt></rhs>
+<vc def='ValueType'/>
+<wfc def='NoExternalRefs'/>
+<wfc def='CleanAttrVals'/></prod>
+</prodgroup>
+</scrap>
+The <nt def='NT-Name'>Name</nt> in
+the start- and end-tags gives the
+element's <term>type</term>.</termdef>
+<termdef id="dt-attr" term="Attribute">
+The <nt def='NT-Name'>Name</nt>-<nt def='NT-AttValue'>AttValue</nt> pairs are
+referred to as
+the <term>attribute specifications</term> of the element</termdef>,
+<termdef id="dt-attrname" term="Attribute Name">with the
+<nt def='NT-Name'>Name</nt> in each pair
+referred to as the <term>attribute name</term></termdef> and
+<termdef id="dt-attrval" term="Attribute Value">the content of the
+<nt def='NT-AttValue'>AttValue</nt> (the text between the
+<code>'</code> or <code>"</code> delimiters)
+as the <term>attribute value</term>.</termdef>
+</p>
+<wfcnote id='uniqattspec'>
+<head>Unique Att Spec</head>
+<p>
+No attribute name may appear more than once in the same start-tag
+or empty-element tag.
+</p>
+</wfcnote>
+<vcnote id='ValueType'>
+<head>Attribute Value Type</head>
+<p>
+The attribute must have been declared; the value must be of the type
+declared for it.
+(For attribute types, see <specref ref='attdecls'/>.)
+</p>
+</vcnote>
+<wfcnote id='NoExternalRefs'>
+<head>No External Entity References</head>
+<p>
+Attribute values cannot contain direct or indirect entity references
+to external entities.
+</p>
+</wfcnote>
+<wfcnote id='CleanAttrVals'>
+<head>No <code>&lt;</code> in Attribute Values</head>
+<p>The <termref def='dt-repltext'>replacement text</termref> of any entity
+referred to directly or indirectly in an attribute
+value (other than "<code>&amp;lt;</code>") must not contain
+a <code>&lt;</code>.
+</p></wfcnote>
+<p>An example of a start-tag:
+<eg>&lt;termdef id="dt-dog" term="dog"></eg></p>
+<p><termdef id="dt-etag" term="End Tag">The end of every element
+that begins with a start-tag must
+be marked by an <term>end-tag</term>
+containing a name that echoes the element's type as given in the
+start-tag:
+<scrap lang='ebnf'>
+<head>End-tag</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5">
+<prod id='NT-ETag'><lhs>ETag</lhs>
+<rhs>'&lt;/' <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>? '>'</rhs></prod>
+</prodgroup>
+</scrap>
+</termdef></p>
+<p>An example of an end-tag:<eg>&lt;/termdef></eg></p>
+<p><termdef id="dt-content" term="Content">The
+<termref def='dt-text'>text</termref> between the start-tag and
+end-tag is called the element's
+<term>content</term>:
+<scrap lang='ebnf'>
+<head>Content of Elements</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5">
+<prod id='NT-content'><lhs>content</lhs>
+<rhs>(<nt def='NT-element'>element</nt> | <nt def='NT-CharData'>CharData</nt>
+| <nt def='NT-Reference'>Reference</nt> | <nt def='NT-CDSect'>CDSect</nt>
+| <nt def='NT-PI'>PI</nt> | <nt def='NT-Comment'>Comment</nt>)*</rhs>
+</prod>
+</prodgroup>
+</scrap>
+</termdef></p>
+<p><termdef id="dt-empty" term="Empty">If an element is <term>empty</term>,
+it must be represented either by a start-tag immediately followed
+by an end-tag or by an empty-element tag.</termdef>
+<termdef id="dt-eetag" term="empty-element tag">An
+<term>empty-element tag</term> takes a special form:
+<scrap lang='ebnf'>
+<head>Tags for Empty Elements</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5">
+<prod id='NT-EmptyElemTag'><lhs>EmptyElemTag</lhs>
+<rhs>'&lt;' <nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt>
+<nt def='NT-Attribute'>Attribute</nt>)* <nt def='NT-S'>S</nt>?
+'/&gt;'</rhs>
+<wfc def="uniqattspec"/>
+</prod>
+</prodgroup>
+</scrap>
+</termdef></p>
+<p>Empty-element tags may be used for any element which has no
+content, whether or not it is declared using the keyword
+<kw>EMPTY</kw>.
+<termref def='dt-interop'>For interoperability</termref>, the empty-element
+tag must be used, and can only be used, for elements which are
+<termref def='dt-eldecl'>declared</termref> <kw>EMPTY</kw>.</p>
+<p>Examples of empty elements:
+<eg>&lt;IMG align="left"
+ src="http://www.w3.org/Icons/WWW/w3c_home" />
+&lt;br>&lt;/br>
+&lt;br/></eg></p>
+</div2>
+
+<div2 id='elemdecls'>
+<head>Element Type Declarations</head>
+
+<p>The <termref def="dt-element">element</termref> structure of an
+<termref def="dt-xml-doc">XML document</termref> may, for
+<termref def="dt-valid">validation</termref> purposes,
+be constrained
+using element type and attribute-list declarations.
+An element type declaration constrains the element's
+<termref def="dt-content">content</termref>.
+</p>
+
+<p>Element type declarations often constrain which element types can
+appear as <termref def="dt-parentchild">children</termref> of the element.
+At user option, an XML processor may issue a warning
+when a declaration mentions an element type for which no declaration
+is provided, but this is not an error.</p>
+<p><termdef id="dt-eldecl" term="Element Type declaration">An <term>element
+type declaration</term> takes the form:
+<scrap lang='ebnf'>
+<head>Element Type Declaration</head>
+<prodgroup pcw2="5.5" pcw4="18" pcw5="9">
+<prod id='NT-elementdecl'><lhs>elementdecl</lhs>
+<rhs>'&lt;!ELEMENT' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>
+<nt def='NT-contentspec'>contentspec</nt>
+<nt def='NT-S'>S</nt>? '>'</rhs>
+<vc def='EDUnique'/></prod>
+<prod id='NT-contentspec'><lhs>contentspec</lhs>
+<rhs>'EMPTY'
+| 'ANY'
+| <nt def='NT-Mixed'>Mixed</nt>
+| <nt def='NT-children'>children</nt>
+</rhs>
+</prod>
+</prodgroup>
+</scrap>
+where the <nt def='NT-Name'>Name</nt> gives the element type
+being declared.</termdef>
+</p>
+
+<vcnote id='EDUnique'>
+<head>Unique Element Type Declaration</head>
+<p>
+No element type may be declared more than once.
+</p>
+</vcnote>
+
+<p>Examples of element type declarations:
+<eg>&lt;!ELEMENT br EMPTY>
+&lt;!ELEMENT p (#PCDATA|emph)* >
+&lt;!ELEMENT %name.para; %content.para; >
+&lt;!ELEMENT container ANY></eg></p>
+
+<div3 id='sec-element-content'>
+<head>Element Content</head>
+
+<p><termdef id='dt-elemcontent' term='Element content'>An element <termref
+def="dt-stag">type</termref> has
+<term>element content</term> when elements of that
+type must contain only <termref def='dt-parentchild'>child</termref>
+elements (no character data), optionally separated by
+white space (characters matching the nonterminal
+<nt def='NT-S'>S</nt>).
+</termdef>
+In this case, the
+constraint includes a content model, a simple grammar governing
+the allowed types of the child
+elements and the order in which they are allowed to appear.
+The grammar is built on
+content particles (<nt def='NT-cp'>cp</nt>s), which consist of names,
+choice lists of content particles, or
+sequence lists of content particles:
+<scrap lang='ebnf'>
+<head>Element-content Models</head>
+<prodgroup pcw2="5.5" pcw4="16" pcw5="11">
+<prod id='NT-children'><lhs>children</lhs>
+<rhs>(<nt def='NT-choice'>choice</nt>
+| <nt def='NT-seq'>seq</nt>)
+('?' | '*' | '+')?</rhs></prod>
+<prod id='NT-cp'><lhs>cp</lhs>
+<rhs>(<nt def='NT-Name'>Name</nt>
+| <nt def='NT-choice'>choice</nt>
+| <nt def='NT-seq'>seq</nt>)
+('?' | '*' | '+')?</rhs></prod>
+<prod id='NT-choice'><lhs>choice</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>? cp
+( <nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*
+<nt def='NT-S'>S</nt>? ')'</rhs>
+<vc def='vc-PEinGroup'/></prod>
+<prod id='NT-seq'><lhs>seq</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>? cp
+( <nt def='NT-S'>S</nt>? ',' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*
+<nt def='NT-S'>S</nt>? ')'</rhs>
+<vc def='vc-PEinGroup'/></prod>
+
+</prodgroup>
+</scrap>
+where each <nt def='NT-Name'>Name</nt> is the type of an element which may
+appear as a <termref def="dt-parentchild">child</termref>.
+Any content
+particle in a choice list may appear in the <termref
+def="dt-elemcontent">element content</termref> at the location where
+the choice list appears in the grammar;
+content particles occurring in a sequence list must each
+appear in the <termref def="dt-elemcontent">element content</termref> in the
+order given in the list.
+The optional character following a name or list governs
+whether the element or the content particles in the list may occur one
+or more (<code>+</code>), zero or more (<code>*</code>), or zero or
+one times (<code>?</code>).
+The absence of such an operator means that the element or content particle
+must appear exactly once.
+This syntax
+and meaning are identical to those used in the productions in this
+specification.</p>
+<p>
+The content of an element matches a content model if and only if it is
+possible to trace out a path through the content model, obeying the
+sequence, choice, and repetition operators and matching each element in
+the content against an element type in the content model. <termref
+def='dt-compat'>For compatibility</termref>, it is an error
+if an element in the document can
+match more than one occurrence of an element type in the content model.
+For more information, see <specref ref="determinism"/>.
+<!-- appendix <specref ref="determinism"/>. -->
+<!-- appendix on deterministic content models. -->
+</p>
+<vcnote id='vc-PEinGroup'>
+<head>Proper Group/PE Nesting</head>
+<p>Parameter-entity
+<termref def='dt-repltext'>replacement text</termref> must be properly nested
+with parenthetized groups.
+That is to say, if either of the opening or closing parentheses
+in a <nt def='NT-choice'>choice</nt>, <nt def='NT-seq'>seq</nt>, or
+<nt def='NT-Mixed'>Mixed</nt> construct
+is contained in the replacement text for a
+<termref def='dt-PERef'>parameter entity</termref>,
+both must be contained in the same replacement text.</p>
+<p><termref def='dt-interop'>For interoperability</termref>,
+if a parameter-entity reference appears in a
+<nt def='NT-choice'>choice</nt>, <nt def='NT-seq'>seq</nt>, or
+<nt def='NT-Mixed'>Mixed</nt> construct, its replacement text
+should not be empty, and
+neither the first nor last non-blank
+character of the replacement text should be a connector
+(<code>|</code> or <code>,</code>).
+</p>
+</vcnote>
+<p>Examples of element-content models:
+<eg>&lt;!ELEMENT spec (front, body, back?)>
+&lt;!ELEMENT div1 (head, (p | list | note)*, div2*)>
+&lt;!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*></eg></p>
+</div3>
+
+<div3 id='sec-mixed-content'>
+<head>Mixed Content</head>
+
+<p><termdef id='dt-mixed' term='Mixed Content'>An element
+<termref def='dt-stag'>type</termref> has
+<term>mixed content</term> when elements of that type may contain
+character data, optionally interspersed with
+<termref def="dt-parentchild">child</termref> elements.</termdef>
+In this case, the types of the child elements
+may be constrained, but not their order or their number of occurrences:
+<scrap lang='ebnf'>
+<head>Mixed-content Declaration</head>
+<prodgroup pcw2="5.5" pcw4="16" pcw5="11">
+<prod id='NT-Mixed'><lhs>Mixed</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>?
+'#PCDATA'
+(<nt def='NT-S'>S</nt>?
+'|'
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Name'>Name</nt>)*
+<nt def='NT-S'>S</nt>?
+')*' </rhs>
+<rhs>| '(' <nt def='NT-S'>S</nt>? '#PCDATA' <nt def='NT-S'>S</nt>? ')'
+</rhs><vc def='vc-PEinGroup'/>
+<vc def='vc-MixedChildrenUnique'/>
+</prod>
+
+</prodgroup>
+</scrap>
+where the <nt def='NT-Name'>Name</nt>s give the types of elements
+that may appear as children.
+</p>
+<vcnote id='vc-MixedChildrenUnique'>
+<head>No Duplicate Types</head>
+<p>The same name must not appear more than once in a single mixed-content
+declaration.
+</p></vcnote>
+<p>Examples of mixed content declarations:
+<eg>&lt;!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
+&lt;!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
+&lt;!ELEMENT b (#PCDATA)></eg></p>
+</div3>
+</div2>
+
+<div2 id='attdecls'>
+<head>Attribute-List Declarations</head>
+
+<p><termref def="dt-attr">Attributes</termref> are used to associate
+name-value pairs with <termref def="dt-element">elements</termref>.
+Attribute specifications may appear only within <termref
+def="dt-stag">start-tags</termref>
+and <termref def="dt-eetag">empty-element tags</termref>;
+thus, the productions used to
+recognize them appear in <specref ref='sec-starttags'/>.
+Attribute-list
+declarations may be used:
+<ulist>
+<item><p>To define the set of attributes pertaining to a given
+element type.</p></item>
+<item><p>To establish type constraints for these
+attributes.</p></item>
+<item><p>To provide <termref def="dt-default">default values</termref>
+for attributes.</p></item>
+</ulist>
+</p>
+<p><termdef id="dt-attdecl" term="Attribute-List Declaration">
+<term>Attribute-list declarations</term> specify the name, data type, and default
+value (if any) of each attribute associated with a given element type:
+<scrap lang='ebnf'>
+<head>Attribute-list Declaration</head>
+<prod id='NT-AttlistDecl'><lhs>AttlistDecl</lhs>
+<rhs>'&lt;!ATTLIST' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-AttDef'>AttDef</nt>*
+<nt def='NT-S'>S</nt>? '&gt;'</rhs>
+</prod>
+<prod id='NT-AttDef'><lhs>AttDef</lhs>
+<rhs><nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-AttType'>AttType</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-DefaultDecl'>DefaultDecl</nt></rhs>
+</prod>
+</scrap>
+The <nt def="NT-Name">Name</nt> in the
+<nt def='NT-AttlistDecl'>AttlistDecl</nt> rule is the type of an element. At
+user option, an XML processor may issue a warning if attributes are
+declared for an element type not itself declared, but this is not an
+error. The <nt def='NT-Name'>Name</nt> in the
+<nt def='NT-AttDef'>AttDef</nt> rule is
+the name of the attribute.</termdef></p>
+<p>
+When more than one <nt def='NT-AttlistDecl'>AttlistDecl</nt> is provided for a
+given element type, the contents of all those provided are merged. When
+more than one definition is provided for the same attribute of a
+given element type, the first declaration is binding and later
+declarations are ignored.
+<termref def='dt-interop'>For interoperability,</termref> writers of DTDs
+may choose to provide at most one attribute-list declaration
+for a given element type, at most one attribute definition
+for a given attribute name, and at least one attribute definition
+in each attribute-list declaration.
+For interoperability, an XML processor may at user option
+issue a warning when more than one attribute-list declaration is
+provided for a given element type, or more than one attribute definition
+is provided
+for a given attribute, but this is not an error.
+</p>
+
+<div3 id='sec-attribute-types'>
+<head>Attribute Types</head>
+
+<p>XML attribute types are of three kinds: a string type, a
+set of tokenized types, and enumerated types. The string type may take
+any literal string as a value; the tokenized types have varying lexical
+and semantic constraints, as noted:
+<scrap lang='ebnf'>
+<head>Attribute Types</head>
+<prodgroup pcw4="14" pcw5="11.5">
+<prod id='NT-AttType'><lhs>AttType</lhs>
+<rhs><nt def='NT-StringType'>StringType</nt>
+| <nt def='NT-TokenizedType'>TokenizedType</nt>
+| <nt def='NT-EnumeratedType'>EnumeratedType</nt>
+</rhs>
+</prod>
+<prod id='NT-StringType'><lhs>StringType</lhs>
+<rhs>'CDATA'</rhs>
+</prod>
+<prod id='NT-TokenizedType'><lhs>TokenizedType</lhs>
+<rhs>'ID'</rhs>
+<vc def='id'/>
+<vc def='one-id-per-el'/>
+<vc def='id-default'/>
+<rhs>| 'IDREF'</rhs>
+<vc def='idref'/>
+<rhs>| 'IDREFS'</rhs>
+<vc def='idref'/>
+<rhs>| 'ENTITY'</rhs>
+<vc def='entname'/>
+<rhs>| 'ENTITIES'</rhs>
+<vc def='entname'/>
+<rhs>| 'NMTOKEN'</rhs>
+<vc def='nmtok'/>
+<rhs>| 'NMTOKENS'</rhs>
+<vc def='nmtok'/></prod>
+</prodgroup>
+</scrap>
+</p>
+<vcnote id='id' >
+<head>ID</head>
+<p>
+Values of type <kw>ID</kw> must match the
+<nt def='NT-Name'>Name</nt> production.
+A name must not appear more than once in
+an XML document as a value of this type; i.e., ID values must uniquely
+identify the elements which bear them.
+</p>
+</vcnote>
+<vcnote id='one-id-per-el'>
+<head>One ID per Element Type</head>
+<p>No element type may have more than one ID attribute specified.</p>
+</vcnote>
+<vcnote id='id-default'>
+<head>ID Attribute Default</head>
+<p>An ID attribute must have a declared default of <kw>#IMPLIED</kw> or
+<kw>#REQUIRED</kw>.</p>
+</vcnote>
+<vcnote id='idref'>
+<head>IDREF</head>
+<p>
+Values of type <kw>IDREF</kw> must match
+the <nt def="NT-Name">Name</nt> production, and
+values of type <kw>IDREFS</kw> must match
+<nt def="NT-Names">Names</nt>;
+each <nt def='NT-Name'>Name</nt> must match the value of an ID attribute on
+some element in the XML document; i.e. <kw>IDREF</kw> values must
+match the value of some ID attribute.
+</p>
+</vcnote>
+<vcnote id='entname'>
+<head>Entity Name</head>
+<p>
+Values of type <kw>ENTITY</kw>
+must match the <nt def="NT-Name">Name</nt> production,
+values of type <kw>ENTITIES</kw> must match
+<nt def="NT-Names">Names</nt>;
+each <nt def="NT-Name">Name</nt> must
+match the
+name of an <termref def="dt-unparsed">unparsed entity</termref> declared in the
+<termref def="dt-doctype">DTD</termref>.
+</p>
+</vcnote>
+<vcnote id='nmtok'>
+<head>Name Token</head>
+<p>
+Values of type <kw>NMTOKEN</kw> must match the
+<nt def="NT-Nmtoken">Nmtoken</nt> production;
+values of type <kw>NMTOKENS</kw> must
+match <termref def="NT-Nmtokens">Nmtokens</termref>.
+</p>
+</vcnote>
+<!-- why?
+<p>The XML processor must normalize attribute values before
+passing them to the application, as described in
+<specref ref="AVNormalize"/>.</p>-->
+<p><termdef id='dt-enumerated' term='Enumerated Attribute
+Values'><term>Enumerated attributes</term> can take one
+of a list of values provided in the declaration</termdef>. There are two
+kinds of enumerated types:
+<scrap lang='ebnf'>
+<head>Enumerated Attribute Types</head>
+<prod id='NT-EnumeratedType'><lhs>EnumeratedType</lhs>
+<rhs><nt def='NT-NotationType'>NotationType</nt>
+| <nt def='NT-Enumeration'>Enumeration</nt>
+</rhs></prod>
+<prod id='NT-NotationType'><lhs>NotationType</lhs>
+<rhs>'NOTATION'
+<nt def='NT-S'>S</nt>
+'('
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>?
+<nt def='NT-Name'>Name</nt>)*
+<nt def='NT-S'>S</nt>? ')'
+</rhs>
+<vc def='notatn' /></prod>
+<prod id='NT-Enumeration'><lhs>Enumeration</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>?
+<nt def='NT-Nmtoken'>Nmtoken</nt>
+(<nt def='NT-S'>S</nt>? '|'
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Nmtoken'>Nmtoken</nt>)*
+<nt def='NT-S'>S</nt>?
+')'</rhs>
+<vc def='enum'/></prod>
+</scrap>
+A <kw>NOTATION</kw> attribute identifies a
+<termref def='dt-notation'>notation</termref>, declared in the
+DTD with associated system and/or public identifiers, to
+be used in interpreting the element to which the attribute
+is attached.
+</p>
+
+<vcnote id='notatn'>
+<head>Notation Attributes</head>
+<p>
+Values of this type must match
+one of the <titleref href='Notations'>notation</titleref> names included in
+the declaration; all notation names in the declaration must
+be declared.
+</p>
+</vcnote>
+<vcnote id='enum'>
+<head>Enumeration</head>
+<p>
+Values of this type
+must match one of the <nt def='NT-Nmtoken'>Nmtoken</nt> tokens in the
+declaration.
+</p>
+</vcnote>
+<p><termref def='dt-interop'>For interoperability,</termref> the same
+<nt def='NT-Nmtoken'>Nmtoken</nt> should not occur more than once in the
+enumerated attribute types of a single element type.
+</p>
+</div3>
+
+<div3 id='sec-attr-defaults'>
+<head>Attribute Defaults</head>
+
+<p>An <termref def="dt-attdecl">attribute declaration</termref> provides
+information on whether
+the attribute's presence is required, and if not, how an XML processor should
+react if a declared attribute is absent in a document.
+<scrap lang='ebnf'>
+<head>Attribute Defaults</head>
+<prodgroup pcw4="14" pcw5="11.5">
+<prod id='NT-DefaultDecl'><lhs>DefaultDecl</lhs>
+<rhs>'#REQUIRED'
+|&nbsp;'#IMPLIED' </rhs>
+<rhs>| (('#FIXED' S)? <nt def='NT-AttValue'>AttValue</nt>)</rhs>
+<vc def='RequiredAttr'/>
+<vc def='defattrvalid'/>
+<wfc def="CleanAttrVals"/>
+<vc def='FixedAttr'/>
+</prod>
+</prodgroup>
+</scrap>
+
+</p>
+<p>In an attribute declaration, <kw>#REQUIRED</kw> means that the
+attribute must always be provided, <kw>#IMPLIED</kw> that no default
+value is provided.
+<!-- not any more!!
+<kw>#IMPLIED</kw> means that if the attribute is omitted
+from an element of this type,
+the XML processor must inform the application
+that no value was specified; no constraint is placed on the behavior
+of the application. -->
+<termdef id="dt-default" term="Attribute Default">If the
+declaration
+is neither <kw>#REQUIRED</kw> nor <kw>#IMPLIED</kw>, then the
+<nt def='NT-AttValue'>AttValue</nt> value contains the declared
+<term>default</term> value; the <kw>#FIXED</kw> keyword states that
+the attribute must always have the default value.
+If a default value
+is declared, when an XML processor encounters an omitted attribute, it
+is to behave as though the attribute were present with
+the declared default value.</termdef></p>
+<vcnote id='RequiredAttr'>
+<head>Required Attribute</head>
+<p>If the default declaration is the keyword <kw>#REQUIRED</kw>, then
+the attribute must be specified for
+all elements of the type in the attribute-list declaration.
+</p></vcnote>
+<vcnote id='defattrvalid'>
+<head>Attribute Default Legal</head>
+<p>
+The declared
+default value must meet the lexical constraints of the declared attribute type.
+</p>
+</vcnote>
+<vcnote id='FixedAttr'>
+<head>Fixed Attribute Default</head>
+<p>If an attribute has a default value declared with the
+<kw>#FIXED</kw> keyword, instances of that attribute must
+match the default value.
+</p></vcnote>
+
+<p>Examples of attribute-list declarations:
+<eg>&lt;!ATTLIST termdef
+ id ID #REQUIRED
+ name CDATA #IMPLIED>
+&lt;!ATTLIST list
+ type (bullets|ordered|glossary) "ordered">
+&lt;!ATTLIST form
+ method CDATA #FIXED "POST"></eg></p>
+</div3>
+<div3 id='AVNormalize'>
+<head>Attribute-Value Normalization</head>
+<p>Before the value of an attribute is passed to the application
+or checked for validity, the
+XML processor must normalize it as follows:
+<ulist>
+<item><p>a character reference is processed by appending the referenced
+character to the attribute value</p></item>
+<item><p>an entity reference is processed by recursively processing the
+replacement text of the entity</p></item>
+<item><p>a whitespace character (#x20, #xD, #xA, #x9) is processed by
+appending #x20 to the normalized value, except that only a single #x20
+is appended for a "#xD#xA" sequence that is part of an external
+parsed entity or the literal entity value of an internal parsed
+entity</p></item>
+<item><p>other characters are processed by appending them to the normalized
+value</p>
+</item></ulist>
+</p>
+<p>If the declared value is not CDATA, then the XML processor must
+further process the normalized attribute value by discarding any
+leading and trailing space (#x20) characters, and by replacing
+sequences of space (#x20) characters by a single space (#x20)
+character.</p>
+<p>
+All attributes for which no declaration has been read should be treated
+by a non-validating parser as if declared
+<kw>CDATA</kw>.
+</p>
+</div3>
+</div2>
+<div2 id='sec-condition-sect'>
+<head>Conditional Sections</head>
+<p><termdef id='dt-cond-section' term='conditional section'>
+<term>Conditional sections</term> are portions of the
+<termref def='dt-doctype'>document type declaration external subset</termref>
+which are
+included in, or excluded from, the logical structure of the DTD based on
+the keyword which governs them.</termdef>
+<scrap lang='ebnf'>
+<head>Conditional Section</head>
+<prodgroup pcw2="9" pcw4="14.5">
+<prod id='NT-conditionalSect'><lhs>conditionalSect</lhs>
+<rhs><nt def='NT-includeSect'>includeSect</nt>
+| <nt def='NT-ignoreSect'>ignoreSect</nt>
+</rhs>
+</prod>
+<prod id='NT-includeSect'><lhs>includeSect</lhs>
+<rhs>'&lt;![' S? 'INCLUDE' S? '['
+
+<nt def="NT-extSubsetDecl">extSubsetDecl</nt>
+']]&gt;'
+</rhs>
+</prod>
+<prod id='NT-ignoreSect'><lhs>ignoreSect</lhs>
+<rhs>'&lt;![' S? 'IGNORE' S? '['
+<nt def="NT-ignoreSectContents">ignoreSectContents</nt>*
+']]&gt;'</rhs>
+</prod>
+
+<prod id='NT-ignoreSectContents'><lhs>ignoreSectContents</lhs>
+<rhs><nt def='NT-Ignore'>Ignore</nt>
+('&lt;![' <nt def='NT-ignoreSectContents'>ignoreSectContents</nt> ']]&gt;'
+<nt def='NT-Ignore'>Ignore</nt>)*</rhs></prod>
+<prod id='NT-Ignore'><lhs>Ignore</lhs>
+<rhs><nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* ('&lt;![' | ']]&gt;')
+<nt def='NT-Char'>Char</nt>*)
+</rhs></prod>
+
+</prodgroup>
+</scrap>
+</p>
+<p>Like the internal and external DTD subsets, a conditional section
+may contain one or more complete declarations,
+comments, processing instructions,
+or nested conditional sections, intermingled with white space.
+</p>
+<p>If the keyword of the
+conditional section is <kw>INCLUDE</kw>, then the contents of the conditional
+section are part of the DTD.
+If the keyword of the conditional
+section is <kw>IGNORE</kw>, then the contents of the conditional section are
+not logically part of the DTD.
+Note that for reliable parsing, the contents of even ignored
+conditional sections must be read in order to
+detect nested conditional sections and ensure that the end of the
+outermost (ignored) conditional section is properly detected.
+If a conditional section with a
+keyword of <kw>INCLUDE</kw> occurs within a larger conditional
+section with a keyword of <kw>IGNORE</kw>, both the outer and the
+inner conditional sections are ignored.</p>
+<p>If the keyword of the conditional section is a
+parameter-entity reference, the parameter entity must be replaced by its
+content before the processor decides whether to
+include or ignore the conditional section.</p>
+<p>An example:
+<eg>&lt;!ENTITY % draft 'INCLUDE' >
+&lt;!ENTITY % final 'IGNORE' >
+
+&lt;![%draft;[
+&lt;!ELEMENT book (comments*, title, body, supplements?)>
+]]&gt;
+&lt;![%final;[
+&lt;!ELEMENT book (title, body, supplements?)>
+]]&gt;
+</eg>
+</p>
+</div2>
+
+
+<!--
+<div2 id='sec-pass-to-app'>
+<head>XML Processor Treatment of Logical Structure</head>
+<p>When an XML processor encounters a start-tag, it must make
+at least the following information available to the application:
+<ulist>
+<item>
+<p>the element type's generic identifier</p>
+</item>
+<item>
+<p>the names of attributes known to apply to this element type
+(validating processors must make available names of all attributes
+declared for the element type; non-validating processors must
+make available at least the names of the attributes for which
+values are specified.
+</p>
+</item>
+</ulist>
+</p>
+</div2>
+-->
+
+</div1>
+<!-- &Entities; -->
+
+<div1 id='sec-physical-struct'>
+<head>Physical Structures</head>
+
+<p><termdef id="dt-entity" term="Entity">An XML document may consist
+of one or many storage units. These are called
+<term>entities</term>; they all have <term>content</term> and are all
+(except for the document entity, see below, and
+the <termref def='dt-doctype'>external DTD subset</termref>)
+identified by <term>name</term>.
+</termdef>
+Each XML document has one entity
+called the <termref def="dt-docent">document entity</termref>, which serves
+as the starting point for the <termref def="dt-xml-proc">XML
+processor</termref> and may contain the whole document.</p>
+<p>Entities may be either parsed or unparsed.
+<termdef id="dt-parsedent" term="Text Entity">A <term>parsed entity's</term>
+contents are referred to as its
+<termref def='dt-repltext'>replacement text</termref>;
+this <termref def="dt-text">text</termref> is considered an
+integral part of the document.</termdef></p>
+
+<p><termdef id="dt-unparsed" term="Unparsed Entity">An
+<term>unparsed entity</term>
+is a resource whose contents may or may not be
+<termref def='dt-text'>text</termref>, and if text, may not be XML.
+Each unparsed entity
+has an associated <termref
+def="dt-notation">notation</termref>, identified by name.
+Beyond a requirement
+that an XML processor make the identifiers for the entity and
+notation available to the application,
+XML places no constraints on the contents of unparsed entities.</termdef>
+</p>
+<p>
+Parsed entities are invoked by name using entity references;
+unparsed entities by name, given in the value of <kw>ENTITY</kw>
+or <kw>ENTITIES</kw>
+attributes.</p>
+<p><termdef id='gen-entity' term='general entity'
+><term>General entities</term>
+are entities for use within the document content.
+In this specification, general entities are sometimes referred
+to with the unqualified term <emph>entity</emph> when this leads
+to no ambiguity.</termdef>
+<termdef id='dt-PE' term='Parameter entity'>Parameter entities
+are parsed entities for use within the DTD.</termdef>
+These two types of entities use different forms of reference and
+are recognized in different contexts.
+Furthermore, they occupy different namespaces; a parameter entity and
+a general entity with the same name are two distinct entities.
+</p>
+
+<div2 id='sec-references'>
+<head>Character and Entity References</head>
+<p><termdef id="dt-charref" term="Character Reference">
+A <term>character reference</term> refers to a specific character in the
+ISO/IEC 10646 character set, for example one not directly accessible from
+available input devices.
+<scrap lang='ebnf'>
+<head>Character Reference</head>
+<prod id='NT-CharRef'><lhs>CharRef</lhs>
+<rhs>'&amp;#' [0-9]+ ';' </rhs>
+<rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs>
+<wfc def="wf-Legalchar"/>
+</prod>
+</scrap>
+<wfcnote id="wf-Legalchar">
+<head>Legal Character</head>
+<p>Characters referred to using character references must
+match the production for
+<termref def="NT-Char">Char</termref>.</p>
+</wfcnote>
+If the character reference begins with "<code>&amp;#x</code>", the digits and
+letters up to the terminating <code>;</code> provide a hexadecimal
+representation of the character's code point in ISO/IEC 10646.
+If it begins just with "<code>&amp;#</code>", the digits up to the terminating
+<code>;</code> provide a decimal representation of the character's
+code point.
+</termdef>
+</p>
+<p><termdef id="dt-entref" term="Entity Reference">An <term>entity
+reference</term> refers to the content of a named entity.</termdef>
+<termdef id='dt-GERef' term='General Entity Reference'>References to
+parsed general entities
+use ampersand (<code>&amp;</code>) and semicolon (<code>;</code>) as
+delimiters.</termdef>
+<termdef id='dt-PERef' term='Parameter-entity reference'>
+<term>Parameter-entity references</term> use percent-sign (<code>%</code>) and
+semicolon
+(<code>;</code>) as delimiters.</termdef>
+</p>
+<scrap lang="ebnf">
+<head>Entity Reference</head>
+<prod id='NT-Reference'><lhs>Reference</lhs>
+<rhs><nt def='NT-EntityRef'>EntityRef</nt>
+| <nt def='NT-CharRef'>CharRef</nt></rhs></prod>
+<prod id='NT-EntityRef'><lhs>EntityRef</lhs>
+<rhs>'&amp;' <nt def='NT-Name'>Name</nt> ';'</rhs>
+<wfc def='wf-entdeclared'/>
+<vc def='vc-entdeclared'/>
+<wfc def='textent'/>
+<wfc def='norecursion'/>
+</prod>
+<prod id='NT-PEReference'><lhs>PEReference</lhs>
+<rhs>'%' <nt def='NT-Name'>Name</nt> ';'</rhs>
+<vc def='vc-entdeclared'/>
+<wfc def='norecursion'/>
+<wfc def='indtd'/>
+</prod>
+</scrap>
+
+<wfcnote id='wf-entdeclared'>
+<head>Entity Declared</head>
+<p>In a document without any DTD, a document with only an internal
+DTD subset which contains no parameter entity references, or a document with
+"<code>standalone='yes'</code>",
+the <nt def='NT-Name'>Name</nt> given in the entity reference must
+<termref def="dt-match">match</termref> that in an
+<titleref href='sec-entity-decl'>entity declaration</titleref>, except that
+well-formed documents need not declare
+any of the following entities: &magicents;.
+The declaration of a parameter entity must precede any reference to it.
+Similarly, the declaration of a general entity must precede any
+reference to it which appears in a default value in an attribute-list
+declaration.</p>
+<p>Note that if entities are declared in the external subset or in
+external parameter entities, a non-validating processor is
+<titleref href='include-if-valid'>not obligated to</titleref> read
+and process their declarations; for such documents, the rule that
+an entity must be declared is a well-formedness constraint only
+if <titleref href='sec-rmd'>standalone='yes'</titleref>.</p>
+</wfcnote>
+<vcnote id="vc-entdeclared">
+<head>Entity Declared</head>
+<p>In a document with an external subset or external parameter
+entities with "<code>standalone='no'</code>",
+the <nt def='NT-Name'>Name</nt> given in the entity reference must <termref
+def="dt-match">match</termref> that in an
+<titleref href='sec-entity-decl'>entity declaration</titleref>.
+For interoperability, valid documents should declare the entities
+&magicents;, in the form
+specified in <specref ref="sec-predefined-ent"/>.
+The declaration of a parameter entity must precede any reference to it.
+Similarly, the declaration of a general entity must precede any
+reference to it which appears in a default value in an attribute-list
+declaration.</p>
+</vcnote>
+<!-- FINAL EDIT: is this duplication too clumsy? -->
+<wfcnote id='textent'>
+<head>Parsed Entity</head>
+<p>
+An entity reference must not contain the name of an <termref
+def="dt-unparsed">unparsed entity</termref>. Unparsed entities may be referred
+to only in <termref def="dt-attrval">attribute values</termref> declared to
+be of type <kw>ENTITY</kw> or <kw>ENTITIES</kw>.
+</p>
+</wfcnote>
+<wfcnote id='norecursion'>
+<head>No Recursion</head>
+<p>
+A parsed entity must not contain a recursive reference to itself,
+either directly or indirectly.
+</p>
+</wfcnote>
+<wfcnote id='indtd'>
+<head>In DTD</head>
+<p>
+Parameter-entity references may only appear in the
+<termref def='dt-doctype'>DTD</termref>.
+</p>
+</wfcnote>
+<p>Examples of character and entity references:
+<eg>Type &lt;key>less-than&lt;/key> (&hcro;3C;) to save options.
+This document was prepared on &amp;docdate; and
+is classified &amp;security-level;.</eg></p>
+<p>Example of a parameter-entity reference:
+<eg><![CDATA[<!-- declare the parameter entity "ISOLat2"... -->
+<!ENTITY % ISOLat2
+ SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
+<!-- ... now reference it. -->
+%ISOLat2;]]></eg></p>
+</div2>
+
+<div2 id='sec-entity-decl'>
+<head>Entity Declarations</head>
+
+<p><termdef id="dt-entdecl" term="entity declaration">
+Entities are declared thus:
+<scrap lang='ebnf'>
+<head>Entity Declaration</head>
+<prodgroup pcw2="5" pcw4="18.5">
+<prod id='NT-EntityDecl'><lhs>EntityDecl</lhs>
+<rhs><nt def="NT-GEDecl">GEDecl</nt><!--</rhs><com>General entities</com>
+<rhs>--> | <nt def="NT-PEDecl">PEDecl</nt></rhs>
+<!--<com>Parameter entities</com>-->
+</prod>
+<prod id='NT-GEDecl'><lhs>GEDecl</lhs>
+<rhs>'&lt;!ENTITY' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-EntityDef'>EntityDef</nt>
+<nt def='NT-S'>S</nt>? '&gt;'</rhs>
+</prod>
+<prod id='NT-PEDecl'><lhs>PEDecl</lhs>
+<rhs>'&lt;!ENTITY' <nt def='NT-S'>S</nt> '%' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt> <nt def='NT-S'>S</nt>
+<nt def='NT-PEDef'>PEDef</nt> <nt def='NT-S'>S</nt>? '&gt;'</rhs>
+<!--<com>Parameter entities</com>-->
+</prod>
+<prod id='NT-EntityDef'><lhs>EntityDef</lhs>
+<rhs><nt def='NT-EntityValue'>EntityValue</nt>
+<!--</rhs>
+<rhs>-->| (<nt def='NT-ExternalID'>ExternalID</nt>
+<nt def='NT-NDataDecl'>NDataDecl</nt>?)</rhs>
+<!-- <nt def='NT-ExternalDef'>ExternalDef</nt></rhs> -->
+</prod>
+<!-- FINAL EDIT: what happened to WFs here? -->
+<prod id='NT-PEDef'><lhs>PEDef</lhs>
+<rhs><nt def='NT-EntityValue'>EntityValue</nt>
+| <nt def='NT-ExternalID'>ExternalID</nt></rhs></prod>
+</prodgroup>
+</scrap>
+The <nt def='NT-Name'>Name</nt> identifies the entity in an
+<termref def="dt-entref">entity reference</termref> or, in the case of an
+unparsed entity, in the value of an <kw>ENTITY</kw> or <kw>ENTITIES</kw>
+attribute.
+If the same entity is declared more than once, the first declaration
+encountered is binding; at user option, an XML processor may issue a
+warning if entities are declared multiple times.</termdef>
+</p>
+
+<div3 id='sec-internal-ent'>
+<head>Internal Entities</head>
+
+<p><termdef id='dt-internent' term="Internal Entity Replacement Text">If
+the entity definition is an
+<nt def='NT-EntityValue'>EntityValue</nt>,
+the defined entity is called an <term>internal entity</term>.
+There is no separate physical
+storage object, and the content of the entity is given in the
+declaration. </termdef>
+Note that some processing of entity and character references in the
+<termref def='dt-litentval'>literal entity value</termref> may be required to
+produce the correct <termref def='dt-repltext'>replacement
+text</termref>: see <specref ref='intern-replacement'/>.
+</p>
+<p>An internal entity is a <termref def="dt-parsedent">parsed
+entity</termref>.</p>
+<p>Example of an internal entity declaration:
+<eg>&lt;!ENTITY Pub-Status "This is a pre-release of the
+ specification."></eg></p>
+</div3>
+
+<div3 id='sec-external-ent'>
+<head>External Entities</head>
+
+<p><termdef id="dt-extent" term="External Entity">If the entity is not
+internal, it is an <term>external
+entity</term>, declared as follows:
+<scrap lang='ebnf'>
+<head>External Entity Declaration</head>
+<!--
+<prod id='NT-ExternalDef'><lhs>ExternalDef</lhs>
+<rhs></prod> -->
+<prod id='NT-ExternalID'><lhs>ExternalID</lhs>
+<rhs>'SYSTEM' <nt def='NT-S'>S</nt>
+<nt def='NT-SystemLiteral'>SystemLiteral</nt></rhs>
+<rhs>| 'PUBLIC' <nt def='NT-S'>S</nt>
+<nt def='NT-PubidLiteral'>PubidLiteral</nt>
+<nt def='NT-S'>S</nt>
+<nt def='NT-SystemLiteral'>SystemLiteral</nt>
+</rhs>
+</prod>
+<prod id='NT-NDataDecl'><lhs>NDataDecl</lhs>
+<rhs><nt def='NT-S'>S</nt> 'NDATA' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt></rhs>
+<vc def='not-declared'/></prod>
+</scrap>
+If the <nt def='NT-NDataDecl'>NDataDecl</nt> is present, this is a
+general <termref def="dt-unparsed">unparsed
+entity</termref>; otherwise it is a parsed entity.</termdef></p>
+<vcnote id='not-declared'>
+<head>Notation Declared</head>
+<p>
+The <nt def='NT-Name'>Name</nt> must match the declared name of a
+<termref def="dt-notation">notation</termref>.
+</p>
+</vcnote>
+<p><termdef id="dt-sysid" term="System Identifier">The
+<nt def='NT-SystemLiteral'>SystemLiteral</nt>
+is called the entity's <term>system identifier</term>. It is a URI,
+which may be used to retrieve the entity.</termdef>
+Note that the hash mark (<code>#</code>) and fragment identifier
+frequently used with URIs are not, formally, part of the URI itself;
+an XML processor may signal an error if a fragment identifier is
+given as part of a system identifier.
+Unless otherwise provided by information outside the scope of this
+specification (e.g. a special XML element type defined by a particular
+DTD, or a processing instruction defined by a particular application
+specification), relative URIs are relative to the location of the
+resource within which the entity declaration occurs.
+A URI might thus be relative to the
+<termref def='dt-docent'>document entity</termref>, to the entity
+containing the <termref def='dt-doctype'>external DTD subset</termref>,
+or to some other <termref def='dt-extent'>external parameter entity</termref>.
+</p>
+<p>An XML processor should handle a non-ASCII character in a URI by
+representing the character in UTF-8 as one or more bytes, and then
+escaping these bytes with the URI escaping mechanism (i.e., by
+converting each byte to %HH, where HH is the hexadecimal notation of the
+byte value).</p>
+<p><termdef id="dt-pubid" term="Public identifier">
+In addition to a system identifier, an external identifier may
+include a <term>public identifier</term>.</termdef>
+An XML processor attempting to retrieve the entity's content may use the public
+identifier to try to generate an alternative URI. If the processor
+is unable to do so, it must use the URI specified in the system
+literal. Before a match is attempted, all strings
+of white space in the public identifier must be normalized to single space characters (#x20),
+and leading and trailing white space must be removed.</p>
+<p>Examples of external entity declarations:
+<eg>&lt;!ENTITY open-hatch
+ SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
+&lt;!ENTITY open-hatch
+ PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
+ "http://www.textuality.com/boilerplate/OpenHatch.xml">
+&lt;!ENTITY hatch-pic
+ SYSTEM "../grafix/OpenHatch.gif"
+ NDATA gif ></eg></p>
+</div3>
+
+</div2>
+
+<div2 id='TextEntities'>
+<head>Parsed Entities</head>
+<div3 id='sec-TextDecl'>
+<head>The Text Declaration</head>
+<p>External parsed entities may each begin with a <term>text
+declaration</term>.
+<scrap lang='ebnf'>
+<head>Text Declaration</head>
+<prodgroup pcw4="12.5" pcw5="13">
+<prod id='NT-TextDecl'><lhs>TextDecl</lhs>
+<rhs>&xmlpio;
+<nt def='NT-VersionInfo'>VersionInfo</nt>?
+<nt def='NT-EncodingDecl'>EncodingDecl</nt>
+<nt def='NT-S'>S</nt>? &pic;</rhs>
+</prod>
+</prodgroup>
+</scrap>
+</p>
+<p>The text declaration must be provided literally, not
+by reference to a parsed entity.
+No text declaration may appear at any position other than the beginning of
+an external parsed entity.</p>
+</div3>
+<div3 id='wf-entities'>
+<head>Well-Formed Parsed Entities</head>
+<p>The document entity is well-formed if it matches the production labeled
+<nt def='NT-document'>document</nt>.
+An external general
+parsed entity is well-formed if it matches the production labeled
+<nt def='NT-extParsedEnt'>extParsedEnt</nt>.
+An external parameter
+entity is well-formed if it matches the production labeled
+<nt def='NT-extPE'>extPE</nt>.
+<scrap lang='ebnf'>
+<head>Well-Formed External Parsed Entity</head>
+<prod id='NT-extParsedEnt'><lhs>extParsedEnt</lhs>
+<rhs><nt def='NT-TextDecl'>TextDecl</nt>?
+<nt def='NT-content'>content</nt></rhs>
+</prod>
+<prod id='NT-extPE'><lhs>extPE</lhs>
+<rhs><nt def='NT-TextDecl'>TextDecl</nt>?
+<nt def='NT-extSubsetDecl'>extSubsetDecl</nt></rhs>
+</prod>
+</scrap>
+An internal general parsed entity is well-formed if its replacement text
+matches the production labeled
+<nt def='NT-content'>content</nt>.
+All internal parameter entities are well-formed by definition.
+</p>
+<p>A consequence of well-formedness in entities is that the logical
+and physical structures in an XML document are properly nested; no
+<termref def='dt-stag'>start-tag</termref>,
+<termref def='dt-etag'>end-tag</termref>,
+<termref def="dt-empty">empty-element tag</termref>,
+<termref def='dt-element'>element</termref>,
+<termref def='dt-comment'>comment</termref>,
+<termref def='dt-pi'>processing instruction</termref>,
+<termref def='dt-charref'>character
+reference</termref>, or
+<termref def='dt-entref'>entity reference</termref>
+can begin in one entity and end in another.</p>
+</div3>
+<div3 id='charencoding'>
+<head>Character Encoding in Entities</head>
+
+<p>Each external parsed entity in an XML document may use a different
+encoding for its characters. All XML processors must be able to read
+entities in either UTF-8 or UTF-16.
+
+</p>
+<p>Entities encoded in UTF-16 must
+begin with the Byte Order Mark described by ISO/IEC 10646 Annex E and
+Unicode Appendix B (the ZERO WIDTH NO-BREAK SPACE character, #xFEFF).
+This is an encoding signature, not part of either the markup or the
+character data of the XML document.
+XML processors must be able to use this character to
+differentiate between UTF-8 and UTF-16 encoded documents.</p>
+<p>Although an XML processor is required to read only entities in
+the UTF-8 and UTF-16 encodings, it is recognized that other encodings are
+used around the world, and it may be desired for XML processors
+to read entities that use them.
+Parsed entities which are stored in an encoding other than
+UTF-8 or UTF-16 must begin with a <titleref href='TextDecl'>text
+declaration</titleref> containing an encoding declaration:
+<scrap lang='ebnf'>
+<head>Encoding Declaration</head>
+<prod id='NT-EncodingDecl'><lhs>EncodingDecl</lhs>
+<rhs><nt def="NT-S">S</nt>
+'encoding' <nt def='NT-Eq'>Eq</nt>
+('"' <nt def='NT-EncName'>EncName</nt> '"' |
+"'" <nt def='NT-EncName'>EncName</nt> "'" )
+</rhs>
+</prod>
+<prod id='NT-EncName'><lhs>EncName</lhs>
+<rhs>[A-Za-z] ([A-Za-z0-9._] | '-')*</rhs>
+<com>Encoding name contains only Latin characters</com>
+</prod>
+</scrap>
+In the <termref def='dt-docent'>document entity</termref>, the encoding
+declaration is part of the <termref def="dt-xmldecl">XML declaration</termref>.
+The <nt def="NT-EncName">EncName</nt> is the name of the encoding used.
+</p>
+<!-- FINAL EDIT: check name of IANA and charset names -->
+<p>In an encoding declaration, the values
+"<code>UTF-8</code>",
+"<code>UTF-16</code>",
+"<code>ISO-10646-UCS-2</code>", and
+"<code>ISO-10646-UCS-4</code>" should be
+used for the various encodings and transformations of Unicode /
+ISO/IEC 10646, the values
+"<code>ISO-8859-1</code>",
+"<code>ISO-8859-2</code>", ...
+"<code>ISO-8859-9</code>" should be used for the parts of ISO 8859, and
+the values
+"<code>ISO-2022-JP</code>",
+"<code>Shift_JIS</code>", and
+"<code>EUC-JP</code>"
+should be used for the various encoded forms of JIS X-0208-1997. XML
+processors may recognize other encodings; it is recommended that
+character encodings registered (as <emph>charset</emph>s)
+with the Internet Assigned Numbers
+Authority <bibref ref='IANA'/>, other than those just listed, should be
+referred to
+using their registered names.
+Note that these registered names are defined to be
+case-insensitive, so processors wishing to match against them
+should do so in a case-insensitive
+way.</p>
+<p>In the absence of information provided by an external
+transport protocol (e.g. HTTP or MIME),
+it is an <termref def="dt-error">error</termref> for an entity including
+an encoding declaration to be presented to the XML processor
+in an encoding other than that named in the declaration,
+for an encoding declaration to occur other than at the beginning
+of an external entity, or for
+an entity which begins with neither a Byte Order Mark nor an encoding
+declaration to use an encoding other than UTF-8.
+Note that since ASCII
+is a subset of UTF-8, ordinary ASCII entities do not strictly need
+an encoding declaration.</p>
+
+<p>It is a <termref def='dt-fatal'>fatal error</termref> when an XML processor
+encounters an entity with an encoding that it is unable to process.</p>
+<p>Examples of encoding declarations:
+<eg>&lt;?xml encoding='UTF-8'?>
+&lt;?xml encoding='EUC-JP'?></eg></p>
+</div3>
+</div2>
+<div2 id='entproc'>
+<head>XML Processor Treatment of Entities and References</head>
+<p>The table below summarizes the contexts in which character references,
+entity references, and invocations of unparsed entities might appear and the
+required behavior of an <termref def='dt-xml-proc'>XML processor</termref> in
+each case.
+The labels in the leftmost column describe the recognition context:
+<glist>
+<gitem><label>Reference in Content</label>
+<def><p>as a reference
+anywhere after the <termref def='dt-stag'>start-tag</termref> and
+before the <termref def='dt-etag'>end-tag</termref> of an element; corresponds
+to the nonterminal <nt def='NT-content'>content</nt>.</p></def>
+</gitem>
+<gitem>
+<label>Reference in Attribute Value</label>
+<def><p>as a reference within either the value of an attribute in a
+<termref def='dt-stag'>start-tag</termref>, or a default
+value in an <termref def='dt-attdecl'>attribute declaration</termref>;
+corresponds to the nonterminal
+<nt def='NT-AttValue'>AttValue</nt>.</p></def></gitem>
+<gitem>
+<label>Occurs as Attribute Value</label>
+<def><p>as a <nt def='NT-Name'>Name</nt>, not a reference, appearing either as
+the value of an
+attribute which has been declared as type <kw>ENTITY</kw>, or as one of
+the space-separated tokens in the value of an attribute which has been
+declared as type <kw>ENTITIES</kw>.</p>
+</def></gitem>
+<gitem><label>Reference in Entity Value</label>
+<def><p>as a reference
+within a parameter or internal entity's
+<termref def='dt-litentval'>literal entity value</termref> in
+the entity's declaration; corresponds to the nonterminal
+<nt def='NT-EntityValue'>EntityValue</nt>.</p></def></gitem>
+<gitem><label>Reference in DTD</label>
+<def><p>as a reference within either the internal or external subsets of the
+<termref def='dt-doctype'>DTD</termref>, but outside
+of an <nt def='NT-EntityValue'>EntityValue</nt> or
+<nt def="NT-AttValue">AttValue</nt>.</p></def>
+</gitem>
+</glist></p>
+<htable border='1' cellpadding='7' align='center'>
+<htbody>
+<tr><td bgcolor='&cellback;' rowspan='2' colspan='1'></td>
+<td bgcolor='&cellback;' align='center' valign='bottom' colspan='4'>Entity Type</td>
+<td bgcolor='&cellback;' rowspan='2' align='center'>Character</td>
+</tr>
+<tr align='center' valign='bottom'>
+<td bgcolor='&cellback;'>Parameter</td>
+<td bgcolor='&cellback;'>Internal
+General</td>
+<td bgcolor='&cellback;'>External Parsed
+General</td>
+<td bgcolor='&cellback;'>Unparsed</td>
+</tr>
+<tr align='center' valign='middle'>
+
+<td bgcolor='&cellback;' align='right'>Reference
+in Content</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>Not recognized</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>Included</titleref></td>
+<td bgcolor='&cellback;'><titleref href='include-if-valid'>Included if validating</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>Included</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>Reference
+in Attribute Value</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>Not recognized</titleref></td>
+<td bgcolor='&cellback;'><titleref href='inliteral'>Included in literal</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>Included</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>Occurs as
+Attribute Value</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>Not recognized</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='notify'>Notify</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not recognized'>Not recognized</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>Reference
+in EntityValue</td>
+<td bgcolor='&cellback;'><titleref href='inliteral'>Included in literal</titleref></td>
+<td bgcolor='&cellback;'><titleref href='bypass'>Bypassed</titleref></td>
+<td bgcolor='&cellback;'><titleref href='bypass'>Bypassed</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>Included</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>Reference
+in DTD</td>
+<td bgcolor='&cellback;'><titleref href='as-PE'>Included as PE</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>Forbidden</titleref></td>
+</tr>
+</htbody>
+</htable>
+<div3 id='not-recognized'>
+<head>Not Recognized</head>
+<p>Outside the DTD, the <code>%</code> character has no
+special significance; thus, what would be parameter entity references in the
+DTD are not recognized as markup in <nt def='NT-content'>content</nt>.
+Similarly, the names of unparsed entities are not recognized except
+when they appear in the value of an appropriately declared attribute.
+</p>
+</div3>
+<div3 id='included'>
+<head>Included</head>
+<p><termdef id="dt-include" term="Include">An entity is
+<term>included</term> when its
+<termref def='dt-repltext'>replacement text</termref> is retrieved
+and processed, in place of the reference itself,
+as though it were part of the document at the location the
+reference was recognized.
+The replacement text may contain both
+<termref def='dt-chardata'>character data</termref>
+and (except for parameter entities) <termref def="dt-markup">markup</termref>,
+which must be recognized in
+the usual way, except that the replacement text of entities used to escape
+markup delimiters (the entities &magicents;) is always treated as
+data. (The string "<code>AT&amp;amp;T;</code>" expands to
+"<code>AT&amp;T;</code>" and the remaining ampersand is not recognized
+as an entity-reference delimiter.)
+A character reference is <term>included</term> when the indicated
+character is processed in place of the reference itself.
+</termdef></p>
+</div3>
+<div3 id='include-if-valid'>
+<head>Included If Validating</head>
+<p>When an XML processor recognizes a reference to a parsed entity, in order
+to <termref def="dt-valid">validate</termref>
+the document, the processor must
+<termref def="dt-include">include</termref> its
+replacement text.
+If the entity is external, and the processor is not
+attempting to validate the XML document, the
+processor <termref def="dt-may">may</termref>, but need not,
+include the entity's replacement text.
+If a non-validating parser does not include the replacement text,
+it must inform the application that it recognized, but did not
+read, the entity.</p>
+<p>This rule is based on the recognition that the automatic inclusion
+provided by the SGML and XML entity mechanism, primarily designed
+to support modularity in authoring, is not necessarily
+appropriate for other applications, in particular document browsing.
+Browsers, for example, when encountering an external parsed entity reference,
+might choose to provide a visual indication of the entity's
+presence and retrieve it for display only on demand.
+</p>
+</div3>
+<div3 id='forbidden'>
+<head>Forbidden</head>
+<p>The following are forbidden, and constitute
+<termref def='dt-fatal'>fatal</termref> errors:
+<ulist>
+<item><p>the appearance of a reference to an
+<termref def='dt-unparsed'>unparsed entity</termref>.
+</p></item>
+<item><p>the appearance of any character or general-entity reference in the
+DTD except within an <nt def='NT-EntityValue'>EntityValue</nt> or
+<nt def="NT-AttValue">AttValue</nt>.</p></item>
+<item><p>a reference to an external entity in an attribute value.</p>
+</item>
+</ulist>
+</p>
+</div3>
+<div3 id='inliteral'>
+<head>Included in Literal</head>
+<p>When an <termref def='dt-entref'>entity reference</termref> appears in an
+attribute value, or a parameter entity reference appears in a literal entity
+value, its <termref def='dt-repltext'>replacement text</termref> is
+processed in place of the reference itself as though it
+were part of the document at the location the reference was recognized,
+except that a single or double quote character in the replacement text
+is always treated as a normal data character and will not terminate the
+literal.
+For example, this is well-formed:
+<eg><![CDATA[<!ENTITY % YN '"Yes"' >
+<!ENTITY WhatHeSaid "He said &YN;" >]]></eg>
+while this is not:
+<eg>&lt;!ENTITY EndAttr "27'" >
+&lt;element attribute='a-&amp;EndAttr;></eg>
+</p></div3>
+<div3 id='notify'>
+<head>Notify</head>
+<p>When the name of an <termref def='dt-unparsed'>unparsed
+entity</termref> appears as a token in the
+value of an attribute of declared type <kw>ENTITY</kw> or <kw>ENTITIES</kw>,
+a validating processor must inform the
+application of the <termref def='dt-sysid'>system</termref>
+and <termref def='dt-pubid'>public</termref> (if any)
+identifiers for both the entity and its associated
+<termref def="dt-notation">notation</termref>.</p>
+</div3>
+<div3 id='bypass'>
+<head>Bypassed</head>
+<p>When a general entity reference appears in the
+<nt def='NT-EntityValue'>EntityValue</nt> in an entity declaration,
+it is bypassed and left as is.</p>
+</div3>
+<div3 id='as-PE'>
+<head>Included as PE</head>
+<p>Just as with external parsed entities, parameter entities
+need only be <titleref href='include-if-valid'>included if
+validating</titleref>.
+When a parameter-entity reference is recognized in the DTD
+and included, its
+<termref def='dt-repltext'>replacement
+text</termref> is enlarged by the attachment of one leading and one following
+space (#x20) character; the intent is to constrain the replacement
+text of parameter
+entities to contain an integral number of grammatical tokens in the DTD.
+</p>
+</div3>
+
+</div2>
+<div2 id='intern-replacement'>
+<head>Construction of Internal Entity Replacement Text</head>
+<p>In discussing the treatment
+of internal entities, it is
+useful to distinguish two forms of the entity's value.
+<termdef id="dt-litentval" term='Literal Entity Value'>The <term>literal
+entity value</term> is the quoted string actually
+present in the entity declaration, corresponding to the
+non-terminal <nt def='NT-EntityValue'>EntityValue</nt>.</termdef>
+<termdef id='dt-repltext' term='Replacement Text'>The <term>replacement
+text</term> is the content of the entity, after
+replacement of character references and parameter-entity
+references.
+</termdef></p>
+
+<p>The literal entity value
+as given in an internal entity declaration
+(<nt def='NT-EntityValue'>EntityValue</nt>) may contain character,
+parameter-entity, and general-entity references.
+Such references must be contained entirely within the
+literal entity value.
+The actual replacement text that is
+<termref def='dt-include'>included</termref> as described above
+must contain the <emph>replacement text</emph> of any
+parameter entities referred to, and must contain the character
+referred to, in place of any character references in the
+literal entity value; however,
+general-entity references must be left as-is, unexpanded.
+For example, given the following declarations:
+
+<eg><![CDATA[<!ENTITY % pub "&#xc9;ditions Gallimard" >
+<!ENTITY rights "All rights reserved" >
+<!ENTITY book "La Peste: Albert Camus,
+&#xA9; 1947 %pub;. &rights;" >]]></eg>
+then the replacement text for the entity "<code>book</code>" is:
+<eg>La Peste: Albert Camus,
+&#169; 1947 &#201;ditions Gallimard. &amp;rights;</eg>
+The general-entity reference "<code>&amp;rights;</code>" would be expanded
+should the reference "<code>&amp;book;</code>" appear in the document's
+content or an attribute value.</p>
+<p>These simple rules may have complex interactions; for a detailed
+discussion of a difficult example, see
+<specref ref='sec-entexpand'/>.
+</p>
+
+</div2>
+<div2 id='sec-predefined-ent'>
+<head>Predefined Entities</head>
+<p><termdef id="dt-escape" term="escape">Entity and character
+references can both be used to <term>escape</term> the left angle bracket,
+ampersand, and other delimiters. A set of general entities
+(&magicents;) is specified for this purpose.
+Numeric character references may also be used; they are
+expanded immediately when recognized and must be treated as
+character data, so the numeric character references
+"<code>&amp;#60;</code>" and "<code>&amp;#38;</code>" may be used to
+escape <code>&lt;</code> and <code>&amp;</code> when they occur
+in character data.</termdef></p>
+<p>All XML processors must recognize these entities whether they
+are declared or not.
+<termref def='dt-interop'>For interoperability</termref>,
+valid XML documents should declare these
+entities, like any others, before using them.
+If the entities in question are declared, they must be declared
+as internal entities whose replacement text is the single
+character being escaped or a character reference to
+that character, as shown below.
+<eg><![CDATA[<!ENTITY lt "&#38;#60;">
+<!ENTITY gt "&#62;">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY apos "&#39;">
+<!ENTITY quot "&#34;">
+]]></eg>
+Note that the <code>&lt;</code> and <code>&amp;</code> characters
+in the declarations of "<code>lt</code>" and "<code>amp</code>"
+are doubly escaped to meet the requirement that entity replacement
+be well-formed.
+</p>
+</div2>
+
+<div2 id='Notations'>
+<head>Notation Declarations</head>
+
+<p><termdef id="dt-notation" term="Notation"><term>Notations</term> identify by
+name the format of <termref def="dt-extent">unparsed
+entities</termref>, the
+format of elements which bear a notation attribute,
+or the application to which
+a <termref def="dt-pi">processing instruction</termref> is
+addressed.</termdef></p>
+<p><termdef id="dt-notdecl" term="Notation Declaration">
+<term>Notation declarations</term>
+provide a name for the notation, for use in
+entity and attribute-list declarations and in attribute specifications,
+and an external identifier for the notation which may allow an XML
+processor or its client application to locate a helper application
+capable of processing data in the given notation.
+<scrap lang='ebnf'>
+<head>Notation Declarations</head>
+<prod id='NT-NotationDecl'><lhs>NotationDecl</lhs>
+<rhs>'&lt;!NOTATION' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>
+(<nt def='NT-ExternalID'>ExternalID</nt> |
+<nt def='NT-PublicID'>PublicID</nt>)
+<nt def='NT-S'>S</nt>? '>'</rhs></prod>
+<prod id='NT-PublicID'><lhs>PublicID</lhs>
+<rhs>'PUBLIC' <nt def='NT-S'>S</nt>
+<nt def='NT-PubidLiteral'>PubidLiteral</nt>
+</rhs></prod>
+</scrap>
+</termdef></p>
+<p>XML processors must provide applications with the name and external
+identifier(s) of any notation declared and referred to in an attribute
+value, attribute definition, or entity declaration. They may
+additionally resolve the external identifier into the
+<termref def="dt-sysid">system identifier</termref>,
+file name, or other information needed to allow the
+application to call a processor for data in the notation described. (It
+is not an error, however, for XML documents to declare and refer to
+notations for which notation-specific applications are not available on
+the system where the XML processor or application is running.)</p>
+</div2>
+
+
+<div2 id='sec-doc-entity'>
+<head>Document Entity</head>
+
+<p><termdef id="dt-docent" term="Document Entity">The <term>document
+entity</term> serves as the root of the entity
+tree and a starting-point for an <termref def="dt-xml-proc">XML
+processor</termref>.</termdef>
+This specification does
+not specify how the document entity is to be located by an XML
+processor; unlike other entities, the document entity has no name and might
+well appear on a processor input stream
+without any identification at all.</p>
+</div2>
+
+
+</div1>
+<!-- &Conformance; -->
+
+<div1 id='sec-conformance'>
+<head>Conformance</head>
+
+<div2 id='proc-types'>
+<head>Validating and Non-Validating Processors</head>
+<p>Conforming <termref def="dt-xml-proc">XML processors</termref> fall into two
+classes: validating and non-validating.</p>
+<p>Validating and non-validating processors alike must report
+violations of this specification's well-formedness constraints
+in the content of the
+<termref def='dt-docent'>document entity</termref> and any
+other <termref def='dt-parsedent'>parsed entities</termref> that
+they read.</p>
+<p><termdef id="dt-validating" term="Validating Processor">
+<term>Validating processors</term> must report
+violations of the constraints expressed by the declarations in the
+<termref def="dt-doctype">DTD</termref>, and
+failures to fulfill the validity constraints given
+in this specification.
+</termdef>
+To accomplish this, validating XML processors must read and process the entire
+DTD and all external parsed entities referenced in the document.
+</p>
+<p>Non-validating processors are required to check only the
+<termref def='dt-docent'>document entity</termref>, including
+the entire internal DTD subset, for well-formedness.
+<termdef id='dt-use-mdecl' term='Process Declarations'>
+While they are not required to check the document for validity,
+they are required to
+<term>process</term> all the declarations they read in the
+internal DTD subset and in any parameter entity that they
+read, up to the first reference
+to a parameter entity that they do <emph>not</emph> read; that is to
+say, they must
+use the information in those declarations to
+<titleref href='AVNormalize'>normalize</titleref> attribute values,
+<titleref href='included'>include</titleref> the replacement text of
+internal entities, and supply
+<titleref href='sec-attr-defaults'>default attribute values</titleref>.
+</termdef>
+They must not <termref def='dt-use-mdecl'>process</termref>
+<termref def='dt-entdecl'>entity declarations</termref> or
+<termref def='dt-attdecl'>attribute-list declarations</termref>
+encountered after a reference to a parameter entity that is not
+read, since the entity may have contained overriding declarations.
+</p>
+</div2>
+<div2 id='safe-behavior'>
+<head>Using XML Processors</head>
+<p>The behavior of a validating XML processor is highly predictable; it
+must read every piece of a document and report all well-formedness and
+validity violations.
+Less is required of a non-validating processor; it need not read any
+part of the document other than the document entity.
+This has two effects that may be important to users of XML processors:
+<ulist>
+<item><p>Certain well-formedness errors, specifically those that require
+reading external entities, may not be detected by a non-validating processor.
+Examples include the constraints entitled
+<titleref href='wf-entdeclared'>Entity Declared</titleref>,
+<titleref href='wf-textent'>Parsed Entity</titleref>, and
+<titleref href='wf-norecursion'>No Recursion</titleref>, as well
+as some of the cases described as
+<titleref href='forbidden'>forbidden</titleref> in
+<specref ref='entproc'/>.</p></item>
+<item><p>The information passed from the processor to the application may
+vary, depending on whether the processor reads
+parameter and external entities.
+For example, a non-validating processor may not
+<titleref href='AVNormalize'>normalize</titleref> attribute values,
+<titleref href='included'>include</titleref> the replacement text of
+internal entities, or supply
+<titleref href='sec-attr-defaults'>default attribute values</titleref>,
+where doing so depends on having read declarations in
+external or parameter entities.</p></item>
+</ulist>
+</p>
+<p>For maximum reliability in interoperating between different XML
+processors, applications which use non-validating processors should not
+rely on any behaviors not required of such processors.
+Applications which require facilities such as the use of default
+attributes or internal entities which are declared in external
+entities should use validating XML processors.</p>
+</div2>
+</div1>
+
+<div1 id='sec-notation'>
+<head>Notation</head>
+
+<p>The formal grammar of XML is given in this specification using a simple
+Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines
+one symbol, in the form
+<eg>symbol ::= expression</eg></p>
+<p>Symbols are written with an initial capital letter if they are
+defined by a regular expression, or with an initial lower case letter
+otherwise.
+Literal strings are quoted.
+
+</p>
+
+<p>Within the expression on the right-hand side of a rule, the following
+expressions are used to match strings of one or more characters:
+<glist>
+<gitem>
+<label><code>#xN</code></label>
+<def><p>where <code>N</code> is a hexadecimal integer, the
+expression matches the character in ISO/IEC 10646 whose canonical
+(UCS-4)
+code value, when interpreted as an unsigned binary number, has
+the value indicated. The number of leading zeros in the
+<code>#xN</code> form is insignificant; the number of leading
+zeros in the corresponding code value
+is governed by the character
+encoding in use and is not significant for XML.</p></def>
+</gitem>
+<gitem>
+<label><code>[a-zA-Z]</code>, <code>[#xN-#xN]</code></label>
+<def><p>matches any <termref def='dt-character'>character</termref>
+with a value in the range(s) indicated (inclusive).</p></def>
+</gitem>
+<gitem>
+<label><code>[^a-z]</code>, <code>[^#xN-#xN]</code></label>
+<def><p>matches any <termref def='dt-character'>character</termref>
+with a value <emph>outside</emph> the
+range indicated.</p></def>
+</gitem>
+<gitem>
+<label><code>[^abc]</code>, <code>[^#xN#xN#xN]</code></label>
+<def><p>matches any <termref def='dt-character'>character</termref>
+with a value not among the characters given.</p></def>
+</gitem>
+<gitem>
+<label><code>"string"</code></label>
+<def><p>matches a literal string <termref def="dt-match">matching</termref>
+that given inside the double quotes.</p></def>
+</gitem>
+<gitem>
+<label><code>'string'</code></label>
+<def><p>matches a literal string <termref def="dt-match">matching</termref>
+that given inside the single quotes.</p></def>
+</gitem>
+</glist>
+These symbols may be combined to match more complex patterns as follows,
+where <code>A</code> and <code>B</code> represent simple expressions:
+<glist>
+<gitem>
+<label>(<code>expression</code>)</label>
+<def><p><code>expression</code> is treated as a unit
+and may be combined as described in this list.</p></def>
+</gitem>
+<gitem>
+<label><code>A?</code></label>
+<def><p>matches <code>A</code> or nothing; optional <code>A</code>.</p></def>
+</gitem>
+<gitem>
+<label><code>A B</code></label>
+<def><p>matches <code>A</code> followed by <code>B</code>.</p></def>
+</gitem>
+<gitem>
+<label><code>A | B</code></label>
+<def><p>matches <code>A</code> or <code>B</code> but not both.</p></def>
+</gitem>
+<gitem>
+<label><code>A - B</code></label>
+<def><p>matches any string that matches <code>A</code> but does not match
+<code>B</code>.
+</p></def>
+</gitem>
+<gitem>
+<label><code>A+</code></label>
+<def><p>matches one or more occurrences of <code>A</code>.</p></def>
+</gitem>
+<gitem>
+<label><code>A*</code></label>
+<def><p>matches zero or more occurrences of <code>A</code>.</p></def>
+</gitem>
+
+</glist>
+Other notations used in the productions are:
+<glist>
+<gitem>
+<label><code>/* ... */</code></label>
+<def><p>comment.</p></def>
+</gitem>
+<gitem>
+<label><code>[ wfc: ... ]</code></label>
+<def><p>well-formedness constraint; this identifies by name a
+constraint on
+<termref def="dt-wellformed">well-formed</termref> documents
+associated with a production.</p></def>
+</gitem>
+<gitem>
+<label><code>[ vc: ... ]</code></label>
+<def><p>validity constraint; this identifies by name a constraint on
+<termref def="dt-valid">valid</termref> documents associated with
+a production.</p></def>
+</gitem>
+</glist>
+</p></div1>
+
+</body>
+<back>
+<!-- &SGML; -->
+
+
+<!-- &Biblio; -->
+<div1 id='sec-bibliography'>
+
+<head>References</head>
+<div2 id='sec-existing-stds'>
+<head>Normative References</head>
+
+<blist>
+<bibl id='IANA' key='IANA'>
+(Internet Assigned Numbers Authority) <emph>Official Names for
+Character Sets</emph>,
+ed. Keld Simonsen et al.
+See <loc href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets</loc>.
+</bibl>
+
+<bibl id='RFC1766' key='IETF RFC 1766'>
+IETF (Internet Engineering Task Force).
+<emph>RFC 1766: Tags for the Identification of Languages</emph>,
+ed. H. Alvestrand.
+1995.
+</bibl>
+
+<bibl id='ISO639' key='ISO 639'>
+(International Organization for Standardization).
+<emph>ISO 639:1988 (E).
+Code for the representation of names of languages.</emph>
+[Geneva]: International Organization for
+Standardization, 1988.</bibl>
+
+<bibl id='ISO3166' key='ISO 3166'>
+(International Organization for Standardization).
+<emph>ISO 3166-1:1997 (E).
+Codes for the representation of names of countries and their subdivisions
+&mdash; Part 1: Country codes</emph>
+[Geneva]: International Organization for
+Standardization, 1997.</bibl>
+
+<bibl id='ISO10646' key='ISO/IEC 10646'>ISO
+(International Organization for Standardization).
+<emph>ISO/IEC 10646-1993 (E). Information technology &mdash; Universal
+Multiple-Octet Coded Character Set (UCS) &mdash; Part 1:
+Architecture and Basic Multilingual Plane.</emph>
+[Geneva]: International Organization for
+Standardization, 1993 (plus amendments AM 1 through AM 7).
+</bibl>
+
+<bibl id='Unicode' key='Unicode'>The Unicode Consortium.
+<emph>The Unicode Standard, Version 2.0.</emph>
+Reading, Mass.: Addison-Wesley Developers Press, 1996.</bibl>
+
+</blist>
+
+</div2>
+
+<div2><head>Other References</head>
+
+<blist>
+
+<bibl id='Aho' key='Aho/Ullman'>Aho, Alfred V.,
+Ravi Sethi, and Jeffrey D. Ullman.
+<emph>Compilers: Principles, Techniques, and Tools</emph>.
+Reading: Addison-Wesley, 1986, rpt. corr. 1988.</bibl>
+
+<bibl id="Berners-Lee" xml-link="simple" key="Berners-Lee et al.">
+Berners-Lee, T., R. Fielding, and L. Masinter.
+<emph>Uniform Resource Identifiers (URI): Generic Syntax and
+Semantics</emph>.
+1997.
+(Work in progress; see updates to RFC1738.)</bibl>
+
+<bibl id='ABK' key='Brüggemann-Klein'>Brüggemann-Klein, Anne.
+<emph>Regular Expressions into Finite Automata</emph>.
+Extended abstract in I. Simon, Hrsg., LATIN 1992,
+S. 97-98. Springer-Verlag, Berlin 1992.
+Full Version in Theoretical Computer Science 120: 197-213, 1993.
+
+</bibl>
+
+<bibl id='ABKDW' key='Brüggemann-Klein and Wood'>Brüggemann-Klein, Anne,
+and Derick Wood.
+<emph>Deterministic Regular Languages</emph>.
+Universität Freiburg, Institut für Informatik,
+Bericht 38, Oktober 1991.
+</bibl>
+
+<bibl id='Clark' key='Clark'>James Clark.
+Comparison of SGML and XML. See
+<loc href='http://www.w3.org/TR/NOTE-sgml-xml-971215'>http://www.w3.org/TR/NOTE-sgml-xml-971215</loc>.
+</bibl>
+<bibl id="RFC1738" xml-link="simple" key="IETF RFC1738">
+IETF (Internet Engineering Task Force).
+<emph>RFC 1738: Uniform Resource Locators (URL)</emph>,
+ed. T. Berners-Lee, L. Masinter, M. McCahill.
+1994.
+</bibl>
+
+<bibl id="RFC1808" xml-link="simple" key="IETF RFC1808">
+IETF (Internet Engineering Task Force).
+<emph>RFC 1808: Relative Uniform Resource Locators</emph>,
+ed. R. Fielding.
+1995.
+</bibl>
+
+<bibl id="RFC2141" xml-link="simple" key="IETF RFC2141">
+IETF (Internet Engineering Task Force).
+<emph>RFC 2141: URN Syntax</emph>,
+ed. R. Moats.
+1997.
+</bibl>
+
+<bibl id='ISO8879' key='ISO 8879'>ISO
+(International Organization for Standardization).
+<emph>ISO 8879:1986(E). Information processing &mdash; Text and Office
+Systems &mdash; Standard Generalized Markup Language (SGML).</emph> First
+edition &mdash; 1986-10-15. [Geneva]: International Organization for
+Standardization, 1986.
+</bibl>
+
+
+<bibl id='ISO10744' key='ISO/IEC 10744'>ISO
+(International Organization for Standardization).
+<emph>ISO/IEC 10744-1992 (E). Information technology &mdash;
+Hypermedia/Time-based Structuring Language (HyTime).
+</emph>
+[Geneva]: International Organization for
+Standardization, 1992.
+<emph>Extended Facilities Annexe.</emph>
+[Geneva]: International Organization for
+Standardization, 1996.
+</bibl>
+
+
+
+</blist>
+</div2>
+</div1>
+<div1 id='CharClasses'>
+<head>Character Classes</head>
+<p>Following the characteristics defined in the Unicode standard,
+characters are classed as base characters (among others, these
+contain the alphabetic characters of the Latin alphabet, without
+diacritics), ideographic characters, and combining characters (among
+others, this class contains most diacritics); these classes combine
+to form the class of letters. Digits and extenders are
+also distinguished.
+<scrap lang="ebnf" id="CHARACTERS">
+<head>Characters</head>
+<prodgroup pcw3="3" pcw4="15">
+<prod id="NT-Letter"><lhs>Letter</lhs>
+<rhs><nt def="NT-BaseChar">BaseChar</nt>
+| <nt def="NT-Ideographic">Ideographic</nt></rhs> </prod>
+<prod id='NT-BaseChar'><lhs>BaseChar</lhs>
+<rhs>[#x0041-#x005A]
+|&nbsp;[#x0061-#x007A]
+|&nbsp;[#x00C0-#x00D6]
+|&nbsp;[#x00D8-#x00F6]
+|&nbsp;[#x00F8-#x00FF]
+|&nbsp;[#x0100-#x0131]
+|&nbsp;[#x0134-#x013E]
+|&nbsp;[#x0141-#x0148]
+|&nbsp;[#x014A-#x017E]
+|&nbsp;[#x0180-#x01C3]
+|&nbsp;[#x01CD-#x01F0]
+|&nbsp;[#x01F4-#x01F5]
+|&nbsp;[#x01FA-#x0217]
+|&nbsp;[#x0250-#x02A8]
+|&nbsp;[#x02BB-#x02C1]
+|&nbsp;#x0386
+|&nbsp;[#x0388-#x038A]
+|&nbsp;#x038C
+|&nbsp;[#x038E-#x03A1]
+|&nbsp;[#x03A3-#x03CE]
+|&nbsp;[#x03D0-#x03D6]
+|&nbsp;#x03DA
+|&nbsp;#x03DC
+|&nbsp;#x03DE
+|&nbsp;#x03E0
+|&nbsp;[#x03E2-#x03F3]
+|&nbsp;[#x0401-#x040C]
+|&nbsp;[#x040E-#x044F]
+|&nbsp;[#x0451-#x045C]
+|&nbsp;[#x045E-#x0481]
+|&nbsp;[#x0490-#x04C4]
+|&nbsp;[#x04C7-#x04C8]
+|&nbsp;[#x04CB-#x04CC]
+|&nbsp;[#x04D0-#x04EB]
+|&nbsp;[#x04EE-#x04F5]
+|&nbsp;[#x04F8-#x04F9]
+|&nbsp;[#x0531-#x0556]
+|&nbsp;#x0559
+|&nbsp;[#x0561-#x0586]
+|&nbsp;[#x05D0-#x05EA]
+|&nbsp;[#x05F0-#x05F2]
+|&nbsp;[#x0621-#x063A]
+|&nbsp;[#x0641-#x064A]
+|&nbsp;[#x0671-#x06B7]
+|&nbsp;[#x06BA-#x06BE]
+|&nbsp;[#x06C0-#x06CE]
+|&nbsp;[#x06D0-#x06D3]
+|&nbsp;#x06D5
+|&nbsp;[#x06E5-#x06E6]
+|&nbsp;[#x0905-#x0939]
+|&nbsp;#x093D
+|&nbsp;[#x0958-#x0961]
+|&nbsp;[#x0985-#x098C]
+|&nbsp;[#x098F-#x0990]
+|&nbsp;[#x0993-#x09A8]
+|&nbsp;[#x09AA-#x09B0]
+|&nbsp;#x09B2
+|&nbsp;[#x09B6-#x09B9]
+|&nbsp;[#x09DC-#x09DD]
+|&nbsp;[#x09DF-#x09E1]
+|&nbsp;[#x09F0-#x09F1]
+|&nbsp;[#x0A05-#x0A0A]
+|&nbsp;[#x0A0F-#x0A10]
+|&nbsp;[#x0A13-#x0A28]
+|&nbsp;[#x0A2A-#x0A30]
+|&nbsp;[#x0A32-#x0A33]
+|&nbsp;[#x0A35-#x0A36]
+|&nbsp;[#x0A38-#x0A39]
+|&nbsp;[#x0A59-#x0A5C]
+|&nbsp;#x0A5E
+|&nbsp;[#x0A72-#x0A74]
+|&nbsp;[#x0A85-#x0A8B]
+|&nbsp;#x0A8D
+|&nbsp;[#x0A8F-#x0A91]
+|&nbsp;[#x0A93-#x0AA8]
+|&nbsp;[#x0AAA-#x0AB0]
+|&nbsp;[#x0AB2-#x0AB3]
+|&nbsp;[#x0AB5-#x0AB9]
+|&nbsp;#x0ABD
+|&nbsp;#x0AE0
+|&nbsp;[#x0B05-#x0B0C]
+|&nbsp;[#x0B0F-#x0B10]
+|&nbsp;[#x0B13-#x0B28]
+|&nbsp;[#x0B2A-#x0B30]
+|&nbsp;[#x0B32-#x0B33]
+|&nbsp;[#x0B36-#x0B39]
+|&nbsp;#x0B3D
+|&nbsp;[#x0B5C-#x0B5D]
+|&nbsp;[#x0B5F-#x0B61]
+|&nbsp;[#x0B85-#x0B8A]
+|&nbsp;[#x0B8E-#x0B90]
+|&nbsp;[#x0B92-#x0B95]
+|&nbsp;[#x0B99-#x0B9A]
+|&nbsp;#x0B9C
+|&nbsp;[#x0B9E-#x0B9F]
+|&nbsp;[#x0BA3-#x0BA4]
+|&nbsp;[#x0BA8-#x0BAA]
+|&nbsp;[#x0BAE-#x0BB5]
+|&nbsp;[#x0BB7-#x0BB9]
+|&nbsp;[#x0C05-#x0C0C]
+|&nbsp;[#x0C0E-#x0C10]
+|&nbsp;[#x0C12-#x0C28]
+|&nbsp;[#x0C2A-#x0C33]
+|&nbsp;[#x0C35-#x0C39]
+|&nbsp;[#x0C60-#x0C61]
+|&nbsp;[#x0C85-#x0C8C]
+|&nbsp;[#x0C8E-#x0C90]
+|&nbsp;[#x0C92-#x0CA8]
+|&nbsp;[#x0CAA-#x0CB3]
+|&nbsp;[#x0CB5-#x0CB9]
+|&nbsp;#x0CDE
+|&nbsp;[#x0CE0-#x0CE1]
+|&nbsp;[#x0D05-#x0D0C]
+|&nbsp;[#x0D0E-#x0D10]
+|&nbsp;[#x0D12-#x0D28]
+|&nbsp;[#x0D2A-#x0D39]
+|&nbsp;[#x0D60-#x0D61]
+|&nbsp;[#x0E01-#x0E2E]
+|&nbsp;#x0E30
+|&nbsp;[#x0E32-#x0E33]
+|&nbsp;[#x0E40-#x0E45]
+|&nbsp;[#x0E81-#x0E82]
+|&nbsp;#x0E84
+|&nbsp;[#x0E87-#x0E88]
+|&nbsp;#x0E8A
+|&nbsp;#x0E8D
+|&nbsp;[#x0E94-#x0E97]
+|&nbsp;[#x0E99-#x0E9F]
+|&nbsp;[#x0EA1-#x0EA3]
+|&nbsp;#x0EA5
+|&nbsp;#x0EA7
+|&nbsp;[#x0EAA-#x0EAB]
+|&nbsp;[#x0EAD-#x0EAE]
+|&nbsp;#x0EB0
+|&nbsp;[#x0EB2-#x0EB3]
+|&nbsp;#x0EBD
+|&nbsp;[#x0EC0-#x0EC4]
+|&nbsp;[#x0F40-#x0F47]
+|&nbsp;[#x0F49-#x0F69]
+|&nbsp;[#x10A0-#x10C5]
+|&nbsp;[#x10D0-#x10F6]
+|&nbsp;#x1100
+|&nbsp;[#x1102-#x1103]
+|&nbsp;[#x1105-#x1107]
+|&nbsp;#x1109
+|&nbsp;[#x110B-#x110C]
+|&nbsp;[#x110E-#x1112]
+|&nbsp;#x113C
+|&nbsp;#x113E
+|&nbsp;#x1140
+|&nbsp;#x114C
+|&nbsp;#x114E
+|&nbsp;#x1150
+|&nbsp;[#x1154-#x1155]
+|&nbsp;#x1159
+|&nbsp;[#x115F-#x1161]
+|&nbsp;#x1163
+|&nbsp;#x1165
+|&nbsp;#x1167
+|&nbsp;#x1169
+|&nbsp;[#x116D-#x116E]
+|&nbsp;[#x1172-#x1173]
+|&nbsp;#x1175
+|&nbsp;#x119E
+|&nbsp;#x11A8
+|&nbsp;#x11AB
+|&nbsp;[#x11AE-#x11AF]
+|&nbsp;[#x11B7-#x11B8]
+|&nbsp;#x11BA
+|&nbsp;[#x11BC-#x11C2]
+|&nbsp;#x11EB
+|&nbsp;#x11F0
+|&nbsp;#x11F9
+|&nbsp;[#x1E00-#x1E9B]
+|&nbsp;[#x1EA0-#x1EF9]
+|&nbsp;[#x1F00-#x1F15]
+|&nbsp;[#x1F18-#x1F1D]
+|&nbsp;[#x1F20-#x1F45]
+|&nbsp;[#x1F48-#x1F4D]
+|&nbsp;[#x1F50-#x1F57]
+|&nbsp;#x1F59
+|&nbsp;#x1F5B
+|&nbsp;#x1F5D
+|&nbsp;[#x1F5F-#x1F7D]
+|&nbsp;[#x1F80-#x1FB4]
+|&nbsp;[#x1FB6-#x1FBC]
+|&nbsp;#x1FBE
+|&nbsp;[#x1FC2-#x1FC4]
+|&nbsp;[#x1FC6-#x1FCC]
+|&nbsp;[#x1FD0-#x1FD3]
+|&nbsp;[#x1FD6-#x1FDB]
+|&nbsp;[#x1FE0-#x1FEC]
+|&nbsp;[#x1FF2-#x1FF4]
+|&nbsp;[#x1FF6-#x1FFC]
+|&nbsp;#x2126
+|&nbsp;[#x212A-#x212B]
+|&nbsp;#x212E
+|&nbsp;[#x2180-#x2182]
+|&nbsp;[#x3041-#x3094]
+|&nbsp;[#x30A1-#x30FA]
+|&nbsp;[#x3105-#x312C]
+|&nbsp;[#xAC00-#xD7A3]
+</rhs></prod>
+<prod id='NT-Ideographic'><lhs>Ideographic</lhs>
+<rhs>[#x4E00-#x9FA5]
+|&nbsp;#x3007
+|&nbsp;[#x3021-#x3029]
+</rhs></prod>
+<prod id='NT-CombiningChar'><lhs>CombiningChar</lhs>
+<rhs>[#x0300-#x0345]
+|&nbsp;[#x0360-#x0361]
+|&nbsp;[#x0483-#x0486]
+|&nbsp;[#x0591-#x05A1]
+|&nbsp;[#x05A3-#x05B9]
+|&nbsp;[#x05BB-#x05BD]
+|&nbsp;#x05BF
+|&nbsp;[#x05C1-#x05C2]
+|&nbsp;#x05C4
+|&nbsp;[#x064B-#x0652]
+|&nbsp;#x0670
+|&nbsp;[#x06D6-#x06DC]
+|&nbsp;[#x06DD-#x06DF]
+|&nbsp;[#x06E0-#x06E4]
+|&nbsp;[#x06E7-#x06E8]
+|&nbsp;[#x06EA-#x06ED]
+|&nbsp;[#x0901-#x0903]
+|&nbsp;#x093C
+|&nbsp;[#x093E-#x094C]
+|&nbsp;#x094D
+|&nbsp;[#x0951-#x0954]
+|&nbsp;[#x0962-#x0963]
+|&nbsp;[#x0981-#x0983]
+|&nbsp;#x09BC
+|&nbsp;#x09BE
+|&nbsp;#x09BF
+|&nbsp;[#x09C0-#x09C4]
+|&nbsp;[#x09C7-#x09C8]
+|&nbsp;[#x09CB-#x09CD]
+|&nbsp;#x09D7
+|&nbsp;[#x09E2-#x09E3]
+|&nbsp;#x0A02
+|&nbsp;#x0A3C
+|&nbsp;#x0A3E
+|&nbsp;#x0A3F
+|&nbsp;[#x0A40-#x0A42]
+|&nbsp;[#x0A47-#x0A48]
+|&nbsp;[#x0A4B-#x0A4D]
+|&nbsp;[#x0A70-#x0A71]
+|&nbsp;[#x0A81-#x0A83]
+|&nbsp;#x0ABC
+|&nbsp;[#x0ABE-#x0AC5]
+|&nbsp;[#x0AC7-#x0AC9]
+|&nbsp;[#x0ACB-#x0ACD]
+|&nbsp;[#x0B01-#x0B03]
+|&nbsp;#x0B3C
+|&nbsp;[#x0B3E-#x0B43]
+|&nbsp;[#x0B47-#x0B48]
+|&nbsp;[#x0B4B-#x0B4D]
+|&nbsp;[#x0B56-#x0B57]
+|&nbsp;[#x0B82-#x0B83]
+|&nbsp;[#x0BBE-#x0BC2]
+|&nbsp;[#x0BC6-#x0BC8]
+|&nbsp;[#x0BCA-#x0BCD]
+|&nbsp;#x0BD7
+|&nbsp;[#x0C01-#x0C03]
+|&nbsp;[#x0C3E-#x0C44]
+|&nbsp;[#x0C46-#x0C48]
+|&nbsp;[#x0C4A-#x0C4D]
+|&nbsp;[#x0C55-#x0C56]
+|&nbsp;[#x0C82-#x0C83]
+|&nbsp;[#x0CBE-#x0CC4]
+|&nbsp;[#x0CC6-#x0CC8]
+|&nbsp;[#x0CCA-#x0CCD]
+|&nbsp;[#x0CD5-#x0CD6]
+|&nbsp;[#x0D02-#x0D03]
+|&nbsp;[#x0D3E-#x0D43]
+|&nbsp;[#x0D46-#x0D48]
+|&nbsp;[#x0D4A-#x0D4D]
+|&nbsp;#x0D57
+|&nbsp;#x0E31
+|&nbsp;[#x0E34-#x0E3A]
+|&nbsp;[#x0E47-#x0E4E]
+|&nbsp;#x0EB1
+|&nbsp;[#x0EB4-#x0EB9]
+|&nbsp;[#x0EBB-#x0EBC]
+|&nbsp;[#x0EC8-#x0ECD]
+|&nbsp;[#x0F18-#x0F19]
+|&nbsp;#x0F35
+|&nbsp;#x0F37
+|&nbsp;#x0F39
+|&nbsp;#x0F3E
+|&nbsp;#x0F3F
+|&nbsp;[#x0F71-#x0F84]
+|&nbsp;[#x0F86-#x0F8B]
+|&nbsp;[#x0F90-#x0F95]
+|&nbsp;#x0F97
+|&nbsp;[#x0F99-#x0FAD]
+|&nbsp;[#x0FB1-#x0FB7]
+|&nbsp;#x0FB9
+|&nbsp;[#x20D0-#x20DC]
+|&nbsp;#x20E1
+|&nbsp;[#x302A-#x302F]
+|&nbsp;#x3099
+|&nbsp;#x309A
+</rhs></prod>
+<prod id='NT-Digit'><lhs>Digit</lhs>
+<rhs>[#x0030-#x0039]
+|&nbsp;[#x0660-#x0669]
+|&nbsp;[#x06F0-#x06F9]
+|&nbsp;[#x0966-#x096F]
+|&nbsp;[#x09E6-#x09EF]
+|&nbsp;[#x0A66-#x0A6F]
+|&nbsp;[#x0AE6-#x0AEF]
+|&nbsp;[#x0B66-#x0B6F]
+|&nbsp;[#x0BE7-#x0BEF]
+|&nbsp;[#x0C66-#x0C6F]
+|&nbsp;[#x0CE6-#x0CEF]
+|&nbsp;[#x0D66-#x0D6F]
+|&nbsp;[#x0E50-#x0E59]
+|&nbsp;[#x0ED0-#x0ED9]
+|&nbsp;[#x0F20-#x0F29]
+</rhs></prod>
+<prod id='NT-Extender'><lhs>Extender</lhs>
+<rhs>#x00B7
+|&nbsp;#x02D0
+|&nbsp;#x02D1
+|&nbsp;#x0387
+|&nbsp;#x0640
+|&nbsp;#x0E46
+|&nbsp;#x0EC6
+|&nbsp;#x3005
+|&nbsp;[#x3031-#x3035]
+|&nbsp;[#x309D-#x309E]
+|&nbsp;[#x30FC-#x30FE]
+</rhs></prod>
+
+</prodgroup>
+</scrap>
+</p>
+<p>The character classes defined here can be derived from the
+Unicode character database as follows:
+<ulist>
+<item>
+<p>Name start characters must have one of the categories Ll, Lu,
+Lo, Lt, Nl.</p>
+</item>
+<item>
+<p>Name characters other than Name-start characters
+must have one of the categories Mc, Me, Mn, Lm, or Nd.</p>
+</item>
+<item>
+<p>Characters in the compatibility area (i.e. with character code
+greater than #xF900 and less than #xFFFE) are not allowed in XML
+names.</p>
+</item>
+<item>
+<p>Characters which have a font or compatibility decomposition (i.e. those
+with a "compatibility formatting tag" in field 5 of the database --
+marked by field 5 beginning with a "&lt;") are not allowed.</p>
+</item>
+<item>
+<p>The following characters are treated as name-start characters
+rather than name characters, because the property file classifies
+them as Alphabetic: [#x02BB-#x02C1], #x0559, #x06E5, #x06E6.</p>
+</item>
+<item>
+<p>Characters #x20DD-#x20E0 are excluded (in accordance with
+Unicode, section 5.14).</p>
+</item>
+<item>
+<p>Character #x00B7 is classified as an extender, because the
+property list so identifies it.</p>
+</item>
+<item>
+<p>Character #x0387 is added as a name character, because #x00B7
+is its canonical equivalent.</p>
+</item>
+<item>
+<p>Characters ':' and '_' are allowed as name-start characters.</p>
+</item>
+<item>
+<p>Characters '-' and '.' are allowed as name characters.</p>
+</item>
+</ulist>
+</p>
+</div1>
+<inform-div1 id="sec-xml-and-sgml">
+<head>XML and SGML</head>
+
+<p>XML is designed to be a subset of SGML, in that every
+<termref def="dt-valid">valid</termref> XML document should also be a
+conformant SGML document.
+For a detailed comparison of the additional restrictions that XML places on
+documents beyond those of SGML, see <bibref ref='Clark'/>.
+</p>
+</inform-div1>
+<inform-div1 id="sec-entexpand">
+<head>Expansion of Entity and Character References</head>
+<p>This appendix contains some examples illustrating the
+sequence of entity- and character-reference recognition and
+expansion, as specified in <specref ref='entproc'/>.</p>
+<p>
+If the DTD contains the declaration
+<eg><![CDATA[<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
+numerically (&#38;#38;#38;) or with a general entity
+(&amp;amp;).</p>" >
+]]></eg>
+then the XML processor will recognize the character references
+when it parses the entity declaration, and resolve them before
+storing the following string as the
+value of the entity "<code>example</code>":
+<eg><![CDATA[<p>An ampersand (&#38;) may be escaped
+numerically (&#38;#38;) or with a general entity
+(&amp;amp;).</p>
+]]></eg>
+A reference in the document to "<code>&amp;example;</code>"
+will cause the text to be reparsed, at which time the
+start- and end-tags of the "<code>p</code>" element will be recognized
+and the three references will be recognized and expanded,
+resulting in a "<code>p</code>" element with the following content
+(all data, no delimiters or markup):
+<eg><![CDATA[An ampersand (&) may be escaped
+numerically (&#38;) or with a general entity
+(&amp;).
+]]></eg>
+</p>
+<p>A more complex example will illustrate the rules and their
+effects fully. In the following example, the line numbers are
+solely for reference.
+<eg><![CDATA[1 <?xml version='1.0'?>
+2 <!DOCTYPE test [
+3 <!ELEMENT test (#PCDATA) >
+4 <!ENTITY % xx '&#37;zz;'>
+5 <!ENTITY % zz '&#60;!ENTITY tricky "error-prone" >' >
+6 %xx;
+7 ]>
+8 <test>This sample shows a &tricky; method.</test>
+]]></eg>
+This produces the following:
+<ulist spacing="compact">
+<item><p>in line 4, the reference to character 37 is expanded immediately,
+and the parameter entity "<code>xx</code>" is stored in the symbol
+table with the value "<code>%zz;</code>". Since the replacement text
+is not rescanned, the reference to parameter entity "<code>zz</code>"
+is not recognized. (And it would be an error if it were, since
+"<code>zz</code>" is not yet declared.)</p></item>
+<item><p>in line 5, the character reference "<code>&amp;#60;</code>" is
+expanded immediately and the parameter entity "<code>zz</code>" is
+stored with the replacement text
+"<code>&lt;!ENTITY tricky "error-prone" ></code>",
+which is a well-formed entity declaration.</p></item>
+<item><p>in line 6, the reference to "<code>xx</code>" is recognized,
+and the replacement text of "<code>xx</code>" (namely
+"<code>%zz;</code>") is parsed. The reference to "<code>zz</code>"
+is recognized in its turn, and its replacement text
+("<code>&lt;!ENTITY tricky "error-prone" ></code>") is parsed.
+The general entity "<code>tricky</code>" has now been
+declared, with the replacement text "<code>error-prone</code>".</p></item>
+<item><p>
+in line 8, the reference to the general entity "<code>tricky</code>" is
+recognized, and it is expanded, so the full content of the
+"<code>test</code>" element is the self-describing (and ungrammatical) string
+<emph>This sample shows a error-prone method.</emph>
+</p></item>
+</ulist>
+</p>
+</inform-div1>
+<inform-div1 id="determinism">
+<head>Deterministic Content Models</head>
+<p><termref def='dt-compat'>For compatibility</termref>, it is
+required
+that content models in element type declarations be deterministic.
+</p>
+<!-- FINAL EDIT: WebSGML allows ambiguity? -->
+<p>SGML
+requires deterministic content models (it calls them
+"unambiguous"); XML processors built using SGML systems may
+flag non-deterministic content models as errors.</p>
+<p>For example, the content model <code>((b, c) | (b, d))</code> is
+non-deterministic, because given an initial <code>b</code> the parser
+cannot know which <code>b</code> in the model is being matched without
+looking ahead to see which element follows the <code>b</code>.
+In this case, the two references to
+<code>b</code> can be collapsed
+into a single reference, making the model read
+<code>(b, (c | d))</code>. An initial <code>b</code> now clearly
+matches only a single name in the content model. The parser doesn't
+need to look ahead to see what follows; either <code>c</code> or
+<code>d</code> would be accepted.</p>
+<p>More formally: a finite state automaton may be constructed from the
+content model using the standard algorithms, e.g. algorithm 3.5
+in section 3.9
+of Aho, Sethi, and Ullman <bibref ref='Aho'/>.
+In many such algorithms, a follow set is constructed for each
+position in the regular expression (i.e., each leaf
+node in the
+syntax tree for the regular expression);
+if any position has a follow set in which
+more than one following position is
+labeled with the same element type name,
+then the content model is in error
+and may be reported as an error.
+</p>
+<p>Algorithms exist which allow many but not all non-deterministic
+content models to be reduced automatically to equivalent deterministic
+models; see Brüggemann-Klein 1991 <bibref ref='ABK'/>.</p>
+</inform-div1>
+<inform-div1 id="sec-guessing">
+<head>Autodetection of Character Encodings</head>
+<p>The XML encoding declaration functions as an internal label on each
+entity, indicating which character encoding is in use. Before an XML
+processor can read the internal label, however, it apparently has to
+know what character encoding is in use&mdash;which is what the internal label
+is trying to indicate. In the general case, this is a hopeless
+situation. It is not entirely hopeless in XML, however, because XML
+limits the general case in two ways: each implementation is assumed
+to support only a finite set of character encodings, and the XML
+encoding declaration is restricted in position and content in order to
+make it feasible to autodetect the character encoding in use in each
+entity in normal cases. Also, in many cases other sources of information
+are available in addition to the XML data stream itself.
+Two cases may be distinguished,
+depending on whether the XML entity is presented to the
+processor without, or with, any accompanying
+(external) information. We consider the first case first.
+</p>
+<p>
+Because each XML entity not in UTF-8 or UTF-16 format <emph>must</emph>
+begin with an XML encoding declaration, in which the first characters
+must be '<code>&lt;?xml</code>', any conforming processor can detect,
+after two to four octets of input, which of the following cases apply.
+In reading this list, it may help to know that in UCS-4, '&lt;' is
+"<code>#x0000003C</code>" and '?' is "<code>#x0000003F</code>", and the Byte
+Order Mark required of UTF-16 data streams is "<code>#xFEFF</code>".</p>
+<p>
+<ulist>
+<item>
+<p><code>00 00 00 3C</code>: UCS-4, big-endian machine (1234 order)</p>
+</item>
+<item>
+<p><code>3C 00 00 00</code>: UCS-4, little-endian machine (4321 order)</p>
+</item>
+<item>
+<p><code>00 00 3C 00</code>: UCS-4, unusual octet order (2143)</p>
+</item>
+<item>
+<p><code>00 3C 00 00</code>: UCS-4, unusual octet order (3412)</p>
+</item>
+<item>
+<p><code>FE FF</code>: UTF-16, big-endian</p>
+</item>
+<item>
+<p><code>FF FE</code>: UTF-16, little-endian</p>
+</item>
+<item>
+<p><code>00 3C 00 3F</code>: UTF-16, big-endian, no Byte Order Mark
+(and thus, strictly speaking, in error)</p>
+</item>
+<item>
+<p><code>3C 00 3F 00</code>: UTF-16, little-endian, no Byte Order Mark
+(and thus, strictly speaking, in error)</p>
+</item>
+<item>
+<p><code>3C 3F 78 6D</code>: UTF-8, ISO 646, ASCII, some part of ISO 8859,
+Shift-JIS, EUC, or any other 7-bit, 8-bit, or mixed-width encoding
+which ensures that the characters of ASCII have their normal positions,
+width,
+and values; the actual encoding declaration must be read to
+detect which of these applies, but since all of these encodings
+use the same bit patterns for the ASCII characters, the encoding
+declaration itself may be read reliably
+</p>
+</item>
+<item>
+<p><code>4C 6F A7 94</code>: EBCDIC (in some flavor; the full
+encoding declaration must be read to tell which code page is in
+use)</p>
+</item>
+<item>
+<p>other: UTF-8 without an encoding declaration, or else
+the data stream is corrupt, fragmentary, or enclosed in
+a wrapper of some kind</p>
+</item>
+</ulist>
+</p>
+<p>
+This level of autodetection is enough to read the XML encoding
+declaration and parse the character-encoding identifier, which is
+still necessary to distinguish the individual members of each family
+of encodings (e.g. to tell UTF-8 from 8859, and the parts of 8859
+from each other, or to distinguish the specific EBCDIC code page in
+use, and so on).
+</p>
+<p>
+Because the contents of the encoding declaration are restricted to
+ASCII characters, a processor can reliably read the entire encoding
+declaration as soon as it has detected which family of encodings is in
+use. Since in practice, all widely used character encodings fall into
+one of the categories above, the XML encoding declaration allows
+reasonably reliable in-band labeling of character encodings, even when
+external sources of information at the operating-system or
+transport-protocol level are unreliable.
+</p>
+<p>
+Once the processor has detected the character encoding in use, it can
+act appropriately, whether by invoking a separate input routine for
+each case, or by calling the proper conversion function on each
+character of input.
+</p>
+<p>
+Like any self-labeling system, the XML encoding declaration will not
+work if any software changes the entity's character set or encoding
+without updating the encoding declaration. Implementors of
+character-encoding routines should be careful to ensure the accuracy
+of the internal and external information used to label the entity.
+</p>
+<p>The second possible case occurs when the XML entity is accompanied
+by encoding information, as in some file systems and some network
+protocols.
+When multiple sources of information are available,
+
+their relative
+priority and the preferred method of handling conflict should be
+specified as part of the higher-level protocol used to deliver XML.
+Rules for the relative priority of the internal label and the
+MIME-type label in an external header, for example, should be part of the
+RFC document defining the text/xml and application/xml MIME types. In
+the interests of interoperability, however, the following rules
+are recommended.
+<ulist>
+<item><p>If an XML entity is in a file, the Byte-Order Mark
+and encoding-declaration PI are used (if present) to determine the
+character encoding. All other heuristics and sources of information
+are solely for error recovery.
+</p></item>
+<item><p>If an XML entity is delivered with a
+MIME type of text/xml, then the <code>charset</code> parameter
+on the MIME type determines the
+character encoding method; all other heuristics and sources of
+information are solely for error recovery.
+</p></item>
+<item><p>If an XML entity is delivered
+with a
+MIME type of application/xml, then the Byte-Order Mark and
+encoding-declaration PI are used (if present) to determine the
+character encoding. All other heuristics and sources of
+information are solely for error recovery.
+</p></item>
+</ulist>
+These rules apply only in the absence of protocol-level documentation;
+in particular, when the MIME types text/xml and application/xml are
+defined, the recommendations of the relevant RFC will supersede
+these rules.
+</p>
+
+</inform-div1>
+
+<inform-div1 id="sec-xml-wg">
+<head>W3C XML Working Group</head>
+
+<p>This specification was prepared and approved for publication by the
+W3C XML Working Group (WG). WG approval of this specification does
+not necessarily imply that all WG members voted for its approval.
+The current and former members of the XML WG are:</p>
+
+<orglist>
+<member><name>Jon Bosak, Sun</name><role>Chair</role></member>
+<member><name>James Clark</name><role>Technical Lead</role></member>
+<member><name>Tim Bray, Textuality and Netscape</name><role>XML Co-editor</role></member>
+<member><name>Jean Paoli, Microsoft</name><role>XML Co-editor</role></member>
+<member><name>C. M. Sperberg-McQueen, U. of Ill.</name><role>XML
+Co-editor</role></member>
+<member><name>Dan Connolly, W3C</name><role>W3C Liaison</role></member>
+<member><name>Paula Angerstein, Texcel</name></member>
+<member><name>Steve DeRose, INSO</name></member>
+<member><name>Dave Hollander, HP</name></member>
+<member><name>Eliot Kimber, ISOGEN</name></member>
+<member><name>Eve Maler, ArborText</name></member>
+<member><name>Tom Magliery, NCSA</name></member>
+<member><name>Murray Maloney, Muzmo and Grif</name></member>
+<member><name>Makoto Murata, Fuji Xerox Information Systems</name></member>
+<member><name>Joel Nava, Adobe</name></member>
+<member><name>Conleth O'Connell, Vignette</name></member>
+<member><name>Peter Sharpe, SoftQuad</name></member>
+<member><name>John Tigue, DataChannel</name></member>
+</orglist>
+
+</inform-div1>
+</back>
+</spec>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-default-dtd-file:"~/sgml/spec.ced"
+sgml-omittag:t
+sgml-shorttag:t
+End:
+-->
diff --git a/test/valid/dia.xml b/test/valid/dia.xml
new file mode 100644
index 00000000..d8192e45
--- /dev/null
+++ b/test/valid/dia.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+<!DOCTYPE diagram [
+<!ELEMENT diagram (diagramdata, (layer)*) >
+
+<!ELEMENT diagramdata (attribute)* >
+
+<!ELEMENT layer (object | group)*>
+<!ATTLIST layer
+ name CDATA #REQUIRED
+ visible (true|false) #REQUIRED >
+
+<!ELEMENT object ((attribute)*, connections?)>
+<!ATTLIST object
+ type CDATA #REQUIRED
+ version NMTOKEN #REQUIRED
+ id ID #REQUIRED >
+
+<!ELEMENT connections (connection)*>
+
+<!ELEMENT connection EMPTY>
+<!ATTLIST connection
+ handle NMTOKEN #REQUIRED
+ to IDREF #REQUIRED
+ connection NMTOKEN #REQUIRED>
+
+<!ELEMENT group (object | group)*>
+
+<!ELEMENT attribute (composite | int | enum | real | boolean |
+ color | point | rectangle | string | font)*>
+<!ATTLIST attribute name CDATA #REQUIRED >
+
+<!ELEMENT composite (attribute)*>
+<!ATTLIST composite type CDATA #IMPLIED>
+
+<!ELEMENT int EMPTY>
+<!ATTLIST int val NMTOKEN #REQUIRED>
+
+<!ELEMENT enum EMPTY>
+<!ATTLIST enum val NMTOKEN #REQUIRED>
+
+<!ELEMENT real EMPTY>
+<!ATTLIST real val CDATA #REQUIRED>
+
+<!ELEMENT boolean EMPTY>
+<!ATTLIST boolean val (true|false) #REQUIRED>
+
+<!ELEMENT color EMPTY>
+<!ATTLIST color val CDATA #REQUIRED>
+
+<!ELEMENT point EMPTY>
+<!ATTLIST point val CDATA #REQUIRED>
+
+<!ELEMENT rectangle EMPTY>
+<!ATTLIST rectangle val CDATA #REQUIRED>
+
+<!ELEMENT string EMPTY>
+<!ATTLIST string val CDATA #IMPLIED>
+
+<!ELEMENT font EMPTY>
+<!ATTLIST font name CDATA #REQUIRED>
+]>
+
+<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/valid/dtds/spec.dtd b/test/valid/dtds/spec.dtd
new file mode 100755
index 00000000..0fdfb863
--- /dev/null
+++ b/test/valid/dtds/spec.dtd
@@ -0,0 +1,972 @@
+<!-- ............................................................... -->
+<!-- XML specification DTD ......................................... -->
+<!-- ............................................................... -->
+
+<!--
+TYPICAL INVOCATION:
+# <!DOCTYPE spec PUBLIC
+# "-//W3C//DTD Specification::19980323//EN"
+# "http://www.w3.org/XML/Group/DTD/xmlspec.dtd">
+
+PURPOSE:
+ This DTD was developed for use with the XML family of W3C
+ specifications. It is an XML-compliant DTD based in part on
+ the TEI Lite and Sweb DTDs.
+
+DEPENDENCIES:
+ None.
+
+CHANGE HISTORY:
+ The list of changes is at the end of the DTD.
+
+ For all details, see the design report at:
+
+ <http://www.w3.org/XML/Group/DTD/xmlspec-report.htm>
+
+ The "typical invocation" FPI always gets updated to reflect the
+ date of the most recent changes.
+
+ Search this file for "#" in the first column to see change history
+ comments.
+
+MAINTAINER:
+ Eve Maler
+ ArborText Inc.
+ elm@arbortext.com
+ voice: +1 781 270 5750
+ fax: +1 781 273 3760
+-->
+
+<!-- ............................................................... -->
+<!-- Entities for characters and symbols ........................... -->
+
+<!--
+#1998-03-10: maler: Added &ldquo; and &rdquo;.
+# Used 8879:1986-compatible decimal character
+# references.
+# Merged charent.mod file back into main file.
+-->
+
+<!ENTITY lt "&#38;#60;">
+<!ENTITY gt "&#62;">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY apos "&#39;">
+<!ENTITY quot "&#34;">
+<!ENTITY mdash "--">
+<!ENTITY nbsp "&#160;">
+<!ENTITY ldquo "#x201C;">
+<!ENTITY rdquo "#x201D;">
+
+<!-- ............................................................... -->
+<!-- Entities for classes of standalone elements ................... -->
+
+<!--
+#1997-10-16: maler: Added table to %illus.class;.
+#1997-11-28: maler: Added htable to %illus.class;.
+#1997-12-29: maler: IGNOREd table.
+#1998-03-10: maler: Removed SGML Open-specific %illus.class;.
+# Added "local" entities for customization.
+-->
+
+<!ENTITY % local.p.class "">
+<!ENTITY % p.class "p
+ %local.p.class;">
+
+<!ENTITY % local.statusp.class "">
+<!ENTITY % statusp.class "statusp
+ %local.statusp.class;">
+
+<!ENTITY % local.list.class "">
+<!ENTITY % list.class "ulist|olist|slist|glist
+ %local.list.class;">
+
+<!ENTITY % local.speclist.class "">
+<!ENTITY % speclist.class "orglist|blist
+ %local.speclist.class;">
+
+<!ENTITY % local.note.class "">
+<!ENTITY % note.class "note|wfcnote|vcnote
+ %local.note.class;">
+
+<!ENTITY % local.illus.class "">
+<!ENTITY % illus.class "eg|graphic|scrap|htable
+ %local.illus.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for classes of phrase-level elements ................. -->
+
+<!--
+#1997-12-29: maler: Added xspecref to %ref.class;.
+#1998-03-10: maler: Added %ednote.class;.
+# Added "local" entities for customization.
+-->
+
+<!ENTITY % local.annot.class "">
+<!ENTITY % annot.class "footnote
+ %local.annot.class;">
+
+<!ENTITY % local.termdef.class "">
+<!ENTITY % termdef.class "termdef|term
+ %local.termdef.class;">
+
+<!ENTITY % local.emph.class "">
+<!ENTITY % emph.class "emph|quote
+ %local.emph.class;">
+
+<!ENTITY % local.ref.class "">
+<!ENTITY % ref.class "bibref|specref|termref|titleref
+ |xspecref|xtermref
+ %local.ref.class;">
+
+<!ENTITY % local.loc.class "">
+<!ENTITY % loc.class "loc
+ %local.loc.class;">
+
+<!ENTITY % local.tech.class "">
+<!ENTITY % tech.class "kw|nt|xnt|code
+ %local.tech.class;">
+
+<!ENTITY % local.ednote.class "">
+<!ENTITY % ednote.class "ednote
+ %local.ednote.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for mixtures of standalone elements .................. -->
+
+<!--
+#1997-09-30: maler: Created %p.mix; to eliminate p from self.
+#1997-09-30: maler: Added %speclist.class; to %obj.mix; and %p.mix;.
+#1997-09-30: maler: Added %note.class; to %obj.mix; and %p.mix;.
+#1997-10-16: maler: Created %entry.mix;. Note that some elements
+# left out here are still allowed in termdef,
+# which entry can contain through %p.pcd.mix;.
+#1997-11-28: maler: Added %p.class; to %statusobj.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures, except
+# %p.mix; and %statusobj.mix;, because paragraphs
+# and status paragraphs will contain ednote
+# through %p.pcd.mix;.
+#1998-03-123: maler: Added %termdef.mix; (broken out from
+# %termdef.pcd.mix;).
+-->
+
+<!ENTITY % div.mix
+ "%p.class;|%list.class;|%speclist.class;|%note.class;
+ |%illus.class;|%ednote.class;">
+<!ENTITY % obj.mix
+ "%p.class;|%list.class;|%speclist.class;|%note.class;
+ |%illus.class;|%ednote.class;">
+<!ENTITY % p.mix
+ "%list.class;|%speclist.class;|%note.class;|%illus.class;">
+<!ENTITY % entry.mix
+ "%list.class;|note|eg|graphic|%ednote.class;">
+<!ENTITY % statusobj.mix
+ "%p.class;|%statusp.class;|%list.class;">
+<!ENTITY % hdr.mix
+ "%p.class;|%list.class;|%ednote.class;">
+<!ENTITY % termdef.mix
+ "%note.class;|%illus.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for mixtures of #PCDATA and phrase-level elements .... -->
+
+<!-- Note that %termdef.pcd.mix contains %note.class;
+ and %illus.class;, considered standalone elements. -->
+
+<!--
+#1997-09-30: maler: Added scrap and %note.class; to %termdef.pcd.mix;.
+#1997-11-28: maler: Added %loc.class; to %p.pcd.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures.
+#1998-03-23: maler: Moved some %termdef.pcd.mix; stuff out to
+# %termdef.mix;.
+-->
+
+<!ENTITY % p.pcd.mix
+ "#PCDATA|%annot.class;|%termdef.class;|%emph.class;
+ |%ref.class;|%tech.class;|%loc.class;|%ednote.class;">
+<!ENTITY % statusp.pcd.mix
+ "#PCDATA|%annot.class;|%termdef.class;|%emph.class;
+ |%ref.class;|%tech.class;|%loc.class;|%ednote.class;">
+<!ENTITY % head.pcd.mix
+ "#PCDATA|%annot.class;|%emph.class;|%tech.class;|%ednote.class;">
+<!ENTITY % label.pcd.mix
+ "#PCDATA|%annot.class;|%termdef.class;|%emph.class;|%tech.class;
+ |%ednote.class;">
+<!ENTITY % eg.pcd.mix
+ "#PCDATA|%annot.class;|%emph.class;|%ednote.class;">
+<!ENTITY % termdef.pcd.mix
+ "#PCDATA|term|%emph.class;|%ref.class;|%tech.class;
+ |%ednote.class;">
+<!ENTITY % bibl.pcd.mix
+ "#PCDATA|%emph.class;|%ref.class;|%loc.class;|%ednote.class;">
+<!ENTITY % tech.pcd.mix
+ "#PCDATA|%ednote.class;">
+<!ENTITY % loc.pcd.mix
+ "#PCDATA|%loc.class;|%ednote.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for customizable content models ...................... -->
+
+<!--
+#1998-03-10: maler: Added customization entities.
+-->
+
+<!ENTITY % spec.mdl
+ "header, front?, body, back?">
+
+<!ENTITY % header.mdl
+ "title, subtitle?, version, w3c-designation, w3c-doctype,
+ pubdate, notice*, publoc, latestloc?, prevlocs?, authlist,
+ abstract, status, pubstmt?, sourcedesc?, langusage,
+ revisiondesc">
+
+<!ENTITY % pubdate.mdl
+ "day?, month, year">
+
+<!-- ............................................................... -->
+<!-- Entities for common attributes ................................ -->
+
+<!-- key attribute:
+ Optionally provides a sorting or indexing key, for cases when
+ the element content is inappropriate for this purpose. -->
+<!ENTITY % key.att
+ 'key CDATA #IMPLIED'>
+
+<!-- def attribute:
+ Points to the element where the relevant definition can be
+ found, using the IDREF mechanism. %def.att; is for optional
+ def attributes, and %def-req.att; is for required def
+ attributes. -->
+<!ENTITY % def.att
+ 'def IDREF #IMPLIED'>
+<!ENTITY % def-req.att
+ 'def IDREF #REQUIRED'>
+
+<!-- ref attribute:
+ Points to the element where more information can be found,
+ using the IDREF mechanism. %ref.att; is for optional
+ ref attributes, and %ref-req.att; is for required ref
+ attributes. -->
+<!ENTITY % ref.att
+ 'ref IDREF #IMPLIED'>
+<!ENTITY % ref-req.att
+ 'ref IDREF #REQUIRED'>
+
+<!--
+#1998-03-23: maler: Added show and actuate attributes to href.
+# Added semi-common xml:space attribute.
+-->
+
+<!-- HREF and source attributes:
+ Points to the element where more information or source data
+ can be found, using the URL (XLL simple link) mechanism.
+ For some purposes, is associated with additional XLL
+ attributes. %href.att; is for optional HREF attributes,
+ and %href-req.att; is for required HREF attributes.
+ %source-req.att; is for the source attribute, which
+ is always required. -->
+<!ENTITY % href.att
+ 'xml-link CDATA #FIXED "simple"
+ href CDATA #IMPLIED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!ENTITY % href-req.att
+ 'xml-link CDATA #FIXED "simple"
+ href CDATA #REQUIRED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!ENTITY % source-req.att
+ 'xml-link CDATA #FIXED "simple"
+ xml:attributes NMTOKENS #FIXED "href source"
+ source CDATA #REQUIRED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!-- xml:space attribute:
+ Indicates that the element contains white space
+ that the formatter or other application should retain,
+ as appropriate to its function. -->
+<!ENTITY % xmlspace.att
+ 'xml:space (default
+ |preserve) #FIXED "preserve"'>
+
+<!-- Common attributes:
+ Every element has an ID attribute (sometimes required,
+ but usually optional) for links, and a Role attribute
+ for extending the useful life of the DTD by allowing
+ authors to make subclasses for any element. %common.att;
+ is for common attributes where the ID is optional, and
+ %common-idreq.att; is for common attributes where the
+ ID is required. -->
+<!ENTITY % common.att
+ 'id ID #IMPLIED
+ role NMTOKEN #IMPLIED'>
+<!ENTITY % common-idreq.att
+ 'id ID #REQUIRED
+ role NMTOKEN #IMPLIED'>
+
+<!-- ............................................................... -->
+<!-- Common elements ............................................... -->
+
+<!-- head: Title on divisions, productions, and the like -->
+<!ELEMENT head (%head.pcd.mix;)*>
+<!ATTLIST head %common.att;>
+
+<!-- ............................................................... -->
+<!-- Major specification structure ................................. -->
+
+<!--
+#1998-03-10: maler: Made spec content model easily customizable.
+-->
+
+<!ELEMENT spec (%spec.mdl;)>
+<!ATTLIST spec %common.att;>
+
+<!ELEMENT front (div1+)>
+<!ATTLIST front %common.att;>
+
+<!ELEMENT body (div1+)>
+<!ATTLIST body %common.att;>
+
+<!--
+#1997-09-30: maler: Added inform-div1 to back content.
+-->
+
+<!ELEMENT back ((div1+, inform-div1*) | inform-div1+)>
+<!ATTLIST back %common.att;>
+
+<!ELEMENT div1 (head, (%div.mix;)*, div2*)>
+<!ATTLIST div1 %common.att;>
+
+<!--
+#1997-09-30: maler: Added inform-div1 declarations.
+-->
+
+<!-- inform-div1: Non-normative division in back matter -->
+<!ELEMENT inform-div1 (head, (%div.mix;)*, div2*)>
+<!ATTLIST inform-div1 %common.att;>
+
+<!ELEMENT div2 (head, (%div.mix;)*, div3*)>
+<!ATTLIST div2 %common.att;>
+
+<!ELEMENT div3 (head, (%div.mix;)*, div4*)>
+<!ATTLIST div3 %common.att;>
+
+<!ELEMENT div4 (head, (%div.mix;)*)>
+<!ATTLIST div4 %common.att;>
+
+<!-- Specification header .......... -->
+
+<!--
+#1998-03-10: maler: Made header content model easily customizable.
+-->
+
+<!ELEMENT header (%header.mdl;)>
+<!ATTLIST header %common.att;>
+
+<!-- Example of title: "Extensible Cheese Language (XCL)" -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title %common.att;>
+
+<!-- Example of subtitle: "A Cheesy Specification" -->
+<!ELEMENT subtitle (#PCDATA)>
+<!ATTLIST subtitle %common.att;>
+
+<!-- Example of version: "Version 666.0" -->
+<!ELEMENT version (#PCDATA)>
+<!ATTLIST version %common.att;>
+
+<!-- Example of w3c-designation: "WD-xcl-19991231" -->
+<!ELEMENT w3c-designation (#PCDATA)>
+<!ATTLIST w3c-designation %common.att;>
+
+<!-- Example of w3c-doctype: "World Wide Web Consortium Working
+ Draft" -->
+<!ELEMENT w3c-doctype (#PCDATA)>
+<!ATTLIST w3c-doctype %common.att;>
+
+<!--
+#1998-03-10: maler: Made pubdate content model easily customizable.
+-->
+
+<!ELEMENT pubdate (%pubdate.mdl;)>
+<!ATTLIST pubdate %common.att;>
+
+<!ELEMENT day (#PCDATA)>
+<!ATTLIST day %common.att;>
+
+<!ELEMENT month (#PCDATA)>
+<!ATTLIST month %common.att;>
+
+<!ELEMENT year (#PCDATA)>
+<!ATTLIST year %common.att;>
+
+<!-- Example of notice: "This draft is for public comment..." -->
+<!ELEMENT notice (%hdr.mix;)+>
+<!ATTLIST notice %common.att;>
+
+<!ELEMENT publoc (loc+)>
+<!ATTLIST publoc %common.att;>
+
+<!ELEMENT prevlocs (loc+)>
+<!ATTLIST prevlocs %common.att;>
+
+<!ELEMENT latestloc (loc+)>
+<!ATTLIST latestloc %common.att;>
+
+<!-- loc (defined in "Phrase-level elements" below) -->
+
+<!ELEMENT authlist (author+)>
+<!ATTLIST authlist %common.att;>
+
+<!--
+#1997-09-30: maler: Made affiliation optional.
+#1998-03-10: maler: Made email optional.
+-->
+
+<!ELEMENT author (name, affiliation?, email?)>
+<!ATTLIST author %common.att;>
+
+<!ELEMENT name (#PCDATA)>
+<!ATTLIST name
+ %common.att;
+ %key.att;>
+
+<!ELEMENT affiliation (#PCDATA)>
+<!ATTLIST affiliation %common.att;>
+
+<!ELEMENT email (#PCDATA)>
+<!-- HREF attribute:
+ email functions as a hypertext reference through this
+ required attribute. Typically the reference would use
+ the mailto: scheme. -->
+<!ATTLIST email
+ %common.att;
+ %href-req.att;>
+
+<!-- The status element now contains both statusp and p, and
+ the latter now allows loc. Use p; statusp will be removed
+ eventually. -->
+<!ELEMENT status (%statusobj.mix;)+>
+<!ATTLIST status %common.att;>
+
+<!ELEMENT abstract (%hdr.mix;)*>
+<!ATTLIST abstract %common.att;>
+
+<!ELEMENT pubstmt (%hdr.mix;)+>
+<!ATTLIST pubstmt %common.att;>
+
+<!ELEMENT sourcedesc (%hdr.mix;)+>
+<!ATTLIST sourcedesc %common.att;>
+
+<!ELEMENT langusage (language+)>
+<!ATTLIST langusage %common.att;>
+
+<!ELEMENT language (#PCDATA)>
+<!ATTLIST language %common.att;>
+
+<!ELEMENT revisiondesc (%hdr.mix;)+>
+<!ATTLIST revisiondesc %common.att;>
+
+<!-- ............................................................... -->
+<!-- Standalone elements ........................................... -->
+
+<!-- Paragraphs .................... -->
+
+<!--
+#1997-09-30: maler: Changed from %obj.mix; to %p.mix;.
+#1997-12-29: maler: Changed order of %p.mix; and %p.pcd.mix; references.
+#1997-12-29: maler: Changed order of %statusobj.mix; and %statusp.pcd.mix;
+# references.
+-->
+
+<!ELEMENT p (%p.pcd.mix;|%p.mix;)*>
+<!ATTLIST p %common.att;>
+
+<!-- statusp: Special paragraph that allows loc inside it (note that
+ p now also allows loc) -->
+<!ELEMENT statusp (%statusp.pcd.mix;|%statusobj.mix;)*>
+<!ATTLIST statusp %common.att;>
+
+<!-- Lists ......................... -->
+
+<!ELEMENT ulist (item+)>
+<!-- spacing attribute:
+ Use "normal" to get normal vertical spacing for items;
+ use "compact" to get less spacing. The default is dependent
+ on the stylesheet. -->
+<!ATTLIST ulist
+ %common.att;
+ spacing (normal|compact) #IMPLIED>
+
+<!ELEMENT olist (item+)>
+<!-- spacing attribute:
+ Use "normal" to get normal vertical spacing for items;
+ use "compact" to get less spacing. The default is dependent
+ on the stylesheet. -->
+<!ATTLIST olist
+ %common.att;
+ spacing (normal|compact) #IMPLIED>
+
+<!ELEMENT item (%obj.mix;)+>
+<!ATTLIST item %common.att;>
+
+<!ELEMENT slist (sitem+)>
+<!ATTLIST slist %common.att;>
+
+<!ELEMENT sitem (%p.pcd.mix;)*>
+<!ATTLIST sitem %common.att;>
+
+<!ELEMENT glist (gitem+)>
+<!ATTLIST glist %common.att;>
+
+<!ELEMENT gitem (label, def)>
+<!ATTLIST gitem %common.att;>
+
+<!ELEMENT label (%label.pcd.mix;)*>
+<!ATTLIST label %common.att;>
+
+<!ELEMENT def (%obj.mix;)*>
+<!ATTLIST def %common.att;>
+
+<!-- Special lists ................. -->
+
+<!ELEMENT blist (bibl+)>
+<!ATTLIST blist %common.att;>
+
+<!ELEMENT bibl (%bibl.pcd.mix;)*>
+
+<!-- HREF attribute:
+ bibl optionally functions as a hypertext reference to the
+ referred-to resource through this attribute. -->
+
+<!ATTLIST bibl
+ %common.att;
+ %href.att;
+ %key.att;>
+
+<!ELEMENT orglist (member+)>
+<!ATTLIST orglist %common.att;>
+
+<!--
+#1997-09-30: maler: Added optional affiliation.
+-->
+
+<!ELEMENT member (name, affiliation?, role?)>
+<!ATTLIST member %common.att;>
+
+<!-- name (defined in "Specification header" above) -->
+<!-- affiliation (defined in "Specification header" above) -->
+
+<!ELEMENT role (#PCDATA)>
+<!ATTLIST role %common.att;>
+
+<!-- Notes ......................... -->
+
+<!ELEMENT note (%obj.mix;)+>
+<!ATTLIST note %common.att;>
+
+<!ELEMENT wfcnote (head, (%obj.mix;)+)>
+<!-- ID attribute:
+ wfcnote must have an ID so that it can be pointed to
+ from a wfc element in a production. -->
+<!ATTLIST wfcnote
+ %common-idreq.att;>
+
+<!ELEMENT vcnote (head, (%obj.mix;)+)>
+<!-- ID attribute:
+ vcnote must have an ID so that it can be pointed to
+ from a vc element in a production. -->
+<!ATTLIST vcnote
+ %common-idreq.att;>
+
+<!-- Illustrations ................. -->
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!ELEMENT eg (%eg.pcd.mix;)*>
+<!ATTLIST eg
+ %common.att;
+ %xmlspace.att;>
+
+<!ELEMENT graphic EMPTY>
+<!-- source attribute:
+ The graphic data must reside at the location pointed to.
+ This is a hypertext reference, but for practical purposes,
+ for now it should just be a pathname. -->
+<!ATTLIST graphic
+ %common.att;
+ %source-req.att;
+ alt CDATA #IMPLIED>
+
+<!--
+#1997-11-28: maler: Added prodgroup to scrap and defined it.
+-->
+
+<!ELEMENT scrap (head, (prodgroup+ | prod+ | bnf))>
+<!-- lang attribute:
+ The scrap can link to a description of the language used,
+ found in a language element in the header. -->
+<!ATTLIST scrap
+ %common.att;
+ lang IDREF #IMPLIED>
+
+<!ELEMENT prodgroup (prod+)>
+<!-- pcw<n> attributes:
+ Presentational attributes to control the width
+ of the "pseudo-table" columns used to output
+ groups of productions. -->
+<!ATTLIST prodgroup
+ %common.att;
+ pcw1 CDATA #IMPLIED
+ pcw2 CDATA #IMPLIED
+ pcw3 CDATA #IMPLIED
+ pcw4 CDATA #IMPLIED
+ pcw5 CDATA #IMPLIED
+>
+
+<!ELEMENT prod (lhs, (rhs, (com|wfc|vc)*)+)>
+<!-- ID attribute:
+ The production must have an ID so that cross-references
+ (specref) and mentions of nonterminals (nt) can link to
+ it. -->
+<!ATTLIST prod
+ %common-idreq.att;>
+
+<!ELEMENT lhs (#PCDATA)>
+<!ATTLIST lhs %common.att;>
+
+<!ELEMENT rhs (#PCDATA|nt|xnt|com)*>
+<!ATTLIST rhs %common.att;>
+
+<!-- nt and xnt (defined in "Phrase-level elements" below) -->
+
+<!--
+#1997-11-28: maler: Added loc and bibref to com content.
+-->
+
+<!ELEMENT com (#PCDATA|loc|bibref)*>
+<!ATTLIST com %common.att;>
+
+<!-- wfc: Should generate the head of the wfcnote pointed to -->
+<!ELEMENT wfc EMPTY>
+<!-- def attribute:
+ Each well formedness tagline in a production must link to the
+ wfcnote that defines it. -->
+<!ATTLIST wfc
+ %def-req.att;
+ %common.att;>
+
+<!-- vc: Should generate the head of the vcnote pointed to -->
+<!ELEMENT vc EMPTY>
+<!-- def attribute:
+ Each validity tagline in a production must link to the vcnote
+ that defines it. -->
+<!ATTLIST vc
+ %def-req.att;
+ %common.att;>
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!-- bnf: Un-marked-up production -->
+<!ELEMENT bnf (%eg.pcd.mix;)*>
+<!ATTLIST bnf
+ %common.att;
+ %xmlspace.att;>
+
+<!--
+#1997-10-16: maler: Added table mechanism.
+#1997-11-28: maler: Added non-null system ID to entity declaration.
+# Added HTML table module.
+#1997-12-29: maler: IGNOREd SGML Open table model.
+#1998-03-10: maler: Removed SGML Open table model.
+# Merged html-tbl.mod file into main file.
+# Added %common.att; to all HTML table elements.
+-->
+
+<!-- TR and TD attributes:
+ Alignment attributes. No default. -->
+<!ENTITY % trtd.att
+ "align (left
+ |center
+ |right) #IMPLIED
+ valign (top
+ |middle
+ |bottom) #IMPLIED">
+
+<!ELEMENT htable (htbody+)>
+<!ATTLIST htable
+ border CDATA "0"
+ cellpadding CDATA "0"
+ align (left
+ |center
+ |right) "left">
+
+<!ELEMENT htbody (tr+)>
+<!ATTLIST htbody %common.att;>
+
+<!ELEMENT tr (td+)>
+<!ATTLIST tr
+ %common.att;
+ %trtd.att;>
+
+<!ELEMENT td (%p.pcd.mix;)*>
+<!ATTLIST td
+ %common.att;
+ %trtd.att;
+ bgcolor CDATA #IMPLIED
+ rowspan CDATA "1"
+ colspan CDATA "1">
+
+<!-- ............................................................... -->
+<!-- Phrase-level elements ......................................... -->
+
+<!-- bibref: Should generate, in square brackets, "key" on bibl -->
+<!ELEMENT bibref EMPTY>
+<!-- ref attribute:
+ A bibliography reference must link to the bibl element that
+ describes the resource. -->
+<!ATTLIST bibref
+ %common.att;
+ %ref-req.att;>
+
+<!ELEMENT code (%tech.pcd.mix;)*>
+<!ATTLIST code %common.att;>
+
+<!--
+#1998-03-10: maler: Declared ednote and related elements.
+-->
+
+<!ELEMENT ednote (name?, date?, edtext)>
+<!ATTLIST ednote %common.att;>
+
+<!ELEMENT date (#PCDATA)>
+<!ATTLIST date %common.att;>
+
+<!ELEMENT edtext (#PCDATA)>
+<!ATTLIST edtext %common.att;>
+
+<!ELEMENT emph (#PCDATA)>
+<!ATTLIST emph %common.att;>
+
+<!-- footnote: Both footnote content and call to footnote -->
+<!ELEMENT footnote (%obj.mix;)+>
+<!ATTLIST footnote %common.att;>
+
+<!ELEMENT kw (%tech.pcd.mix;)*>
+<!ATTLIST kw %common.att;>
+
+<!ELEMENT loc (#PCDATA)>
+<!-- HREF attribute:
+ The purpose of a loc element is to function as a hypertext
+ link to a resource. (Ideally, the content of loc will also
+ mention the URI of the resource, so that readers of the
+ printed version will be able to locate the resource.) -->
+<!ATTLIST loc
+ %common.att;
+ %href-req.att;>
+
+<!ELEMENT nt (#PCDATA)>
+<!-- def attribute:
+ The nonterminal must link to the production that defines
+ it. -->
+<!ATTLIST nt
+ %common.att;
+ %def-req.att;>
+
+<!--
+#1998-03-10: maler: Declared quote.
+-->
+
+<!-- quote: Scare quotes and other purely presentational quotes -->
+<!ELEMENT quote (%p.pcd.mix;)*>
+<!ATTLIST quote %common.att;>
+
+<!-- specref: Should generate italic "[n.n], Section Title" for
+ div, "n" for numbered item, or "[n]" for production -->
+<!ELEMENT specref EMPTY>
+<!-- ref attribute:
+ The purpose of a specref element is to link to a div, item
+ in an olist, or production in the current spec. -->
+<!ATTLIST specref
+ %common.att;
+ %ref-req.att;>
+
+<!ELEMENT term (#PCDATA)>
+<!ATTLIST term %common.att;>
+
+<!ELEMENT termdef (%termdef.pcd.mix;|%termdef.mix;)*>
+<!-- ID attribute:
+ A term definition must have an ID so that it can be linked
+ to from termref elements. -->
+<!-- term attribute:
+ The canonical form of the term or phrase being defined must
+ appear in this attribute, even if the term or phrase also
+ appears in the element content in identical form (e.g., in
+ the term element). -->
+<!ATTLIST termdef
+ %common-idreq.att;
+ term CDATA #REQUIRED>
+
+<!ELEMENT termref (#PCDATA)>
+<!-- ref attribute:
+ A term reference must link to the termdef element that
+ defines the term. -->
+<!ATTLIST termref
+ %common.att;
+ %def-req.att;>
+
+<!ELEMENT titleref (#PCDATA)>
+<!-- HREF attribute:
+ A title reference can optionally function as a hypertext
+ link to the resource with this title. -->
+<!ATTLIST titleref
+ %common.att;
+ %href.att;>
+
+<!ELEMENT xnt (#PCDATA)>
+<!-- HREF attribute:
+ The nonterminal must hyperlink to a resource that serves
+ to define it (e.g., a production in a related XML
+ specification). -->
+<!ATTLIST xnt
+ %common.att;
+ %href-req.att;>
+
+<!--
+#1997-12-29: maler: Declared xspecref.
+-->
+
+<!ELEMENT xspecref (#PCDATA)>
+<!-- HREF attribute:
+ The spec reference must hyperlink to the resource to
+ cross-refer to (e.g., a section in a related XML
+ specification). -->
+<!ATTLIST xspecref
+ %common.att;
+ %href-req.att;>
+
+<!ELEMENT xtermref (#PCDATA)>
+<!-- HREF attribute:
+ The term reference must hyperlink to the resource that
+ serves to define the term (e.g., a term definition in
+ a related XML specification). -->
+<!ATTLIST xtermref
+ %common.att;
+ %href-req.att;>
+
+<!-- ............................................................... -->
+<!-- Unused elements for ADEPT ..................................... -->
+
+<!--
+#1997-09-30: maler: Added unusued elements.
+#1997-10-14: maler: Fixed div to move nested div to the mixture.
+-->
+
+<!-- The following elements are purposely declared but never
+ referenced. Declaring them allows them to be pasted from
+ an HTML document into a document using this DTD in ADEPT.
+ The ATD Context Transformation mechanism will try to convert
+ them to the appropriate element for this DTD. While this
+ conversion will not work for all fragments, it does allow
+ many cases to work reasonably well. -->
+
+<!ELEMENT div
+ (head?, (%div.mix;|ul|ol|h1|h2|h3|h4|h5|h6|div)*)>
+<!ELEMENT h1 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h2 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h3 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h4 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h5 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h6 (%head.pcd.mix;|em|a)*>
+<!ELEMENT pre (%eg.pcd.mix;|em)*>
+<!ELEMENT ul (item|li)*>
+<!ELEMENT ol (item|li)*>
+<!ELEMENT li (#PCDATA|%obj.mix;)*>
+<!ELEMENT em (#PCDATA)>
+<!ELEMENT a (#PCDATA)>
+
+<!-- ............................................................... -->
+<!-- Change history ................................................ -->
+
+<!--
+#1997-08-18: maler
+#- Did a major revision.
+#1997-09-10: maler
+#- Updated FPI.
+#- Removed namekey element and put key attribute on name element.
+#- Made statusp element and supporting entities.
+#- Added slist element with sitem+ content.
+#- Required head on scrap and added new bnf subelement.
+#- Added an xnt element and allowed it and nt in regular text and rhs.
+#- Removed the ntref element.
+#- Added back the com element to the content of rhs.
+#- Added a key attribute to bibl.
+#- Removed the ident element.
+#- Added a term element to be used inside termdef.
+#- Added an xtermref element parallel to termref.
+#- Beefed up DTD comments.
+#1997-09-12: maler
+#- Allowed term element in general text.
+#- Changed bibref to EMPTY.
+#- Added ref.class to termdef.pcd.mix.
+#1997-09-14: maler
+#- Changed main attribute of xtermref from def to href.
+#- Added termdef.class to label contents.
+#1997-09-30: maler
+#- Added character entity module and added new entities.
+#- Removed p from appearing directly in self; created %p.mix;.
+#- Added inform-div (non-normative division) element.
+#- Fixed xtermref comment to mention HREF, not ref.
+#- Extended orglist model to allow optional affiliation.
+#- Modified author to make affiliation optional.
+#- Added %speclist.class; and %note.class; to %obj.mix; and %p.mix;.
+#- Added %note.class; and %illus.class; to %termdef.pcd.mix;.
+#- Added unused HTML elements.
+#- Put empty system ID next to public ID in entity declarations.
+#1997-10-14: maler
+#- Fixed "unused" div content model to move nested div to mixture.
+#1997-10-16: maler
+#- Added SGML Open Exchange tables.
+#1997-11-28: maler
+#- Added support for prodgroup and its attributes.
+#- Added support for HTML tables.
+#- Added loc and bibref to content of com.
+#- Added loc to general p content models.
+#- Allowed p as alternative to statusp in status.
+#- Added non-null system IDs to external parameter entity declarations.
+#- (Modified the SGML Open table module to make it XML-compliant.)
+#- (Modified the character entity module.)
+#1997-12-29: maler
+#- Moved #PCDATA occurrences to come before GIs in content models.
+#- Removed use of the SGML Open table module.
+#- Added xspecref element.
+#- Ensured that all FPIs contain 4-digit year.
+#- (Modified the character entity module.)
+#1997-03-10: maler
+#- Merged the character entity and table modules into the main file.
+#- Added ldquo and rdquo entities.
+#- Added common attributes to prodgroup.
+#- Made the email element in header optional.
+#- Removed reference to the SGML Open table model.
+#- Added ednote element.
+#- Added quote element.
+#- Updated XLink usage to reflect 3 March 1998 WD.
+#- Added "local" entities to the class entities for customization.
+#- Parameterized several content models to allow for customization.
+#1997-03-23: maler
+#- Cleaned up some comments and removed some others.
+#- Added xml:space semi-common attribute to eg and bnf elements.
+#- Added show and embed attributes on all the uses of href.
+#- Added %common.att; to all HTML table elements.
+#- Added a real URI to the "typical invocation" comment.
+-->
+
+<!-- ............................................................... -->
+<!-- End of XML specification DTD .................................. -->
+<!-- ............................................................... -->
diff --git a/test/valid/dtds/xmlspec.dtd b/test/valid/dtds/xmlspec.dtd
new file mode 100644
index 00000000..55cfba6d
--- /dev/null
+++ b/test/valid/dtds/xmlspec.dtd
@@ -0,0 +1,1102 @@
+<!-- ............................................................... -->
+<!-- XML specification DTD ......................................... -->
+<!-- ............................................................... -->
+
+<!--
+TYPICAL INVOCATION:
+# <!DOCTYPE spec PUBLIC
+# "-//W3C//DTD Specification::19980521//EN"
+# "http://www.w3.org/XML/1998/06/xmlspec-19980521.dtd">
+
+PURPOSE:
+ This DTD was developed for use with the XML family of W3C
+ specifications. It is an XML-compliant DTD based in part on
+ the TEI Lite and Sweb DTDs.
+
+DEPENDENCIES:
+ None.
+
+CHANGE HISTORY:
+ The list of changes is at the end of the DTD.
+
+ For all details, see the design report at:
+
+# <http://www.w3.org/XML/1998/06/xmlspec-report-19980521.htm>
+
+ The "typical invocation" FPI always gets updated to reflect the
+ date of the most recent changes.
+
+ Search this file for "#" in the first column to see change history
+ comments.
+
+MAINTAINER:
+ Eve Maler
+ ArborText Inc.
+ elm@arbortext.com
+ voice: +1 781 270 5750
+ fax: +1 781 273 3760
+-->
+
+<!-- ............................................................... -->
+<!-- Entities for characters and symbols ........................... -->
+
+<!--
+#1998-03-10: maler: Added &ldquo; and &rdquo;.
+# Used 8879:1986-compatible decimal character
+# references.
+# Merged charent.mod file back into main file.
+#1998-05-14: maler: Fixed ldquo and rdquo. Gave mdash a real number.
+-->
+
+<!ENTITY lt "&#38;#60;">
+<!ENTITY gt "&#62;">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY apos "&#39;">
+<!ENTITY quot "&#34;">
+<!ENTITY nbsp "&#160;">
+<!--
+<!ENTITY mdash "&#x2014;">
+<!ENTITY ldquo "&#x201C;">
+<!ENTITY rdquo "&#x201D;">
+-->
+
+<!-- ............................................................... -->
+<!-- Entities for classes of standalone elements ................... -->
+
+<!--
+#1997-10-16: maler: Added table to %illus.class;.
+#1997-11-28: maler: Added htable to %illus.class;.
+#1997-12-29: maler: IGNOREd table.
+#1998-03-10: maler: Removed SGML Open-specific %illus.class;.
+# Added "local" entities for customization.
+#1998-05-14: maler: Added issue to %note.class;.
+# Removed %[local.]statusp.class;.
+#1998-05-21: maler: Added constraintnote to %note.class;.
+-->
+
+<!ENTITY % local.p.class "">
+<!ENTITY % p.class "p
+ %local.p.class;">
+
+<!ENTITY % local.list.class "">
+<!ENTITY % list.class "ulist|olist|slist|glist
+ %local.list.class;">
+
+<!ENTITY % local.speclist.class "">
+<!ENTITY % speclist.class "orglist|blist
+ %local.speclist.class;">
+
+<!ENTITY % local.note.class "">
+<!ENTITY % note.class "note|issue|wfcnote|vcnote
+ |constraintnote %local.note.class;">
+
+<!ENTITY % local.illus.class "">
+<!ENTITY % illus.class "eg|graphic|scrap|htable
+ %local.illus.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for classes of phrase-level elements ................. -->
+
+<!--
+#1997-12-29: maler: Added xspecref to %ref.class;.
+#1998-03-10: maler: Added %ednote.class;.
+# Added "local" entities for customization.
+-->
+
+<!ENTITY % local.annot.class "">
+<!ENTITY % annot.class "footnote
+ %local.annot.class;">
+
+<!ENTITY % local.termdef.class "">
+<!ENTITY % termdef.class "termdef|term
+ %local.termdef.class;">
+
+<!ENTITY % local.emph.class "">
+<!ENTITY % emph.class "emph|quote
+ %local.emph.class;">
+
+<!ENTITY % local.ref.class "">
+<!ENTITY % ref.class "bibref|specref|termref|titleref
+ |xspecref|xtermref
+ %local.ref.class;">
+
+<!ENTITY % local.loc.class "">
+<!ENTITY % loc.class "loc
+ %local.loc.class;">
+
+<!ENTITY % local.tech.class "">
+<!ENTITY % tech.class "kw|nt|xnt|code
+ %local.tech.class;">
+
+<!ENTITY % local.ednote.class "">
+<!ENTITY % ednote.class "ednote
+ %local.ednote.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for mixtures of standalone elements .................. -->
+
+<!--
+#1997-09-30: maler: Created %p.mix; to eliminate p from self.
+#1997-09-30: maler: Added %speclist.class; to %obj.mix; and %p.mix;.
+#1997-09-30: maler: Added %note.class; to %obj.mix; and %p.mix;.
+#1997-10-16: maler: Created %entry.mix;. Note that some elements
+# left out here are still allowed in termdef,
+# which entry can contain through %p.pcd.mix;.
+#1997-11-28: maler: Added %p.class; to %statusobj.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures, except
+# %p.mix; and %statusobj.mix;, because paragraphs
+# and status paragraphs will contain ednote
+# through %p.pcd.mix;.
+#1998-03-23: maler: Added %termdef.mix; (broken out from
+# %termdef.pcd.mix;).
+#1998-05-14: maler: Removed %statusobj.mix; and all mentions of
+# %statusp.mix;.
+-->
+
+<!ENTITY % div.mix
+ "%p.class;|%list.class;|%speclist.class;|%note.class;
+ |%illus.class;|%ednote.class;">
+<!ENTITY % obj.mix
+ "%p.class;|%list.class;|%speclist.class;|%note.class;
+ |%illus.class;|%ednote.class;">
+<!ENTITY % p.mix
+ "%list.class;|%speclist.class;|%note.class;|%illus.class;">
+<!ENTITY % entry.mix
+ "%list.class;|note|eg|graphic|%ednote.class;">
+<!ENTITY % hdr.mix
+ "%p.class;|%list.class;|%ednote.class;">
+<!ENTITY % termdef.mix
+ "%note.class;|%illus.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for mixtures of #PCDATA and phrase-level elements .... -->
+
+<!-- Note that %termdef.pcd.mix contains %note.class;
+ and %illus.class;, considered standalone elements. -->
+
+<!--
+#1997-09-30: maler: Added scrap and %note.class; to %termdef.pcd.mix;.
+#1997-11-28: maler: Added %loc.class; to %p.pcd.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures.
+#1998-03-23: maler: Moved some %termdef.pcd.mix; stuff out to
+# %termdef.mix;.
+#1998-05-14: maler: Removed %statusp.pcd.mix;.
+#1998-05-21: maler: Added constraint element to %eg.pcd.mix;.
+-->
+
+<!ENTITY % p.pcd.mix
+ "#PCDATA|%annot.class;|%termdef.class;|%emph.class;
+ |%ref.class;|%tech.class;|%loc.class;|%ednote.class;">
+<!ENTITY % head.pcd.mix
+ "#PCDATA|%annot.class;|%emph.class;|%tech.class;|%ednote.class;">
+<!ENTITY % label.pcd.mix
+ "#PCDATA|%annot.class;|%termdef.class;|%emph.class;|%tech.class;
+ |%ednote.class;">
+<!ENTITY % eg.pcd.mix
+ "#PCDATA|%annot.class;|%emph.class;|%ednote.class;|constraint">
+<!ENTITY % termdef.pcd.mix
+ "#PCDATA|term|%emph.class;|%ref.class;|%tech.class;
+ |%ednote.class;">
+<!ENTITY % bibl.pcd.mix
+ "#PCDATA|%emph.class;|%ref.class;|%loc.class;|%ednote.class;">
+<!ENTITY % tech.pcd.mix
+ "#PCDATA|%ednote.class;">
+<!ENTITY % loc.pcd.mix
+ "#PCDATA|%loc.class;|%ednote.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for customizable content models ...................... -->
+
+<!--
+#1998-03-10: maler: Added customization entities.
+#1998-05-14: maler: Allowed prevlocs and latestloc in either order.
+-->
+
+<!ENTITY % spec.mdl
+ "header, front?, body, back?">
+
+<!ENTITY % header.mdl
+ "title, subtitle?, version, w3c-designation, w3c-doctype,
+ pubdate, notice*, publoc, ((prevlocs, latestloc?) |
+ (latestloc, prevlocs?))?, authlist, status, abstract,
+ pubstmt?, sourcedesc?, langusage, revisiondesc">
+
+<!ENTITY % pubdate.mdl
+ "day?, month, year">
+
+<!-- ............................................................... -->
+<!-- Entities for common attributes ................................ -->
+
+<!-- key attribute:
+ Optionally provides a sorting or indexing key, for cases when
+ the element content is inappropriate for this purpose. -->
+<!ENTITY % key.att
+ 'key CDATA #IMPLIED'>
+
+<!-- def attribute:
+ Points to the element where the relevant definition can be
+ found, using the IDREF mechanism. %def.att; is for optional
+ def attributes, and %def-req.att; is for required def
+ attributes. -->
+<!ENTITY % def.att
+ 'def IDREF #IMPLIED'>
+<!ENTITY % def-req.att
+ 'def IDREF #REQUIRED'>
+
+<!-- ref attribute:
+ Points to the element where more information can be found,
+ using the IDREF mechanism. %ref.att; is for optional
+ ref attributes, and %ref-req.att; is for required ref
+ attributes. -->
+<!ENTITY % ref.att
+ 'ref IDREF #IMPLIED'>
+<!ENTITY % ref-req.att
+ 'ref IDREF #REQUIRED'>
+
+<!--
+#1998-03-23: maler: Added show and actuate attributes to href.
+# Added semi-common xml:space attribute.
+-->
+
+<!-- HREF and source attributes:
+ Points to the element where more information or source data
+ can be found, using the URL (XLL simple link) mechanism.
+ For some purposes, is associated with additional XLL
+ attributes. %href.att; is for optional HREF attributes,
+ and %href-req.att; is for required HREF attributes.
+ %source-req.att; is for the source attribute, which
+ is always required. -->
+<!ENTITY % href.att
+ 'xml:link CDATA #FIXED "simple"
+ href CDATA #IMPLIED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!ENTITY % href-req.att
+ 'xml:link CDATA #FIXED "simple"
+ href CDATA #REQUIRED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!ENTITY % source-req.att
+ 'xml:link CDATA #FIXED "simple"
+ xml:attributes NMTOKENS #FIXED "href source"
+ source CDATA #REQUIRED
+ show CDATA #FIXED "embed"
+ actuate CDATA #FIXED "auto"'>
+
+<!-- xml:space attribute:
+ Indicates that the element contains white space
+ that the formatter or other application should retain,
+ as appropriate to its function. -->
+<!ENTITY % xmlspace.att
+ 'xml:space (default
+ |preserve) #FIXED "preserve"'>
+
+<!-- Common attributes:
+ Every element has an ID attribute (sometimes required,
+ but usually optional) for links, and a Role attribute
+ for extending the useful life of the DTD by allowing
+ authors to make subclasses for any element. %common.att;
+ is for common attributes where the ID is optional, and
+ %common-idreq.att; is for common attributes where the
+ ID is required. -->
+<!ENTITY % common.att
+ 'id ID #IMPLIED
+ role NMTOKEN #IMPLIED'>
+<!ENTITY % common-idreq.att
+ 'id ID #REQUIRED
+ role NMTOKEN #IMPLIED'>
+
+<!-- ............................................................... -->
+<!-- Common elements ............................................... -->
+
+<!-- head: Title on divisions, productions, and the like -->
+<!ELEMENT head (%head.pcd.mix;)*>
+<!ATTLIST head %common.att;>
+
+<!-- ............................................................... -->
+<!-- Major specification structure ................................. -->
+
+<!--
+#1998-03-10: maler: Made spec content model easily customizable.
+-->
+
+<!ELEMENT spec (%spec.mdl;)>
+<!ATTLIST spec %common.att;>
+
+<!ELEMENT front (div1+)>
+<!ATTLIST front %common.att;>
+
+<!ELEMENT body (div1+)>
+<!ATTLIST body %common.att;>
+
+<!--
+#1997-09-30: maler: Added inform-div1 to back content.
+-->
+
+<!ELEMENT back ((div1+, inform-div1*) | inform-div1+)>
+<!ATTLIST back %common.att;>
+
+<!ELEMENT div1 (head, (%div.mix;)*, div2*)>
+<!ATTLIST div1 %common.att;>
+
+<!--
+#1997-09-30: maler: Added inform-div1 declarations.
+-->
+
+<!-- inform-div1: Non-normative division in back matter -->
+<!ELEMENT inform-div1 (head, (%div.mix;)*, div2*)>
+<!ATTLIST inform-div1 %common.att;>
+
+<!ELEMENT div2 (head, (%div.mix;)*, div3*)>
+<!ATTLIST div2 %common.att;>
+
+<!ELEMENT div3 (head, (%div.mix;)*, div4*)>
+<!ATTLIST div3 %common.att;>
+
+<!ELEMENT div4 (head, (%div.mix;)*)>
+<!ATTLIST div4 %common.att;>
+
+<!-- Specification header .......... -->
+
+<!--
+#1998-03-10: maler: Made header content model easily customizable.
+-->
+
+<!ELEMENT header (%header.mdl;)>
+<!ATTLIST header %common.att;>
+
+<!-- Example of title: "Extensible Cheese Language (XCL)" -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title %common.att;>
+
+<!-- Example of subtitle: "A Cheesy Specification" -->
+<!ELEMENT subtitle (#PCDATA)>
+<!ATTLIST subtitle %common.att;>
+
+<!-- Example of version: "Version 666.0" -->
+<!ELEMENT version (#PCDATA)>
+<!ATTLIST version %common.att;>
+
+<!-- Example of w3c-designation: "WD-xcl-19991231" -->
+<!ELEMENT w3c-designation (#PCDATA)>
+<!ATTLIST w3c-designation %common.att;>
+
+<!-- Example of w3c-doctype: "World Wide Web Consortium Working
+ Draft" -->
+<!ELEMENT w3c-doctype (#PCDATA)>
+<!ATTLIST w3c-doctype %common.att;>
+
+<!--
+#1998-03-10: maler: Made pubdate content model easily customizable.
+-->
+
+<!ELEMENT pubdate (%pubdate.mdl;)>
+<!ATTLIST pubdate %common.att;>
+
+<!ELEMENT day (#PCDATA)>
+<!ATTLIST day %common.att;>
+
+<!ELEMENT month (#PCDATA)>
+<!ATTLIST month %common.att;>
+
+<!ELEMENT year (#PCDATA)>
+<!ATTLIST year %common.att;>
+
+<!-- Example of notice: "This draft is for public comment..." -->
+<!ELEMENT notice (%hdr.mix;)+>
+<!ATTLIST notice %common.att;>
+
+<!ELEMENT publoc (loc+)>
+<!ATTLIST publoc %common.att;>
+
+<!ELEMENT prevlocs (loc+)>
+<!ATTLIST prevlocs %common.att;>
+
+<!ELEMENT latestloc (loc+)>
+<!ATTLIST latestloc %common.att;>
+
+<!-- loc (defined in "Phrase-level elements" below) -->
+
+<!ELEMENT authlist (author+)>
+<!ATTLIST authlist %common.att;>
+
+<!--
+#1997-09-30: maler: Made affiliation optional.
+#1998-03-10: maler: Made email optional.
+-->
+
+<!ELEMENT author (name, affiliation?, email?)>
+<!ATTLIST author %common.att;>
+
+<!ELEMENT name (#PCDATA)>
+<!ATTLIST name
+ %common.att;
+ %key.att;>
+
+<!ELEMENT affiliation (#PCDATA)>
+<!ATTLIST affiliation %common.att;>
+
+<!ELEMENT email (#PCDATA)>
+<!-- HREF attribute:
+ email functions as a hypertext reference through this
+ required attribute. Typically the reference would use
+ the mailto: scheme. -->
+<!ATTLIST email
+ %common.att;
+ %href-req.att;>
+
+<!--
+#1998-05-15: maler: Changed status content from %statusobj.mix;
+# to plain %obj.mix;. statusp is obsolete.
+-->
+
+<!ELEMENT status (%obj.mix;)+>
+<!ATTLIST status %common.att;>
+
+<!ELEMENT abstract (%hdr.mix;)*>
+<!ATTLIST abstract %common.att;>
+
+<!ELEMENT pubstmt (%hdr.mix;)+>
+<!ATTLIST pubstmt %common.att;>
+
+<!ELEMENT sourcedesc (%hdr.mix;)+>
+<!ATTLIST sourcedesc %common.att;>
+
+<!ELEMENT langusage (language+)>
+<!ATTLIST langusage %common.att;>
+
+<!ELEMENT language (#PCDATA)>
+<!ATTLIST language %common.att;>
+
+<!ELEMENT revisiondesc (%hdr.mix;)+>
+<!ATTLIST revisiondesc %common.att;>
+
+<!-- ............................................................... -->
+<!-- Standalone elements ........................................... -->
+
+<!-- Paragraphs .................... -->
+
+<!--
+#1997-09-30: maler: Changed from %obj.mix; to %p.mix;.
+#1997-12-29: maler: Changed order of %p.mix; and %p.pcd.mix;
+# references.
+#1997-12-29: maler: Changed order of %statusobj.mix; and
+# %statusp.pcd.mix; references.
+#1998-05-14: maler: Removed statusp declarations.
+-->
+
+<!ELEMENT p (%p.pcd.mix;|%p.mix;)*>
+<!ATTLIST p %common.att;>
+
+<!-- Lists ......................... -->
+
+<!ELEMENT ulist (item+)>
+<!-- spacing attribute:
+ Use "normal" to get normal vertical spacing for items;
+ use "compact" to get less spacing. The default is dependent
+ on the stylesheet. -->
+<!ATTLIST ulist
+ %common.att;
+ spacing (normal|compact) #IMPLIED>
+
+<!ELEMENT olist (item+)>
+<!-- spacing attribute:
+ Use "normal" to get normal vertical spacing for items;
+ use "compact" to get less spacing. The default is dependent
+ on the stylesheet. -->
+<!ATTLIST olist
+ %common.att;
+ spacing (normal|compact) #IMPLIED>
+
+<!ELEMENT item (%obj.mix;)+>
+<!ATTLIST item %common.att;>
+
+<!ELEMENT slist (sitem+)>
+<!ATTLIST slist %common.att;>
+
+<!ELEMENT sitem (%p.pcd.mix;)*>
+<!ATTLIST sitem %common.att;>
+
+<!ELEMENT glist (gitem+)>
+<!ATTLIST glist %common.att;>
+
+<!ELEMENT gitem (label, def)>
+<!ATTLIST gitem %common.att;>
+
+<!ELEMENT label (%label.pcd.mix;)*>
+<!ATTLIST label %common.att;>
+
+<!ELEMENT def (%obj.mix;)*>
+<!ATTLIST def %common.att;>
+
+<!-- Special lists ................. -->
+
+<!ELEMENT blist (bibl+)>
+<!ATTLIST blist %common.att;>
+
+<!ELEMENT bibl (%bibl.pcd.mix;)*>
+<!-- HREF attribute:
+ bibl optionally functions as a hypertext reference to the
+ referred-to resource through this attribute. -->
+<!ATTLIST bibl
+ %common.att;
+ %href.att;
+ %key.att;>
+
+<!ELEMENT orglist (member+)>
+<!ATTLIST orglist %common.att;>
+
+<!--
+#1997-09-30: maler: Added optional affiliation.
+-->
+
+<!ELEMENT member (name, affiliation?, role?)>
+<!ATTLIST member %common.att;>
+
+<!-- name (defined in "Specification header" above) -->
+<!-- affiliation (defined in "Specification header" above) -->
+
+<!ELEMENT role (#PCDATA)>
+<!ATTLIST role %common.att;>
+
+<!-- Notes ......................... -->
+
+<!ELEMENT note (%obj.mix;)+>
+<!ATTLIST note %common.att;>
+
+<!--
+#1998-05-14: maler: Declared issue element.
+-->
+
+<!ELEMENT issue (%obj.mix;)+>
+<!ATTLIST issue %common-idreq.att;>
+
+<!ELEMENT wfcnote (head, (%obj.mix;)+)>
+<!-- ID attribute:
+ wfcnote must have an ID so that it can be pointed to
+ from a wfc element in a production. -->
+<!ATTLIST wfcnote
+ %common-idreq.att;>
+
+<!ELEMENT vcnote (head, (%obj.mix;)+)>
+<!-- ID attribute:
+ vcnote must have an ID so that it can be pointed to
+ from a vc element in a production. -->
+<!ATTLIST vcnote
+ %common-idreq.att;>
+
+<!--
+#1998-05-21: maler: Declared generic constraintnote element.
+-->
+
+<!ELEMENT constraintnote (head, (%obj.mix;)+)>
+<!-- ID attribute:
+ cnote must have an ID so that it can be pointed to
+ from a constraint element in a production. -->
+<!-- type attribute:
+ cnote must have a type value keyword so that it can be
+ correctly characterized in the specification. -->
+<!ATTLIST constraintnote
+ %common-idreq.att;
+ type NMTOKEN #REQUIRED>
+
+<!-- Illustrations ................. -->
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!ELEMENT eg (%eg.pcd.mix;)*>
+<!ATTLIST eg
+ %common.att;
+ %xmlspace.att;>
+
+<!ELEMENT graphic EMPTY>
+<!-- source attribute:
+ The graphic data must reside at the location pointed to.
+ This is a hypertext reference, but for practical purposes,
+ for now it should just be a pathname. -->
+<!ATTLIST graphic
+ %common.att;
+ %source-req.att;
+ alt CDATA #IMPLIED>
+
+<!--
+#1997-11-28: maler: Added prodgroup to scrap and defined it.
+#1998-05-21: maler: Added constraint to prod.
+-->
+
+<!ELEMENT scrap (head, (prodgroup+ | prod+ | bnf))>
+<!-- lang attribute:
+ The scrap can link to a description of the language used,
+ found in a language element in the header. -->
+<!ATTLIST scrap
+ %common.att;
+ lang IDREF #IMPLIED>
+
+<!ELEMENT prodgroup (prod+)>
+<!-- pcw<n> attributes:
+ Presentational attributes to control the width
+ of the "pseudo-table" columns used to output
+ groups of productions. -->
+<!ATTLIST prodgroup
+ %common.att;
+ pcw1 CDATA #IMPLIED
+ pcw2 CDATA #IMPLIED
+ pcw3 CDATA #IMPLIED
+ pcw4 CDATA #IMPLIED
+ pcw5 CDATA #IMPLIED
+>
+
+<!ELEMENT prod (lhs, (rhs, (com|wfc|vc|constraint)*)+)>
+<!-- ID attribute:
+ The production must have an ID so that cross-references
+ (specref) and mentions of nonterminals (nt) can link to
+ it. -->
+<!ATTLIST prod
+ %common-idreq.att;>
+
+<!ELEMENT lhs (#PCDATA)>
+<!ATTLIST lhs %common.att;>
+
+<!ELEMENT rhs (#PCDATA|nt|xnt|com)*>
+<!ATTLIST rhs %common.att;>
+
+<!-- nt and xnt (defined in "Phrase-level elements" below) -->
+
+<!--
+#1997-11-28: maler: Added loc and bibref to com content.
+-->
+
+<!ELEMENT com (#PCDATA|loc|bibref)*>
+<!ATTLIST com %common.att;>
+
+<!-- wfc: Should generate the head of the wfcnote pointed to -->
+<!ELEMENT wfc EMPTY>
+<!-- def attribute:
+ Each well formedness tagline in a production must link to the
+ wfcnote that defines it. -->
+<!ATTLIST wfc
+ %def-req.att;
+ %common.att;>
+
+<!-- vc: Should generate the head of the vcnote pointed to -->
+<!ELEMENT vc EMPTY>
+<!-- def attribute:
+ Each validity tagline in a production must link to the vcnote
+ that defines it. -->
+<!ATTLIST vc
+ %def-req.att;
+ %common.att;>
+
+<!--
+#1998-05-21: maler: Declared generic constraint element.
+-->
+
+<!-- constraint: Should generate the head of the constraintnote
+ pointed to -->
+<!ELEMENT constraint EMPTY>
+<!-- def attribute:
+ Each constraint tagline in a production must link to the
+ constraint note that defines it. -->
+<!ATTLIST constraint
+ %def-req.att;
+ %common.att;>
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!-- bnf: Un-marked-up production -->
+<!ELEMENT bnf (%eg.pcd.mix;)*>
+<!ATTLIST bnf
+ %common.att;
+ %xmlspace.att;>
+
+<!--
+#1997-10-16: maler: Added table mechanism.
+#1997-11-28: maler: Added non-null system ID to entity declaration.
+# Added HTML table module.
+#1997-12-29: maler: IGNOREd SGML Open table model.
+#1998-03-10: maler: Removed SGML Open table model.
+# Merged html-tbl.mod file into main file.
+# Added %common.att; to all HTML table elements.
+#1998-05-14: maler: Replaced table model with full HTML 4.0 model.
+# Removed htable in favor of table.
+# Removed htbody in favor of tbody.
+-->
+
+<!ENTITY % cellhalign.att
+ 'align (left|center
+ |right|justify
+ |char) #IMPLIED
+ char CDATA #IMPLIED
+ charoff CDATA #IMPLIED'>
+
+<!ENTITY % cellvalign.att
+ 'valign (top|middle
+ |bottom
+ |baseline) #IMPLIED'>
+
+<!ENTITY % thtd.att
+ 'abbr CDATA #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ scope (row
+ |col
+ |rowgroup
+ |colgroup) #IMPLIED
+ rowspan NMTOKEN "1"
+ colspan NMTOKEN "1"'>
+
+<!ENTITY % width.att
+ 'width CDATA #IMPLIED'>
+
+<!ENTITY % span.att
+ 'span NMTOKEN "1"'>
+
+<!ELEMENT table
+ (caption?, (col*|colgroup*), thead?, tfoot?, tbody+)>
+<!ATTLIST table
+ %common.att;
+ %width.att;
+ summary CDATA #IMPLIED
+ border CDATA #IMPLIED
+ frame (void|above
+ |below|hsides
+ |lhs|rhs
+ |vsides|box
+ |border) #IMPLIED
+ rules (none|groups
+ |rows|cols
+ |all) #IMPLIED
+ cellspacing CDATA #IMPLIED
+ cellpadding CDATA #IMPLIED>
+
+<!ELEMENT caption (%p.pcd.mix;)*>
+<!ATTLIST caption %common.att;>
+
+<!ELEMENT col EMPTY>
+<!ATTLIST col
+ %common.att;
+ %span.att;
+ %width.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT colgroup (col)*>
+<!ATTLIST colgroup
+ %common.att;
+ %span.att;
+ %width.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT thead (tr)+>
+<!ATTLIST thead
+ %common.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT tfoot (tr)+>
+<!ATTLIST tfoot
+ %common.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT tbody (tr)+>
+<!ATTLIST tbody
+ %common.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT tr (th|td)+>
+<!ATTLIST tr
+ %common.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT th (%p.pcd.mix;|%p.mix;)*>
+<!ATTLIST th
+ %common.att;
+ %thtd.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!ELEMENT td (%p.pcd.mix;|%p.mix;)*>
+<!ATTLIST td
+ %common.att;
+ %thtd.att;
+ %cellhalign.att;
+ %cellvalign.att;>
+
+<!-- ............................................................... -->
+<!-- Phrase-level elements ......................................... -->
+
+<!-- bibref: Should generate, in square brackets, "key" on bibl -->
+<!ELEMENT bibref EMPTY>
+<!-- ref attribute:
+ A bibliography reference must link to the bibl element that
+ describes the resource. -->
+<!ATTLIST bibref
+ %common.att;
+ %ref-req.att;>
+
+<!ELEMENT code (%tech.pcd.mix;)*>
+<!ATTLIST code %common.att;>
+
+<!--
+#1998-03-10: maler: Declared ednote and related elements.
+-->
+
+<!ELEMENT ednote (name?, date?, edtext)>
+<!ATTLIST ednote %common.att;>
+
+<!ELEMENT date (#PCDATA)>
+<!ATTLIST date %common.att;>
+
+<!ELEMENT edtext (#PCDATA)>
+<!ATTLIST edtext %common.att;>
+
+<!ELEMENT emph (#PCDATA)>
+<!ATTLIST emph %common.att;>
+
+<!-- footnote: Both footnote content and call to footnote -->
+<!ELEMENT footnote (%obj.mix;)+>
+<!ATTLIST footnote %common.att;>
+
+<!ELEMENT kw (%tech.pcd.mix;)*>
+<!ATTLIST kw %common.att;>
+
+<!ELEMENT loc (#PCDATA)>
+<!-- HREF attribute:
+ The purpose of a loc element is to function as a hypertext
+ link to a resource. (Ideally, the content of loc will also
+ mention the URI of the resource, so that readers of the
+ printed version will be able to locate the resource.) -->
+<!ATTLIST loc
+ %common.att;
+ %href-req.att;>
+
+<!ELEMENT nt (#PCDATA)>
+<!-- def attribute:
+ The nonterminal must link to the production that defines
+ it. -->
+<!ATTLIST nt
+ %common.att;
+ %def-req.att;>
+
+<!--
+#1998-03-10: maler: Declared quote.
+-->
+
+<!-- quote: Scare quotes and other purely presentational quotes -->
+<!ELEMENT quote (%p.pcd.mix;)*>
+<!ATTLIST quote %common.att;>
+
+<!-- specref: Should generate italic "[n.n], Section Title" for
+ div, "n" for numbered item, "[n]" for production, or
+ "Issue n" for issue -->
+<!ELEMENT specref EMPTY>
+<!-- ref attribute:
+ The purpose of a specref element is to link to a div, item
+ in an olist, or production in the current spec. -->
+<!ATTLIST specref
+ %common.att;
+ %ref-req.att;>
+
+<!ELEMENT term (#PCDATA)>
+<!ATTLIST term %common.att;>
+
+<!ELEMENT termdef (%termdef.pcd.mix;|%termdef.mix;)*>
+<!-- ID attribute:
+ A term definition must have an ID so that it can be linked
+ to from termref elements. -->
+<!-- term attribute:
+ The canonical form of the term or phrase being defined must
+ appear in this attribute, even if the term or phrase also
+ appears in the element content in identical form (e.g., in
+ the term element). -->
+<!ATTLIST termdef
+ %common-idreq.att;
+ term CDATA #REQUIRED>
+
+<!ELEMENT termref (#PCDATA)>
+<!-- ref attribute:
+ A term reference must link to the termdef element that
+ defines the term. -->
+<!ATTLIST termref
+ %common.att;
+ %def-req.att;>
+
+<!ELEMENT titleref (#PCDATA)>
+<!-- HREF attribute:
+ A title reference can optionally function as a hypertext
+ link to the resource with this title. -->
+<!ATTLIST titleref
+ %common.att;
+ %href.att;>
+
+<!ELEMENT xnt (#PCDATA)>
+<!-- HREF attribute:
+ The nonterminal must hyperlink to a resource that serves
+ to define it (e.g., a production in a related XML
+ specification). -->
+<!ATTLIST xnt
+ %common.att;
+ %href-req.att;>
+
+<!--
+#1997-12-29: maler: Declared xspecref.
+-->
+
+<!ELEMENT xspecref (#PCDATA)>
+<!-- HREF attribute:
+ The spec reference must hyperlink to the resource to
+ cross-refer to (e.g., a section in a related XML
+ specification). -->
+<!ATTLIST xspecref
+ %common.att;
+ %href-req.att;>
+
+<!ELEMENT xtermref (#PCDATA)>
+<!-- HREF attribute:
+ The term reference must hyperlink to the resource that
+ serves to define the term (e.g., a term definition in
+ a related XML specification). -->
+<!ATTLIST xtermref
+ %common.att;
+ %href-req.att;>
+
+<!-- ............................................................... -->
+<!-- Unused elements for ADEPT ..................................... -->
+
+<!--
+#1997-09-30: maler: Added unusued elements.
+#1997-10-14: maler: Fixed div to move nested div to the mixture.
+#1998-05-14: maler: Added key-term, htable, and htbody.
+-->
+
+<!-- The following elements are purposely declared but never
+ referenced. Declaring them allows them to be pasted from
+ an HTML document or an earlier version of an XML spec document
+ into a document using this DTD in ADEPT. The ATD Context
+ Transformation mechanism will try to convert them to the
+ appropriate element for this DTD. While this conversion
+ will not work for all fragments, it does allow many cases
+ to work reasonably well. -->
+
+<!ELEMENT div
+ (head?, (%div.mix;|ul|ol|h1|h2|h3|h4|h5|h6|div)*)>
+<!ELEMENT h1 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h2 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h3 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h4 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h5 (%head.pcd.mix;|em|a)*>
+<!ELEMENT h6 (%head.pcd.mix;|em|a)*>
+<!ELEMENT pre (%eg.pcd.mix;|em)*>
+<!ELEMENT ul (item|li)*>
+<!ELEMENT ol (item|li)*>
+<!ELEMENT li (#PCDATA|%obj.mix;)*>
+<!ELEMENT em (#PCDATA)>
+<!ELEMENT a (#PCDATA)>
+
+<!ELEMENT key-term (#PCDATA)>
+<!ELEMENT htable
+ (caption?, (col*|colgroup*), thead?, tfoot?, tbody+)>
+<!ELEMENT htbody (tr)+>
+<!ELEMENT statusp (%p.pcd.mix;|%p.mix;)*>
+
+<!-- ............................................................... -->
+<!-- Change history ................................................ -->
+
+<!--
+#1997-08-18: maler
+#- Did a major revision.
+#1997-09-10: maler
+#- Updated FPI.
+#- Removed namekey element and put key attribute on name element.
+#- Made statusp element and supporting entities.
+#- Added slist element with sitem+ content.
+#- Required head on scrap and added new bnf subelement.
+#- Added an xnt element and allowed it and nt in regular text and rhs.
+#- Removed the ntref element.
+#- Added back the com element to the content of rhs.
+#- Added a key attribute to bibl.
+#- Removed the ident element.
+#- Added a term element to be used inside termdef.
+#- Added an xtermref element parallel to termref.
+#- Beefed up DTD comments.
+#1997-09-12: maler
+#- Allowed term element in general text.
+#- Changed bibref to EMPTY.
+#- Added ref.class to termdef.pcd.mix.
+#1997-09-14: maler
+#- Changed main attribute of xtermref from def to href.
+#- Added termdef.class to label contents.
+#1997-09-30: maler
+#- Added character entity module and added new entities.
+#- Removed p from appearing directly in self; created %p.mix;.
+#- Added inform-div (non-normative division) element.
+#- Fixed xtermref comment to mention HREF, not ref.
+#- Extended orglist model to allow optional affiliation.
+#- Modified author to make affiliation optional.
+#- Added %speclist.class; and %note.class; to %obj.mix; and %p.mix;.
+#- Added %note.class; and %illus.class; to %termdef.pcd.mix;.
+#- Added unused HTML elements.
+#- Put empty system ID next to public ID in entity declarations.
+#1997-10-14: maler
+#- Fixed "unused" div content model to move nested div to mixture.
+#1997-10-16: maler
+#- Added SGML Open Exchange tables.
+#1997-11-28: maler
+#- Added support for prodgroup and its attributes.
+#- Added support for HTML tables.
+#- Added loc and bibref to content of com.
+#- Added loc to general p content models.
+#- Allowed p as alternative to statusp in status.
+#- Added non-null system IDs to external parameter entity declarations.
+#- (Modified the SGML Open table module to make it XML-compliant.)
+#- (Modified the character entity module.)
+#1997-12-29: maler
+#- Moved #PCDATA occurrences to come before GIs in content models.
+#- Removed use of the SGML Open table module.
+#- Added xspecref element.
+#- Ensured that all FPIs contain 4-digit year.
+#- (Modified the character entity module.)
+#1998-03-10: maler
+#- Merged the character entity and table modules into the main file.
+#- Added ldquo and rdquo entities.
+#- Added common attributes to prodgroup.
+#- Made the email element in header optional.
+#- Removed reference to the SGML Open table model.
+#- Added ednote element.
+#- Added quote element.
+#- Updated XLink usage to reflect 3 March 1998 WD.
+#- Added "local" entities to the class entities for customization.
+#- Parameterized several content models to allow for customization.
+#1998-03-23: maler
+#- Cleaned up some comments and removed some others.
+#- Added xml:space semi-common attribute to eg and bnf elements.
+#- Added show and embed attributes on all the uses of href.
+#- Added %common.att; to all HTML table elements.
+#- Added a real URI to the "typical invocation" comment.
+#1998-05-14: maler
+#- Fixed mdash, ldquo, and rdquo character entities.
+#- Switched to the full HTML 4.0 table model.
+#- Removed htable/htbody elements and replaced them with table/tbody.
+#- Added issue element to %note.class; and declared it.
+#- Allowed prevlocs and latestloc in either order.
+#- Added key-term, htable, htbody, and statusp as unused elements.
+#- Removed real statusp element in favor of plain p.
+#1998-05-21: maler
+#- Declared generic constraint and constraintnote elements.
+#- Added constraintnote to %note.class;.
+#- Added constraint to %eg.pcd.mix; and prod content model.
+-->
+
+<!-- ............................................................... -->
+<!-- End of XML specification DTD .................................. -->
+<!-- ............................................................... --> \ No newline at end of file
diff --git a/test/valid/xlink.xml b/test/valid/xlink.xml
new file mode 100644
index 00000000..19194aaa
--- /dev/null
+++ b/test/valid/xlink.xml
@@ -0,0 +1,529 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification::19990205//EN" "dtds/xmlspec.dtd" [
+<!ENTITY doc-type "WD">
+<!ENTITY iso6.doc.date '29-May-1999'>
+]>
+<!--ArborText, Inc., 1988-1998, v.4002-->
+<?Pub UDT _bookmark _target?>
+<?Pub Inc?>
+<?xml-stylesheet
+href="file:///C|/Program%20Files/SoftQuad/XMetaL%201/display/xmlspec.css"
+type="text/css"?>
+<spec>
+
+<!-- Last edited: 27 May 1999 by bent -->
+<header><?Pub Dtl?>
+ <title>XML Linking Language (XLink)</title>
+ <version>Version 1.0</version>
+ <w3c-designation><!-- &doc-type;-&iso6.doc.date; --> WD-xlink-19990527</w3c-designation>
+ <w3c-doctype>World Wide Web Consortium Working Draft</w3c-doctype>
+ <pubdate><day>29</day><month>May</month><year>1999</year></pubdate>
+ <notice>
+ <p>This draft is for public discussion.</p>
+ </notice>
+ <publoc><loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-current">http://www.w3.org/XML/Group/1999/05/WD-xlink-current</loc></publoc>
+ <prevlocs>
+ <!--Check: was it actually August?-->
+ <loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527">http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527</loc>
+ <loc href="http://www.w3.org/XML/Group/1999/05/WD-xlink-19990505">http://www.w3.org/XML/Group/1999/05/WD-xlink-19990505</loc>
+ <loc href="http://www.w3.org/TR/1998/WD-xlink-19980303">http://www.w3.org/TR/1998/WD-xlink-19980303</loc>
+ <loc href="http://www.w3.org/TR/WD-xml-link-970630">http://www.w3.org/TR/WD-xml-link-970630</loc></prevlocs>
+
+ <authlist>
+ <!--Updated author hrefs dorchard-->
+ <!-- Update Steve's email - bent -->
+ <author>
+ <name>Steve DeRose</name>
+ <affiliation>Inso Corp. and Brown University</affiliation>
+ <email href="mailto:Steven_DeRose@Brown.edu">Steven_DeRose@Brown.edu</email>
+ </author>
+ <author>
+ <name>David Orchard</name>
+ <affiliation>IBM Corp.</affiliation>
+ <email href="mailto:dorchard@ca.ibm.com">dorchard@ca.ibm.com</email>
+ </author>
+ <author>
+ <name>Ben Trafford</name>
+ <affiliation>Invited Expert</affiliation>
+ <email href="mailto:bent@exemplary.net">bent@exemplary.net</email>
+ </author>
+ <!-- I suggest we move Eve and Tim down to the Acknowledgements section. We
+ also ought to add Gabe Beged-Dov there, as well. bent
+ how shall we cite Tim? sjd What about with an Acknowledgments section?
+ -elm <AUTHOR> <NAME>Tim Bray</NAME> <AFFILIATION>Textuality</AFFILIATION>
+ <EMAIL>tbray@textuality.com</EMAIL> </AUTHOR>-->
+ </authlist>
+
+ <status>
+ <p>This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at <loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.</p>
+ <p><emph>Note:</emph> Since working drafts are subject to frequent change, you are advised to reference the above URI, rather than the URIs for working drafts themselves. Some of the work remaining is described in <specref ref="unfinished"/>. </p>
+ <p>This work is part of the W3C XML Activity (for current status, see <loc href="http://www.w3.org/MarkUp/SGML/Activity">http://www.w3.org/XML/Activity </loc>). For information about the XPointer language which is expected to be used with XLink, see <loc href="http://www.w3.org/MarkUp/SGML/Activity">http://www.w3.org/TR/WD-xptr</loc>.
+ </p>
+ <p>See <loc href="http://www.w3.org/TR/NOTE-xlink-principles">http://www.w3.org/TR/NOTE-xlink-principles </loc> for additional background on the design principles informing XLink.</p>
+ <p>Also see <loc href="http://www.w3.org/TR/NOTE-xlink-req/">http://www.w3.org/TR/NOTE-xlink-req/</loc> for the XLink requirements that this document attempts to satisfy.</p>
+ </status>
+
+ <abstract>
+ <!-- edited the abstract for further clarity - bent -->
+ <p>This specification defines constructs that may be inserted into XML DTDs, schemas and document instances to describe links between objects. It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today's HTML as well as more sophisticated links.</p>
+ </abstract>
+
+ <pubstmt>
+ <p>Burlington, Seekonk, et al.: World-Wide Web Consortium, XML Working Group, 1998.</p>
+ </pubstmt>
+
+ <sourcedesc>
+ <p>Created in electronic form.</p>
+ </sourcedesc>
+
+ <langusage>
+ <language id="en">English</language>
+ <language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
+ </langusage>
+
+ <revisiondesc>
+ <slist>
+ <sitem>1997-01-15 : Skeleton draft by TB</sitem>
+ <sitem>1997-01-24 : Fleshed out by sjd</sitem>
+ <sitem>1997-04-08 : Substantive draft</sitem>
+ <sitem>1997-06-30 : Public draft</sitem>
+ <sitem>1997-08-01 : Public draft</sitem>
+ <sitem>1997-08-05 : Prose/organization work by sjd</sitem>
+ <sitem>1997-10-14: Conformance and design principles; a bit of cleanup by elm</sitem>
+ <sitem>1997-11-07: Update for editorial issues per issues doc, by sjd.</sitem>
+ <sitem>1997-12-01: Update for editorial issues per issues doc in preparation for F2F meeting, by sjd.</sitem>
+ <sitem>1998-01-13: Editorial cleanup, addition of new design principles, by elm.</sitem>
+ <sitem>1998-02-27: Splitting out of XLink and XPointer, by elm.</sitem>
+ <sitem>1998-03-03: Moved most of the XPointer locator stuff here. elm</sitem>
+ <sitem>1999-04-24: Editorial rewrites to represent new ideas on XLink, especially the inclusion of arcs. bent</sitem>
+ <sitem>1999-05-05: Prose/organization work by dorchard. Moved much of the semantics section around, from: locators, link semantics, remote resource semantics, local resource semantics; to: resource semantics, locators, behavior semantics, link semantics, arc semantics</sitem>
+ <sitem>1999-05-12: Prose/organization work. Re-organized some of the sections, removed XML constructs from the document, added descriptive prose, edited document text for clarity. Rewrote the link recognition section. bent</sitem>
+ <sitem>1999-05-17: Further prose work. Added non-normative examples. Clarified arcs. bent</sitem>
+ <sitem>1999-05-23: Edited for grammar and clarity. bent</sitem>
+ <sitem>1999-05-27: Final once-over before sending to group. Fixed sjd's email address. bent</sitem>
+ </slist>
+ </revisiondesc>
+</header>
+
+<body>
+ <div1><?Pub Dtl?>
+ <head>Introduction</head>
+ <p>This specification defines constructs that may be inserted into XML DTDs, schemas, and document instances to describe links between objects. A <termref def="dt-link">link</termref>, as the term is used here, is an explicit relationship between two or more data objects or portions of data objects. This specification is concerned with the syntax used to assert link existence and describe link characteristics. Implicit (unasserted) relationships, for example that of one word to the next or that of a word in a text to its entry in an on-line dictionary are obviously important, but outside its scope.</p>
+ <p>Links are asserted by <xtermref href="WD-xml-lang.html#dt-element">elements </xtermref> contained in <xtermref href="WD-xml-lang.html#dt-xml-doc">XML document instances</xtermref>. The simplest case is very like an HTML <code>A</code> link, and has these characteristics:
+ <ulist>
+ <item><p>The link is expressed at one of its ends (similar to the <code>A</code> element in some document)</p></item>
+ <item><p>Users can only initiate travel from that end to the other</p></item>
+ <item><p>The link's effect on windows, frames, go-back lists, stylesheets in use, and so on is mainly determined by browsers, not by the link itself. For example, traveral of <code>A</code> links normally replaces the current view, perhaps with a user option to open a new window.</p></item>
+ <item><p>The link goes to only one destination (although a server may have great freedom in finding or dynamically creating that destination).</p></item>
+ </ulist>
+ </p>
+ <p>While this set of characteristics is already very powerful and obviously has proven itself highly useful and effective, each of these assumptions also limits the range of hypertext functionality. The linking model defined here provides ways to create links that go beyond each of these specific characteristics, thus providing features previously available mostly in dedicated hypermedia systems.
+ </p>
+
+<div2>
+ <head>Origin and Goals</head>
+ <p>Following is a summary of the design principles governing XLink:
+ <olist>
+ <item><p>XLink must be straightforwardly usable over the Internet. </p></item>
+ <item><p>XLink must be usable by a wide variety of link usage domains and classes of linking application software.</p></item>
+ <item><p>XLink must support HTML 4.0 linking constructs.</p></item>
+ <item><p>The XLink expression language must be XML.</p></item>
+ <item><p>The XLink design must be formal, concise, and illustrative.</p></item>
+ <item><p>XLinks must be human-readable and human-writable.</p></item>
+ <item><p>XLinks may reside within or outside the documents in which the
+ participating resources reside. </p></item>
+ <item><p>XLink must represent the abstract structure and significance of links.</p></item>
+ <item><p>XLink must be feasible to implement.</p></item>
+ <item><p>XLink must be informed by knowledge of established hypermedia systems and standards.</p></item>
+ </olist>
+ </p>
+</div2>
+<!--Changed the list of requirements to reflect current XLink requirements
+document. bent-->
+
+<div2>
+ <head>Relationship to Existing Standards</head>
+ <p>Three standards have been especially influential:
+ <ulist>
+ <item><p><emph>HTML:</emph> Defines several SGML element types that represent links.</p></item>
+ <item><p><emph>HyTime:</emph> Defines inline and out-of-line link structures and some semantic features, including traversal control and presentation of objects. <!--Changed from "placement of objects into a display or other space" -elm-->
+ </p></item>
+ <item><p><emph>Text Encoding Initiative Guidelines (TEI P3):</emph> Provides structures for creating links, aggregate objects, and link collections out of them.</p></item>
+ </ulist>
+ </p>
+ <p>Many other linking systems have also informed this design, especially Dexter, FRESS, MicroCosm, and InterMedia.</p>
+</div2>
+
+<div2>
+ <head>Terminology</head>
+ <p>The following basic terms apply in this document. <!--<IMG
+ SRC="local://./linkdiag.gif">(figure to be inserted)-->
+ <glist>
+ <gitem>
+ <label><termdef id="dt-arc" term="Arc">arc</termdef></label>
+ <def><p>A symbolic representation of traversal behavior in links, especially the direction, context and timing of traversal.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-eltree" term="Element Tree">element tree</termdef></label>
+ <def><p>A representation of the relevant structure specified by the tags and attributes in an XML document, based on "groves" as defined in the ISO DSSSL standard. </p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-inline" term="In-Line Link">inline link</termdef></label>
+ <def><p>Abstractly, a <termref def="dt-link">link</termref> which serves as one of its own <termref def="dt-resource">resources</termref>. Concretely, a link where the content of the <termref def="dt-linkel">linking element</termref> serves as a <termref def="dt-particip-resource">participating resource</termref>.
+ HTML <code>A</code>, HyTime <code>clink</code>, and TEI <code>XREF</code>
+ are all inline links.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-link" term="Link">link</termdef></label>
+ <def><p>An explicit relationship between two or more data objects or portions of data objects.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-linkel" term="Linking Element">linking element </termdef></label>
+ <def><p>An <xtermref href="WD-xml-lang.html#dt-element">element</xtermref> that asserts the existence and describes the characteristics of a <termref def="dt-link"> link</termref>.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-local-resource" term="Local Resource">local resource</termdef></label>
+ <def><p>The content of an <termref def="dt-inline">inline</termref>linking element. Note that the content of the linking element could be explicitly pointed to by means of a regular <termref def="dt-locator">locator</termref> in the same linking element, in which case the resource is considered <termref def="dt-remote-resource"> remote</termref>, not local.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-locator" term="Locator">locator</termdef> </label>
+ <def><p>Data, provided as part of a link, which identifies a
+ <termref def="dt-resource">resource</termref>.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-multidir" term="Multi-Directional Link">multidirectional link</termdef></label>
+ <def><p>A <termref def="dt-link">link</termref> whose <termref def="dt-traversal"> traversal</termref> can be initiated from more than one of its <termref def="dt-particip-resource"> participating resources</termref>. Note that being able to "go back" after following a one-directional link does not make the link multidirectional.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-outofline" term="Out-of-line Link">out-of-line link</termdef></label>
+ <def><p>A <termref def="dt-link">link</termref> whose content does not serve as one of the link's <termref def="dt-particip-resource">participating resources </termref>. Such links presuppose a notion like <termref def="dt-xlg">extended link groups</termref>, which instruct application software where to look for links. Out-of-line links are generally required for supporting multidirectional <termref def="dt-traversal">traversal</termref> and for allowing read-only resources to have outgoing links.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-parsedq" term="Parsed">parsed</termdef></label> <def><p>In the context of link behavior, a parsed link is any link whose content is transcluded into the document where the link originated. The use of the term "parsed" directly refers to the concept in XML of a
+ parsed entity.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-particip-resource" term="Participating Resource"> participating resource</termdef></label>
+ <def><p>A <termref def="dt-resource">resource</termref> that belongs to a link. All resources are potential contributors to a link; participating resources are the actual contributors to a particular link.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-remote-resource" term="Remote Resource">remote resource</termdef></label>
+ <def><p>Any participating resource of a link that is pointed to with a locator. </p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-resource" term="Resource">resource</termdef></label>
+ <def><p>In the abstract sense, an addressable unit of information or service that is participating in a <termref def="dt-link">link</termref>. Examples include files, images, documents, programs, and query results. Concretely, anything reachable by the use of a <termref def="dt-locator">locator</termref> in some <termref def="dt-linkel">linking element</termref>. Note that this term and its definition are taken from the basic specifications governing the World Wide Web. <!--Joel notes: need link here. bent asks: A link?-->
+ </p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-subresource" term="sub-Resource">sub-resource</termdef></label>
+ <def><p>A portion of a resource, pointed to as the precise destination of a link. As one example, a link might specify that an entire document be retrieved and displayed, but that some specific part(s) of it is the specific linked data, to be treated in an application-appropriate manner such as indication by highlighting, scrolling, etc.</p></def>
+ </gitem>
+ <gitem>
+ <label><termdef id="dt-traversal" term="Traversal">traversal</termdef></label>
+ <def><p>The action of using a <termref def="dt-link">link</termref>; that is, of accessing a <termref def="dt-resource">resource</termref>. Traversal may be initiated by a user action (for example, clicking on the displayed content of a <termref def="dt-linkel">linking element</termref>) or occur under program control.</p></def>
+ </gitem>
+ </glist>
+ </p>
+</div2>
+
+<div2>
+ <head>Notation</head>
+ <p>The formal grammar for <termref def="dt-locator">locators</termref> is given using a simple Extended Backus-Naur Form (EBNF) location, as described in <xspecref href="http://www.w3.org/TR/REC-xml#sec-notation">the XML specification</xspecref>.</p>
+ <!-- fixed link to XML spec - bent -->
+</div2>
+</div1>
+
+<div1 id="addressing"><?Pub Dtl?>
+ <head>Locator Syntax</head>
+ <p>The locator for a <termref def="dt-resource">resource</termref> is typically provided by means of a Uniform Resource Identifier, or URI. XPointers can be used in conjunction with the URI structure, as fragment identifiers, to specify a more precise sub-resource. </p>
+ <!-- Removed the discussion of queries from the previous paragraph, due to contention within the WG. bent -->
+ <p>A locator generally contains a URI, as described in IETF RFCs <bibref ref="rfc1738"/> and <bibref ref="rfc1808"/>. As these RFCs state, the URI may include a trailing <emph>query</emph> (marked by a leading "<code>?</code>"), and be followed by a "<code>#</code>" and a <emph>fragment identifier</emph>, with the query interpreted by the host providing the indicated resource, and the interpretation of the fragment identifier dependent on the data type of the indicated resource.</p>
+ <!--Is there some restriction on URNs having queries and/or fragment identifiers? Since these RFCs don't mention URIs explicitly, should the wording here lead from URLs to URIs more explicitly? -elm-->
+ <p>In order to locate XML documents and portions of documents, a locator value may contain either a <xtermref href="http://www.w3.org/Addressing/rfc1738.txt"> URI</xtermref> or a fragment identifier, or both. Any fragment identifier for pointing into XML must be an <xtermref href="http://www.w3.org/TR/WD-xptr#dt-xpointer"> XPointer</xtermref>.</p>
+ <p>Special syntax may be used to request the use of particular processing models in accessing the locator's resource. This is designed to reflect the realities of network operation, where it may or may not be desirable to exercise fine control over the distribution of work between local and remote processors.
+ <scrap id="locator" lang="ebnf">
+ <head>Locator</head>
+ <prod id="nt-locator">
+ <lhs>Locator</lhs>
+ <rhs><nt def="nt-uri">URI</nt></rhs>
+ <rhs>| <nt def="nt-connector">Connector</nt> (<xnt href="http://www.w3.org/TR/WD-xptr">XPointer</xnt> | <xnt href="WD-xml-lang.html#NT-Name">Name</xnt>)</rhs>
+ <rhs>| <nt def="nt-uri">URI</nt> <nt def="nt-connector">Connector</nt> (<xnt href="http://www.w3.org/TR/WD-xptr">XPointer</xnt> | <xnt href="WD-xml-lang.html#NT-Name">Name</xnt>)</rhs>
+ </prod>
+ <prod id="nt-connector">
+ <lhs>Connector</lhs><rhs>'#' | '|'</rhs>
+ </prod>
+ <prod id="nt-uri">
+ <lhs>URI</lhs><rhs><xnt href="WD-xml-lang.html#NT-URLchar">URIchar*</xnt></rhs>
+ </prod>
+ </scrap>
+ </p>
+ <p><termdef id="dt-designated" term="Designated Resource">In this discussion, the term <term>designated resource</term> refers to the resource which an entire locator serves to locate.</termdef> The following rules apply:
+ <ulist>
+ <item>
+ <p><termdef id="dt-containing-resource" term="Containing Resource"> The URI, if provided, locates a resource called the <term>containing resource</term>.</termdef></p>
+ </item>
+ <item>
+ <p>If the URI is not provided, the containing resource is considered to be the document in which the linking element is contained.
+ </p></item>
+ <item>
+ <p><termdef id="dt-sub-resource" term="Sub-Resource">If an XPointer is provided, the designated resource is a <term>sub-resource</term>
+ of the containing resource; otherwise the designated resource is the
+ containing resource.</termdef></p>
+ </item>
+ <!--Is this now incorrect, given the nature of the switch from here() to origin()? -elm
+ Oy, yes, i think so. it will require some fun wording, though, so i haven't fixed it yet here -sjd-->
+ <item>
+ <p>If the <nt def="nt-connector">Connector</nt> is followed directly by a <xnt href="http://www.w3.org/TR/REC-xml#NT-Name">Name</xnt>, the <xnt href="http://www.w3.org/TR/REC-xml#NT-Name">Name</xnt> is shorthand for the XPointer"<code>id(Name)</code>"; that is, the sub-resource is the element in the containing resource that has an XML <xtermref href="http://www.w3.org/TR/REC-xml#sec-attrtypes">ID attribute</xtermref> whose value <xtermref href="http://www.w3.org/TR/REC-xml#dt-match">matches</xtermref> the <xnt href="http://www.w3.org/TR/REC-xml#NT-Name">Name</xnt>. This shorthand is to encourage use of the robust <code>id</code> addressing mode.</p>
+ </item>
+ <!-- fixed links to the XML recommendation - bent -->
+ <item>
+ <p>If the connector is "<code>#</code>", this signals an intent that the containing resource is to be fetched as a whole from the host that provides it, and that the XPointer processing to extract the sub-resource
+ is to be performed on the client, that is to say on the same system where the linking element is recognized and processed.</p>
+ </item>
+ <item>
+ <p>If the connector is "<code>|</code>", no intent is signaled as to what processing model is to be used to go about accessing the designated resource.</p>
+ </item>
+ </ulist>
+ </p>
+ <p>Note that the definition of a URI includes an optional query component. </p>
+ <p>In the case where the URI contains a query (to be interpreted by the server), information providers and authors of server software are urged to use queries as follows:
+ <scrap id="querysyntax" lang="ebnf">
+ <head>Query</head>
+ <prod id="nt-query">
+ <lhs>Query</lhs><rhs>'XML-XPTR=' (<xnt href="http://www.w3.org/TR/WD-xptr"> XPointer</xnt> | <xnt href="http://www.w3.org/TR/REC-xml#NT-Name">Name</xnt>)</rhs>
+ </prod>
+ </scrap>
+ </p>
+ <!-- fixed link to XML recommendation - bent -->
+</div1>
+
+<div1><?Pub Dtl?>
+ <head>Link Recognition</head>
+ <p>The existence of a <termref def="dt-link">link</termref> is asserted by a <termref def="dt-linkel">linking element</termref>. Linking elements must be recognized reliably by application software in order to provide appropriate display and behavior. There are several ways link recognition could be accomplished: for example, reserving element type names, reserving attributes names, leaving the matter of recognition entirely up to stylesheets and application software, or using the XLink <xtermref href="http://www.w3.org/TR/REC-xml-names/">namespace</xtermref> to specify element names and attribute names that would be recognized by namespace and XLink-aware processors. Using element and attribute names within the XLink namespace provides a balance between giving users control of their own markup language design and keeping the identification of linking elements simple and unambiguous.</p>
+ <p>The two approaches to identifying linking elements are relatively simple to implement. For example, here's how the HTML <code>A</code> element would be declared using attributes within the XLink namespace, and then how an element within the XLink namespace might do the same:
+ <eg>&lt;A xlink:type="simple" xlink:href="http://www.w3.org/TR/wd-xlink/"
+xlink:title="The Xlink Working Draft"&gt;The XLink Working Draft.&lt;/A&gt;</eg>
+ <eg>&lt;xlink:simple href="http://www.w3.org/TR/wd-xlink/"
+title="The XLink Working Draft"&gt;The XLink Working Draft&lt;/xlink:simple&gt;</eg>
+ Any arbitrary element can be made into an XLink by using the <code>xlink:type</code> attribute. And, of course, the explicit XLink elements may be used, as well. This document will go on to describe the linking attributes that are associated with linking elements. It may be assumed by the reader that these attributes would require the <code>xlink</code> namespace prefix if they existed within an arbitrary element, or that they may be used directly if they exist within an explicit Xlink element.</p>
+ <!-- heavily modified this section to accomodate namespace-aware link recognition - bent -->
+</div1>
+
+<!-- Rewrote this entire section. - bent -->
+<div1>
+ <head>Linking Attributes</head>
+ <p>XLink has several attributes associated with the variety of links it may represent. These attributes define four main concepts: locators, arcs, behaviors, and semantics. <emph>Locators</emph> define where the actual resource is located. <emph>Arcs</emph> define the traversal of links. Where does the link come from? Where does it go to? All this information can be stored in the arc attributes. <emph>Behaviors</emph> define how the link is activated, and what the application should do with the resource being linked to. <emph>Semantics</emph> define useful information that the application may use, and enables the link for such specalized targets as constricted devices and accessibility software.</p>
+
+ <div2 id="link-locators">
+ <head>Locator Attributes</head>
+ <p>The only locator attribute at this time is <code>href</code>. This attribute must contain either a string in the form of a URI that defines the remote resource being linked to, a string containing a fragment identifier that links to a local resource, or a string containing a URI with a fragment identifier concacenated onto it.</p>
+ </div2>
+
+ <div2 id="link-arcs">
+ <head>Arc Attributes</head>
+ <p>Arcs contain two attributes, <code>from</code> and <code>to</code>. The <code>from</code> attribute may contain a string containing the content of a <code>role</code> attribute from the resource being linked from. The purpose of the <code>from</code> attribute is to define where this link is being actuated from.</p>
+ <p>The <code>to</code> attribute may contain a string containing the content of a <code>role</code> attribute from the resource being linked to. The purpose of the <code>to</code> attribute is to define where this link traverses to.</p>
+ <p>The application may use this information in a number of ways, especially in a complex hypertext system, but it is mainly useful in providing context for application behavior.</p>
+ <!-- I'm at a loss as to how to describe arcs more clearly than this. I don't want to devolve into discussions of directed graphs and n-ary links. -bent -->
+ </div2>
+
+ <div2 id="link-behaviors">
+ <head>Behavior Attributes</head>
+ <p>There are two attributes associated with behavior: <code>show</code> and <code>actuate</code>. The <code>show</code> attribute defines how the remote resource is to be revealed to the user. It has three options: <code>new</code>, <code>parsed</code>, and <code>replace</code>. The <code>new</code> option indicates that the remote resource should be shown in a new window (or other device context) without replacing the previous content. The <code>parsed</code> option, relating directly to the XML concept of a parsed entity, indicates that the content should be integrated into the document from which the link was actuated. The <code>replace</code> option is the one most commonly seen on the World Wide Web, where the document being linked from is entirely replaced by the object being linked to.</p>
+ <p>The <code>actuate</code> attribute defines how the link is initiated. It has two options: <code>user</code> and <code>auto</code>. The <code>user</code> option indicates that the link must be initiated by some sort of human-initiated selection, such as clicking on an HTML anchor. The <code>auto</code> option indicates that the link is automatically initiated when the application deems that the user has reached the link. It then follows the behavior set out in the <code>show</code> option.</p>
+ <!-- Something should be put here in terms of an example. Idea: "A" link versus automatically updating encyclopedia. -bent -->
+ </div2>
+
+ <div2 id="link-semantics">
+ <head>Semantic Attributes</head>
+ <p>There are two attributes associated with semantics, <code>role</code> and <code>title</code>. The <code>role</code> attribute is a generic string used to describe the function of the link's content. For example, a poem might have a link with a <code>role="stanza"</code>. The <code>role</code> is also used as an identifier for the <code>from</code> and <code>to</code> attributes of arcs.</p>
+ <p>The <code>title</code> attribute is designed to provide human-readable text describing the link. It is very useful for those who have text-based applications, whether that be due to a constricted device that cannot display the link's content, or if it's being read by an application to a visually-impaired user, or if it's being used to create a table of links. The <code>title</code> attribute contains a simple, descriptive string.</p>
+ </div2>
+</div1>
+
+<div1 id="linking-elements">
+ <head>Linking Elements</head>
+ <p>There are several kinds of linking elements in XLink: <code>simple</code> links, <code>locators</code>, <code>arcs</code>, and <code>extended</code> links. These elements may be instantiated via element declarations from the XLink namespace, or they may be instantiated via attribute declarations from the XLink namespace. Both kinds of instantiation are described in the definition of each linking element.</p>
+ <p>The <code>simple</code> link is used to declare a link that approximates the functionality of the HTML <code>A</code> element. It has, however, a few added features to increase its value, including the potential declaration of semantics and behavior. The <code>locator</code> elements are used to define the resource being linked to. Some links may contain multiple locators, representing a choice of potential links to be traversed. The <code>arcs</code> are used to define the traversal semantics of the link. Finally, an <code>extended</code> linking element differs from a simple link in that it can connect any number of resources, not just one local resource (optionally) and one remote resource, and in that extended links are more often out-of-line than simple links.</p>
+
+<div2 id="simple-links">
+ <head>Simple Links</head>
+ <p id="dt-simplelink"><termdef id="dt-simpleline" term="Simple Link"><term>Simple links</term> can be used for purposes that approximate the functionality of a basic HTML <code>A</code> link, but they can also support a limited amount of additional functionality. Simple links have only one locator and thus, for convenience, combine the functions of a linking element and a locator into a single element.</termdef> As a result of this combination, the simple linking element offers both a locator attribute and all the behavior and semantic attributes.</p>
+ <p>The following are two examples of linking elements, each showing all the possible attributes that can be associated with a simple link. Here is the explicit XLink simple linking element.
+ <eg>&lt;!ELEMENT xlink:simple ANY&gt;
+&lt;!ATTLIST xlink:slink
+ href CDATA #REQUIRED
+ role CDATA #IMPLIED
+ title CDATA #IMPLIED
+ show (new|parsed|replace) "replace"
+ actuate (user|auto) "user"
+&gt;</eg>
+ And here is how to make an arbitrary element into a simple link.
+ <eg>&lt;!ELEMENT xlink:simple ANY&gt;
+&lt;!ATTLIST foo
+ xlink:type (simple|extended|locator|arc) #FIXED "simple"
+ xlink:href CDATA #REQUIRED
+ xlink:role CDATA #IMPLIED
+ xlink:title CDATA #IMPLIED
+ xlink:show (new|parsed|replace) "replace"
+ xlink:actuate (user|auto) "user"
+&gt;</eg>
+ Here is how the first example might look in a document:
+<eg>&lt;xlink:simple href="http://www.w3.org/TR/wd-xlink" role="working draft"
+ title="The XLink Working Draft" show="replace" actuate="user"&gt;
+The XLink Working Draft.&lt;/xlink:simple&gt;</eg>
+<eg>&lt;foo xlink:href="http://www.w3.org/TR/wd-xlink" xlink:role="working draft"
+ xlink:title="The XLink Working Draft" xlink:show="new" xlink:actuate="user"&gt;
+The XLink Working Draft.&lt;/foo&gt;</eg>
+ Alternately, a simple link could be as terse as this:
+<eg>&lt;foo xlink:href="#stanza1"&gt;The First Stanza.&lt;/foo&gt;</eg>
+ </p>
+ <p>
+ There are no constraints on the contents of a simple linking element. In
+ the sample declaration above, it is given a content model of <code>ANY</code>
+ to illustrate that any content model or declared content is acceptable. In
+ a valid document, every element that is significant to XLink must still conform
+ to the constraints expressed in its governing DTD.</p>
+ <p>Note that it is meaningful to have an out-of-line simple link, although
+ such links are uncommon. They are called "one-ended" and are typically used
+ to associate discrete semantic properties with locations. The properties might
+ be expressed by attributes on the link, the link's element type name, or in
+ some other way, and are not considered full-fledged resources of the link.
+ Most out-of-line links are extended links, as these have a far wider range
+ of uses.</p>
+</div2>
+
+<div2 id="extended-link">
+<head>Extended Links</head>
+ <p><termdef id="dt-extendedlink" term="Extended Link">An <term>extended link</term> differs from a simple link in that it can connect any number of resources, not just one local resource (optionally) and one remote resource, and in that extended links are more often out-of-line than simple links.</termdef></p>
+ <p>These additional capabilities of extended links are required for:
+ <ulist>
+ <item>
+ <p>Enabling outgoing links in documents that cannot be modified to add an inline link</p>
+ </item>
+ <item>
+ <p>Creating links to and from resources in formats with no native support for embedded links (such as most multimedia formats)</p>
+ </item>
+ <item>
+ <p>Applying and filtering sets of relevant links on demand</p>
+ </item>
+ <item><p>Enabling other advanced hypermedia capabilities</p></item>
+ </ulist>
+ </p>
+ <p>Application software might be expected to provide traversal among all of a link's participating resources (subject to semantic constraints outside the scope of this specification) and to signal the fact that a given resource or sub-resource participates in one or more links when it is displayed (even though there is no markup at exactly that point to signal it).</p>
+ <p>A linking element for an extended link contains a series of <xtermref href="http://www.w3.org/TR/REC-xml/#dt-parentchild">child elements</xtermref> that serve as locators and arcs. Because an extended link can have more than one remote resource, it separates out linking itself from the mechanisms used to locate each resource (whereas a simple link combines the two).</p>
+ <p>The <code>xlink:type</code> attribute value for an extended link must be <code> extended</code>, if the link is being instantiated on an arbitrary element. Note that extended links introduce variants of the <code>show</code> and <code>actuate</code> behavior attributes. These attributes, the <code>showdefault</code> and <code>actuatedefault</code> define the same behavior as their counterparts. However, in this case, they are considered to define the default behavior for all the linking elements that they contain.</p>
+ <p>However, when a linking element within an extended link has a <code>show</code> or <code>actuate</code> attribute of its own, that attribute overrides the defaults set on the extended linking element.</p>
+ <p>The extended linking element itself retains those attributes relevant to the link as a whole, and to its local resource if any. Following are two sample declaration for an extended link. The first is an example of the explicit XLink extended link:
+
+<eg>&lt;!ELEMENT xlink:extended ((xlink:arc | xlink:locator)*)>
+&lt;!ATTLIST xlink:extended
+ role CDATA #IMPLIED
+ title CDATA #IMPLIED
+ showdefault (new|parsed|replace) #IMPLIED
+ actuatedefault (user|auto) #IMPLIED &gt;</eg>
+
+ The second is an example of an arbitrary element being used an extended link:
+
+<eg>&lt;!ELEMENT foo ((xlink:arc | xlink:locator)*)>
+&lt;!ATTLIST foo
+ xlink:type (simple|extended|locator|arc) #FIXED "extended"
+ xlink:role CDATA #IMPLIED
+ xlink:title CDATA #IMPLIED
+ xlink:showdefault (new|parsed|replace) #IMPLIED
+ xlink:actuatedefault (user|auto) #IMPLIED &gt;</eg>
+
+ The following two examples demonstrate how each of the above might appear within a document instance. Note that the content of these examples would be other elements. For brevity's sake, they've been left blank. The first example shows how the link might appear, using an explicit XLink extended link:
+
+<eg>&lt;xlink:extended role="address book" title="Ben's Address Book" showdefault="replace" actuatedefault="user"&gt; ... &lt;/xlink:extended&gt;</eg>
+
+ And the second shows how the link might appear, using an arbitrary element:
+
+<eg>&lt;foo xlink:type="extended" xlink:role="address book" xlink:title="Ben's Address Book" xlink:showdefault="replace" xlink:actuatedefault="user"&gt; ... &lt;/foo&gt;</eg>
+ </p>
+
+</div2>
+
+<div2 id="xlink-arcs">
+ <head>Arc Elements</head>
+ <p><termdef id="dt-arc" term="Arc">An <term>arc</term> is contained within an extended link for the purpose of defining traversal behavior.</termdef> More than one arc may be associated with a link. Otherwise, arc elements function exactly as the arc attributes might lead on to expect.</p>
+ <!-- More here? -bent -->
+</div2>
+
+</div1>
+<div1>
+<head>Conformance</head>
+<p>An element conforms to XLink if: <olist>
+<item><p>The element has an <code>xml:link</code> attribute whose value is
+one of the attribute values prescribed by this specification, and</p></item>
+<item><p>the element and all of its attributes and content adhere to the
+syntactic
+requirements imposed by the chosen <code>xml:link</code> attribute value,
+as prescribed in this specification.</p></item>
+</olist></p>
+<p>Note that conformance is assessed at the level of individual elements,
+rather than whole XML documents, because XLink and non-XLink linking mechanisms
+may be used side by side in any one document.</p>
+<p>An application conforms to XLink if it interprets XLink-conforming elements
+according to all required semantics prescribed by this specification and,
+for any optional semantics it chooses to support, supports them in the way
+prescribed. <!--If/when we split out the XLinkfunctionality
+(e.g. inline links and out-of-line links), the
+conformance language will have to address the different
+levels of support. -elm--> </p>
+</div1>
+</body><back>
+<div1 id="unfinished">
+<head>Unfinished Work</head>
+<div2>
+<head>Structured Titles</head>
+<p>The simple title mechanism described in this draft is insufficient to cope
+with internationalization or the use of multimedia in link titles. A future
+version will provide a mechanism for the use of structured link titles.</p>
+</div2>
+</div1>
+<div1>
+<head>References</head>
+<blist>
+<bibl id="xptr" key="XPTR">Eve Maler and Steve DeRose, editors. <titleref>
+XML Pointer Language (XPointer) V1.0</titleref>. ArborText, Inso, and Brown
+University. Burlington, Seekonk, et al.: World Wide Web Consortium, 1998.
+(See <loc href="http://www.w3.org/TR/WD-xptr">http://www.w3.org/TR/WD-xptr
+ </loc>.)</bibl>
+<bibl id="iso10744" key="ISO/IEC 10744">ISO (International Organization for
+Standardization). <titleref>ISO/IEC 10744-1992 (E). Information technology
+- Hypermedia/Time-based Structuring Language (HyTime).</titleref> [Geneva]:
+International Organization for Standardization, 1992. <titleref>Extended
+Facilities
+Annex.</titleref> [Geneva]: International Organization for Standardization,
+1996. (See <loc
+href="http://www.ornl.gov/sgml/wg8/hytime/html/is10744r.html">http://www.ornl.go
+v/sgml/wg8/hytime/html/is10744r.html </loc> <!--p m-r says this link is
+broken. elm --> ).</bibl>
+<bibl id="rfc1738" key="IETF RFC 1738">IETF (Internet Engineering Task
+Force). <titleref>
+RFC 1738: Uniform Resource Locators</titleref>. 1991. (See <loc
+href="http://www.w3.org/Addressing/rfc1738.txt">
+http://www.w3.org/Addressing/rfc1738.txt</loc>).</bibl>
+<bibl id="rfc1808" key="IETF RFC 1808">IETF (Internet Engineering Task
+Force). <titleref>
+RFC 1808: Relative Uniform Resource Locators</titleref>. 1995. (See <loc
+href="http://www.w3.org/Addressing/rfc1808.txt">http://www.w3.org/Addressing/rfc
+1808.txt </loc>).</bibl>
+<bibl id="tei" key="TEI">C. M. Sperberg-McQueen and Lou Burnard, editors.
+<titleref>
+Guidelines for Electronic Text Encoding and Interchange</titleref>. Association
+for Computers and the Humanities (ACH), Association for Computational
+Linguistics
+(ACL), and Association for Literary and Linguistic Computing (ALLC). Chicago,
+Oxford: Text Encoding Initiative, 1994. <!-- add cite to DOM work --> </bibl>
+<bibl id="chum" key="CHUM">]Steven J. DeRose and David G. Durand. 1995. "The
+TEI Hypertext Guidelines." In <titleref>Computing and the Humanities
+</titleref>29(3).
+Reprinted in <titleref>Text Encoding Initiative: Background and
+Context</titleref>,
+ed. Nancy Ide and Jean ronis <!-- fix this name -->, ISBN 0-7923-3704-2. </bibl>
+</blist></div1>
+</back></spec>
+<?Pub *0000052575?>
diff --git a/test/warning/ent8 b/test/warning/ent8
new file mode 100644
index 00000000..62409390
--- /dev/null
+++ b/test/warning/ent8
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<!DOCTYPE a SYSTEM "a.dtd">
+<a> &unknown; but Okay </a>
diff --git a/testSAX.c b/testSAX.c
index c64bc3cd..2b2e89bc 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -61,6 +61,7 @@ xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* xmlParserWarning */
NULL, /* xmlParserError */
NULL, /* xmlParserError */
+ NULL, /* getParameterEntity */
};
xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
@@ -156,7 +157,10 @@ internalSubsetDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
name, ExternalID, SystemID);
if ((ExternalID != NULL) || (SystemID != NULL)) {
- externalSubset = xmlSAXParseDTD(debugSAXHandler, ExternalID, SystemID);
+ externalSubset = xmlParseDTD(ExternalID, SystemID);
+ if (externalSubset != NULL) {
+ xmlFreeDtd(externalSubset);
+ }
}
}
@@ -209,6 +213,22 @@ getEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
return(NULL);
}
+/**
+ * getParameterEntityDebug:
+ * @ctxt: An XML parser context
+ * @name: The entity name
+ *
+ * Get a parameter entity by name
+ *
+ * Returns the xmlParserInputPtr
+ */
+xmlEntityPtr
+getParameterEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *name)
+{
+ fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
+ return(NULL);
+}
+
/**
* entityDeclDebug:
@@ -541,6 +561,7 @@ xmlSAXHandler debugSAXHandlerStruct = {
warningDebug,
errorDebug,
fatalErrorDebug,
+ getParameterEntityDebug,
};
xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
diff --git a/testXPath.c b/testXPath.c
index 1342ffbf..27e17ab7 100644
--- a/testXPath.c
+++ b/testXPath.c
@@ -81,7 +81,12 @@ void xmlXPAthDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur) {
fprintf(output, "Set contains %d nodes:\n", cur->nodeNr);
for (i = 0;i < cur->nodeNr;i++) {
fprintf(output, "%d", i + 1);
- xmlDebugDumpOneNode(output, cur->nodeTab[i], 2);
+ if (cur->nodeTab[i] == NULL)
+ fprintf(output, " NULL\n");
+ else if (cur->nodeTab[i]->type == XML_DOCUMENT_NODE)
+ fprintf(output, " /\n");
+ else
+ xmlDebugDumpOneNode(output, cur->nodeTab[i], 2);
}
}
diff --git a/tester.c b/tester.c
index af7722e9..89d1ff67 100644
--- a/tester.c
+++ b/tester.c
@@ -35,6 +35,10 @@ static int copy = 0;
static int recovery = 0;
static int noent = 0;
static int noout = 0;
+static int valid = 0;
+static int repeat = 0;
+
+extern int xmlDoValidityCheckingDefaultValue;
/*
* Note: there is a couple of errors introduced on purpose.
@@ -178,7 +182,7 @@ void parseAndPrintBuffer(CHAR *buf) {
}
int main(int argc, char **argv) {
- int i;
+ int i, count;
int files = 0;
for (i = 1; i < argc ; i++) {
@@ -195,11 +199,22 @@ int main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout")))
noout++;
+ else if ((!strcmp(argv[i], "-valid")) ||
+ (!strcmp(argv[i], "--valid")))
+ valid++;
+ else if ((!strcmp(argv[i], "-repeat")) ||
+ (!strcmp(argv[i], "--repeat")))
+ repeat++;
}
if (noent != 0) xmlSubstituteEntitiesDefault(1);
+ if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
for (i = 1; i < argc ; i++) {
if (argv[i][0] != '-') {
- parseAndPrintFile(argv[i]);
+ if (repeat) {
+ for (count = 0;count < 100 * repeat;count++)
+ parseAndPrintFile(argv[i]);
+ } else
+ parseAndPrintFile(argv[i]);
files ++;
}
}
@@ -212,6 +227,7 @@ int main(int argc, char **argv) {
printf("\t--recover : output what is parsable on broken XmL documents\n");
printf("\t--noent : substitute entity references by their value\n");
printf("\t--noout : don't output the result\n");
+ printf("\t--repeat : parse the file 100 times, for timing or profiling\n");
}
return(0);
diff --git a/tree.c b/tree.c
index 86fd4ff7..7c61ea54 100644
--- a/tree.c
+++ b/tree.c
@@ -1127,6 +1127,46 @@ xmlNewComment(const CHAR *content) {
}
/**
+ * xmlNewCDataBlock:
+ * @doc: the document
+ * @content: the CData block content content
+ * @len: the length of the block
+ *
+ * Creation of a new node containing a CData block.
+ * Returns a pointer to the new node object.
+ */
+xmlNodePtr
+xmlNewCDataBlock(xmlDocPtr doc, const CHAR *content, int len) {
+ xmlNodePtr cur;
+
+ /*
+ * Allocate a new node and fill the fields.
+ */
+ cur = (xmlNodePtr) malloc(sizeof(xmlNode));
+ if (cur == NULL) {
+ fprintf(stderr, "xmlNewCDataBlock : malloc failed\n");
+ return(NULL);
+ }
+
+ cur->type = XML_CDATA_SECTION_NODE;
+ cur->doc = NULL;
+ cur->parent = NULL;
+ cur->prev = NULL;
+ cur->next = NULL;
+ cur->childs = NULL;
+ cur->last = NULL;
+ cur->properties = NULL;
+ cur->name = xmlStrdup(xmlStringText);
+ cur->ns = NULL;
+ cur->nsDef = NULL;
+ if ((content != NULL) && (len > 0)) {
+ cur->content = xmlStrndup(content, len);
+ } else
+ cur->content = NULL;
+ return(cur);
+}
+
+/**
* xmlNewDocComment:
* @doc: the document
* @content: the comment content
@@ -1725,7 +1765,6 @@ xmlNodeGetContent(xmlNodePtr cur) {
return(xmlNodeListGetString(cur->doc, cur->childs, 1));
break;
case XML_ATTRIBUTE_NODE:
- case XML_CDATA_SECTION_NODE:
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
case XML_PI_NODE:
@@ -1734,6 +1773,7 @@ xmlNodeGetContent(xmlNodePtr cur) {
case XML_DOCUMENT_TYPE_NODE:
case XML_NOTATION_NODE:
return(NULL);
+ case XML_CDATA_SECTION_NODE:
case XML_TEXT_NODE:
if (cur->content != NULL)
return(xmlStrdup(cur->content));
@@ -2637,6 +2677,13 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
xmlBufferWriteChar(buf, ";");
return;
}
+ if (cur->type == XML_CDATA_SECTION_NODE) {
+ xmlBufferWriteChar(buf, "<![CDATA[");
+ if (cur->content != NULL)
+ xmlBufferWriteCHAR(buf, cur->content);
+ xmlBufferWriteChar(buf, "]]>");
+ return;
+ }
if (xmlIndentTreeOutput)
for (i = 0;i < level;i++)
xmlBufferWriteChar(buf, " ");
@@ -2747,10 +2794,9 @@ xmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size) {
return;
}
xmlDocContentDump(buf, cur);
- *mem = buf->content;
+ *mem = xmlStrndup(buf->content, buf->use);
*size = buf->use;
- memset(buf, -1, sizeof(xmlBuffer));
- free(buf);
+ xmlBufferFree(buf);
}
/**
diff --git a/tree.h b/tree.h
index fddabb7e..a627d921 100644
--- a/tree.h
+++ b/tree.h
@@ -97,6 +97,7 @@ typedef xmlEnumeration *xmlEnumerationPtr;
typedef struct xmlAttribute {
const CHAR *elem; /* Element holding the attribute */
const CHAR *name; /* Attribute name */
+ struct xmlAttribute *next; /* list of attributes of an element */
xmlAttributeType type; /* The type */
xmlAttributeDefault def; /* the default */
const CHAR *defaultValue;/* or the default value */
@@ -138,9 +139,10 @@ typedef enum {
} xmlElementTypeVal;
typedef struct xmlElement {
- const CHAR *name; /* Element name */
- xmlElementTypeVal type; /* The type */
+ const CHAR *name; /* Element name */
+ xmlElementTypeVal type; /* The type */
xmlElementContentPtr content; /* the allowed element content */
+ xmlAttributePtr attributes; /* List of the declared attributes */
} xmlElement;
typedef xmlElement *xmlElementPtr;
@@ -188,7 +190,7 @@ typedef struct xmlAttr {
#endif
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
- struct xmlAttr *next; /* parent->childs link */
+ struct xmlAttr *next; /* attribute list link */
const CHAR *name; /* the name of the property */
struct xmlNode *val; /* the value of the property */
} xmlAttr;
@@ -310,6 +312,7 @@ xmlNodePtr xmlNewDocTextLen(xmlDocPtr doc, const CHAR *content, int len);
xmlNodePtr xmlNewTextLen(const CHAR *content, int len);
xmlNodePtr xmlNewDocComment(xmlDocPtr doc, const CHAR *content);
xmlNodePtr xmlNewComment(const CHAR *content);
+xmlNodePtr xmlNewCDataBlock(xmlDocPtr doc, const CHAR *content, int len);
xmlNodePtr xmlNewReference(xmlDocPtr doc, const CHAR *name);
xmlNodePtr xmlCopyNode(xmlNodePtr node, int recursive);
xmlNodePtr xmlCopyNodeList(xmlNodePtr node);
diff --git a/valid.c b/valid.c
index 87af873a..b23824f3 100644
--- a/valid.c
+++ b/valid.c
@@ -12,6 +12,20 @@
#include <string.h>
#include "valid.h"
#include "parser.h"
+#include "parserInternals.h"
+
+#define VERROR \
+ if ((ctxt != NULL) && (ctxt->error != NULL)) ctxt->error
+
+#define VWARNING \
+ if ((ctxt != NULL) && (ctxt->warning != NULL)) ctxt->warning
+
+#define CHECK_DTD \
+ if (doc == NULL) return(0); \
+ else if (doc->intSubset == NULL) return(0)
+
+xmlElementPtr xmlGetDtdElementDesc(xmlDtdPtr dtd, const CHAR *name);
+xmlAttributePtr xmlScanAttributeDecl(xmlDtdPtr dtd, const CHAR *elem);
/****************************************************************
* *
@@ -169,6 +183,68 @@ xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content, int glob)
}
}
+/**
+ * xmlSprintfElementContent:
+ * @buf: an output buffer
+ * @content: An element table
+ * @glob: 1 if one must print the englobing parenthesis, 0 otherwise
+ *
+ * This will dump the content of the element content definition
+ * Intended just for the debug routine
+ */
+void
+xmlSprintfElementContent(char *buf, xmlElementContentPtr content, int glob) {
+ if (content == NULL) return;
+ if (glob) strcat(buf, "(");
+ switch (content->type) {
+ case XML_ELEMENT_CONTENT_PCDATA:
+ strcat(buf, "#PCDATA");
+ break;
+ case XML_ELEMENT_CONTENT_ELEMENT:
+ strcat(buf, content->name);
+ break;
+ case XML_ELEMENT_CONTENT_SEQ:
+ if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
+ (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
+ xmlSprintfElementContent(buf, content->c1, 1);
+ else
+ xmlSprintfElementContent(buf, content->c1, 0);
+ strcat(buf, " , ");
+ if (content->c2->type == XML_ELEMENT_CONTENT_OR)
+ xmlSprintfElementContent(buf, content->c2, 1);
+ else
+ xmlSprintfElementContent(buf, content->c2, 0);
+ break;
+ case XML_ELEMENT_CONTENT_OR:
+ if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
+ (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
+ xmlSprintfElementContent(buf, content->c1, 1);
+ else
+ xmlSprintfElementContent(buf, content->c1, 0);
+ strcat(buf, " | ");
+ if (content->c2->type == XML_ELEMENT_CONTENT_SEQ)
+ xmlSprintfElementContent(buf, content->c2, 1);
+ else
+ xmlSprintfElementContent(buf, content->c2, 0);
+ break;
+ }
+ if (glob)
+ strcat(buf, ")");
+ switch (content->ocur) {
+ case XML_ELEMENT_CONTENT_ONCE:
+ break;
+ case XML_ELEMENT_CONTENT_OPT:
+ strcat(buf, "?");
+ break;
+ case XML_ELEMENT_CONTENT_MULT:
+ strcat(buf, "*");
+ break;
+ case XML_ELEMENT_CONTENT_PLUS:
+ strcat(buf, "+");
+ break;
+ }
+}
+
/****************************************************************
* *
* Registration of DTD declarations *
@@ -195,8 +271,8 @@ xmlCreateElementTable(void) {
}
ret->max_elements = XML_MIN_ELEMENT_TABLE;
ret->nb_elements = 0;
- ret->table = (xmlElementPtr )
- malloc(ret->max_elements * sizeof(xmlElement));
+ ret->table = (xmlElementPtr *)
+ malloc(ret->max_elements * sizeof(xmlElementPtr));
if (ret == NULL) {
fprintf(stderr, "xmlCreateElementTable : malloc(%ld) failed\n",
ret->max_elements * (long)sizeof(xmlElement));
@@ -219,8 +295,8 @@ xmlCreateElementTable(void) {
* Returns NULL if not, othervise the entity
*/
xmlElementPtr
-xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
- xmlElementContentPtr content) {
+xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *name,
+ int type, xmlElementContentPtr content) {
xmlElementPtr ret, cur;
xmlElementTablePtr table;
int i;
@@ -283,13 +359,12 @@ xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
* Search the DTD for previous declarations of the ELEMENT
*/
for (i = 0;i < table->nb_elements;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
if (!xmlStrcmp(cur->name, name)) {
/*
* The element is already defined in this Dtd.
*/
- fprintf(stderr,
- "xmlAddElementDecl: %s already defined\n", name);
+ VERROR(ctxt->userData, "Redefinition of element %s\n", name);
return(NULL);
}
}
@@ -302,14 +377,19 @@ xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
* need more elements.
*/
table->max_elements *= 2;
- table->table = (xmlElementPtr)
- realloc(table->table, table->max_elements * sizeof(xmlElement));
- if (table->table) {
+ table->table = (xmlElementPtr *)
+ realloc(table->table, table->max_elements * sizeof(xmlElementPtr));
+ if (table->table == NULL) {
fprintf(stderr, "xmlAddElementDecl: out of memory\n");
return(NULL);
}
}
- ret = &table->table[table->nb_elements];
+ ret = (xmlElementPtr) malloc(sizeof(xmlElement));
+ if (ret == NULL) {
+ fprintf(stderr, "xmlAddElementDecl: out of memory\n");
+ return(NULL);
+ }
+ table->table[table->nb_elements] = ret;
/*
* fill the structure.
@@ -317,6 +397,7 @@ xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
ret->type = type;
ret->name = xmlStrdup(name);
ret->content = xmlCopyElementContent(content);
+ ret->attributes = xmlScanAttributeDecl(dtd, name);
table->nb_elements++;
return(ret);
@@ -335,6 +416,7 @@ xmlFreeElement(xmlElementPtr elem) {
if (elem->name != NULL)
free((CHAR *) elem->name);
memset(elem, -1, sizeof(xmlElement));
+ free(elem);
}
/**
@@ -350,7 +432,7 @@ xmlFreeElementTable(xmlElementTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_elements;i++) {
- xmlFreeElement(&table->table[i]);
+ xmlFreeElement(table->table[i]);
}
free(table->table);
free(table);
@@ -375,8 +457,8 @@ xmlCopyElementTable(xmlElementTablePtr table) {
fprintf(stderr, "xmlCopyElementTable: out of memory !\n");
return(NULL);
}
- ret->table = (xmlElementPtr) malloc(table->max_elements *
- sizeof(xmlElement));
+ ret->table = (xmlElementPtr *) malloc(table->max_elements *
+ sizeof(xmlElementPtr));
if (ret->table == NULL) {
fprintf(stderr, "xmlCopyElementTable: out of memory !\n");
free(ret);
@@ -385,14 +467,22 @@ xmlCopyElementTable(xmlElementTablePtr table) {
ret->max_elements = table->max_elements;
ret->nb_elements = table->nb_elements;
for (i = 0;i < ret->nb_elements;i++) {
- cur = &ret->table[i];
- ent = &table->table[i];
+ cur = (xmlElementPtr) malloc(sizeof(xmlElement));
+ if (cur == NULL) {
+ fprintf(stderr, "xmlCopyElementTable: out of memory !\n");
+ free(ret);
+ free(ret->table);
+ return(NULL);
+ }
+ ret->table[i] = cur;
+ ent = table->table[i];
cur->type = ent->type;
if (ent->name != NULL)
cur->name = xmlStrdup(ent->name);
else
cur->name = NULL;
cur->content = xmlCopyElementContent(ent->content);
+ cur->attributes = NULL;
}
return(ret);
}
@@ -412,7 +502,7 @@ xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_elements;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
switch (cur->type) {
case XML_ELEMENT_TYPE_EMPTY:
xmlBufferWriteChar(buf, "<!ELEMENT ");
@@ -514,6 +604,26 @@ xmlCopyEnumeration(xmlEnumerationPtr cur) {
}
/**
+ * xmlDumpEnumeration:
+ * @buf: the XML buffer output
+ * @enum: An enumeration
+ *
+ * This will dump the content of the enumeration
+ */
+void
+xmlDumpEnumeration(xmlBufferPtr buf, xmlEnumerationPtr cur) {
+ if (cur == NULL) return;
+
+ xmlBufferWriteCHAR(buf, cur->name);
+ if (cur->next == NULL)
+ xmlBufferWriteChar(buf, ")");
+ else {
+ xmlBufferWriteChar(buf, " | ");
+ xmlDumpEnumeration(buf, cur->next);
+ }
+}
+
+/**
* xmlCreateAttributeTable:
*
* create and initialize an empty attribute hash table.
@@ -534,20 +644,89 @@ xmlCreateAttributeTable(void) {
}
ret->max_attributes = XML_MIN_ATTRIBUTE_TABLE;
ret->nb_attributes = 0;
- ret->table = (xmlAttributePtr )
- malloc(ret->max_attributes * sizeof(xmlAttribute));
+ ret->table = (xmlAttributePtr *)
+ malloc(ret->max_attributes * sizeof(xmlAttributePtr));
if (ret == NULL) {
fprintf(stderr, "xmlCreateAttributeTable : malloc(%ld) failed\n",
- ret->max_attributes * (long)sizeof(xmlAttribute));
+ ret->max_attributes * (long)sizeof(xmlAttributePtr));
free(ret);
return(NULL);
}
return(ret);
}
+/**
+ * xmlScanAttributeDecl:
+ * @dtd: pointer to the DTD
+ * @elem: the element name
+ *
+ * When inserting a new element scan the DtD for existing attributes
+ * for taht element and initialize the Attribute chain
+ *
+ * Returns the pointer to the first attribute decl in the chain,
+ * possibly NULL.
+ */
+xmlAttributePtr
+xmlScanAttributeDecl(xmlDtdPtr dtd, const CHAR *elem) {
+ xmlAttributePtr ret = NULL;
+ xmlAttributeTablePtr table;
+ int i;
+
+ if (dtd == NULL) {
+ fprintf(stderr, "xmlScanAttributeDecl: dtd == NULL\n");
+ return(NULL);
+ }
+ if (elem == NULL) {
+ fprintf(stderr, "xmlScanAttributeDecl: elem == NULL\n");
+ return(NULL);
+ }
+ table = dtd->attributes;
+ if (table == NULL)
+ return(NULL);
+
+ for (i = 0;i < table->nb_attributes;i++) {
+ if (!xmlStrcmp(table->table[i]->elem, elem)) {
+ table->table[i]->next = ret;
+ ret = table->table[i];
+ }
+ }
+ return(ret);
+}
+
+/**
+ * xmlScanIDAttributeDecl:
+ * @ctxt: the validation context
+ * @elem: the element name
+ *
+ * Veryfy that the element don't have too many ID attributes
+ * declared.
+ *
+ * Returns the number of ID attributes found.
+ */
+int
+xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
+ xmlAttributePtr cur;
+ int ret = 0;
+
+ if (elem == NULL) return(0);
+ cur = elem->attributes;
+ while (cur != NULL) {
+ if (cur->type == XML_ATTRIBUTE_ID) {
+ ret ++;
+ if (ret > 1)
+ VERROR(ctxt->userData,
+ "Element %s has too may ID attributes defined : %s\n",
+ elem->name, cur->name);
+ }
+ cur = cur->next;
+ }
+ return(ret);
+}
+
/**
* xmlAddAttributeDecl:
+ * @ctxt: the validation context
* @dtd: pointer to the DTD
* @elem: the element name
* @name: the attribute name
@@ -561,11 +740,12 @@ xmlCreateAttributeTable(void) {
* Returns NULL if not, othervise the entity
*/
xmlAttributePtr
-xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem, const CHAR *name,
- int type, int def, const CHAR *defaultValue,
- xmlEnumerationPtr tree) {
+xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *elem,
+ const CHAR *name, int type, int def,
+ const CHAR *defaultValue, xmlEnumerationPtr tree) {
xmlAttributePtr ret, cur;
xmlAttributeTablePtr table;
+ xmlElementPtr elemDef;
int i;
if (dtd == NULL) {
@@ -623,7 +803,7 @@ xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem, const CHAR *name,
* Search the DTD for previous declarations of the ATTLIST
*/
for (i = 0;i < table->nb_attributes;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
if ((!xmlStrcmp(cur->name, name)) && (!xmlStrcmp(cur->elem, elem))) {
/*
* The attribute is already defined in this Dtd.
@@ -641,14 +821,20 @@ xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem, const CHAR *name,
* need more attributes.
*/
table->max_attributes *= 2;
- table->table = (xmlAttributePtr)
- realloc(table->table, table->max_attributes * sizeof(xmlAttribute));
- if (table->table) {
+ table->table = (xmlAttributePtr *)
+ realloc(table->table, table->max_attributes *
+ sizeof(xmlAttributePtr));
+ if (table->table == NULL) {
fprintf(stderr, "xmlAddAttributeDecl: out of memory\n");
return(NULL);
}
}
- ret = &table->table[table->nb_attributes];
+ ret = (xmlAttributePtr) malloc(sizeof(xmlAttribute));
+ if (ret == NULL) {
+ fprintf(stderr, "xmlAddAttributeDecl: out of memory\n");
+ return(NULL);
+ }
+ table->table[table->nb_attributes] = ret;
/*
* fill the structure.
@@ -662,6 +848,16 @@ xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem, const CHAR *name,
ret->defaultValue = xmlStrdup(defaultValue);
else
ret->defaultValue = NULL;
+ elemDef = xmlGetDtdElementDesc(dtd, elem);
+ if (elemDef != NULL) {
+ if ((type == XML_ATTRIBUTE_ID) &&
+ (xmlScanIDAttributeDecl(NULL, elemDef) != 0))
+ VERROR(ctxt->userData,
+ "Element %s has too may ID attributes defined : %s\n",
+ elem, name);
+ ret->next = elemDef->attributes;
+ elemDef->attributes = ret;
+ }
table->nb_attributes++;
return(ret);
@@ -685,6 +881,7 @@ xmlFreeAttribute(xmlAttributePtr attr) {
if (attr->defaultValue != NULL)
free((CHAR *) attr->defaultValue);
memset(attr, -1, sizeof(xmlAttribute));
+ free(attr);
}
/**
@@ -700,7 +897,7 @@ xmlFreeAttributeTable(xmlAttributeTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_attributes;i++) {
- xmlFreeAttribute(&table->table[i]);
+ xmlFreeAttribute(table->table[i]);
}
free(table->table);
free(table);
@@ -725,8 +922,8 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
fprintf(stderr, "xmlCopyAttributeTable: out of memory !\n");
return(NULL);
}
- ret->table = (xmlAttributePtr) malloc(table->max_attributes *
- sizeof(xmlAttribute));
+ ret->table = (xmlAttributePtr *) malloc(table->max_attributes *
+ sizeof(xmlAttributePtr));
if (ret->table == NULL) {
fprintf(stderr, "xmlCopyAttributeTable: out of memory !\n");
free(ret);
@@ -735,8 +932,15 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
ret->max_attributes = table->max_attributes;
ret->nb_attributes = table->nb_attributes;
for (i = 0;i < ret->nb_attributes;i++) {
- cur = &ret->table[i];
- attr = &table->table[i];
+ attr = table->table[i];
+ cur = (xmlAttributePtr) malloc(sizeof(xmlAttribute));
+ if (cur == NULL) {
+ fprintf(stderr, "xmlCopyAttributeTable: out of memory !\n");
+ free(ret);
+ free(ret->table);
+ return(NULL);
+ }
+ ret->table[i] = cur;
cur->type = attr->type;
cur->def = attr->def;
cur->tree = xmlCopyEnumeration(attr->tree);
@@ -752,6 +956,7 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
cur->defaultValue = xmlStrdup(attr->defaultValue);
else
cur->defaultValue = NULL;
+ /* NEED to rebuild the next chain !!!!!! */
}
return(ret);
}
@@ -771,7 +976,7 @@ xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_attributes;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
xmlBufferWriteChar(buf, "<!ATTLIST ");
xmlBufferWriteCHAR(buf, cur->elem);
xmlBufferWriteChar(buf, " ");
@@ -802,10 +1007,12 @@ xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
xmlBufferWriteChar(buf, " NMTOKENS");
break;
case XML_ATTRIBUTE_ENUMERATION:
- xmlBufferWriteChar(buf, " (pbm)");
+ xmlBufferWriteChar(buf, " (");
+ xmlDumpEnumeration(buf, cur->tree);
break;
case XML_ATTRIBUTE_NOTATION:
- xmlBufferWriteChar(buf, " NOTATION (pbm)");
+ xmlBufferWriteChar(buf, " NOTATION (");
+ xmlDumpEnumeration(buf, cur->tree);
break;
default:
fprintf(stderr,
@@ -820,20 +1027,19 @@ xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
break;
case XML_ATTRIBUTE_IMPLIED:
xmlBufferWriteChar(buf, " #IMPLIED");
- if (cur->defaultValue != NULL) {
- xmlBufferWriteChar(buf, " ");
- xmlBufferWriteQuotedString(buf, cur->defaultValue);
- }
break;
case XML_ATTRIBUTE_FIXED:
- xmlBufferWriteChar(buf, " #FIXED ");
- xmlBufferWriteQuotedString(buf, cur->defaultValue);
+ xmlBufferWriteChar(buf, " #FIXED");
break;
default:
fprintf(stderr,
"xmlDumpAttributeTable: internal: unknown default %d\n",
cur->def);
}
+ if (cur->defaultValue != NULL) {
+ xmlBufferWriteChar(buf, " ");
+ xmlBufferWriteQuotedString(buf, cur->defaultValue);
+ }
xmlBufferWriteChar(buf, ">\n");
}
}
@@ -864,8 +1070,8 @@ xmlCreateNotationTable(void) {
}
ret->max_notations = XML_MIN_NOTATION_TABLE;
ret->nb_notations = 0;
- ret->table = (xmlNotationPtr )
- malloc(ret->max_notations * sizeof(xmlNotation));
+ ret->table = (xmlNotationPtr *)
+ malloc(ret->max_notations * sizeof(xmlNotationPtr));
if (ret == NULL) {
fprintf(stderr, "xmlCreateNotationTable : malloc(%ld) failed\n",
ret->max_notations * (long)sizeof(xmlNotation));
@@ -879,6 +1085,7 @@ xmlCreateNotationTable(void) {
/**
* xmlAddNotationDecl:
* @dtd: pointer to the DTD
+ * @ctxt: the validation context
* @name: the entity name
* @PublicID: the public identifier or NULL
* @SystemID: the system identifier or NULL
@@ -888,8 +1095,8 @@ xmlCreateNotationTable(void) {
* Returns NULL if not, othervise the entity
*/
xmlNotationPtr
-xmlAddNotationDecl(xmlDtdPtr dtd, const CHAR *name, const CHAR *PublicID,
- const CHAR *SystemID) {
+xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *name,
+ const CHAR *PublicID, const CHAR *SystemID) {
xmlNotationPtr ret, cur;
xmlNotationTablePtr table;
int i;
@@ -922,7 +1129,7 @@ xmlAddNotationDecl(xmlDtdPtr dtd, const CHAR *name, const CHAR *PublicID,
* Search the DTD for previous declarations of the ATTLIST
*/
for (i = 0;i < table->nb_notations;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
if (!xmlStrcmp(cur->name, name)) {
/*
* The notation is already defined in this Dtd.
@@ -940,14 +1147,20 @@ xmlAddNotationDecl(xmlDtdPtr dtd, const CHAR *name, const CHAR *PublicID,
* need more notations.
*/
table->max_notations *= 2;
- table->table = (xmlNotationPtr)
- realloc(table->table, table->max_notations * sizeof(xmlNotation));
- if (table->table) {
+ table->table = (xmlNotationPtr *)
+ realloc(table->table, table->max_notations *
+ sizeof(xmlNotationPtr));
+ if (table->table == NULL) {
fprintf(stderr, "xmlAddNotationDecl: out of memory\n");
return(NULL);
}
}
- ret = &table->table[table->nb_notations];
+ ret = (xmlNotationPtr) malloc(sizeof(xmlNotation));
+ if (ret == NULL) {
+ fprintf(stderr, "xmlAddNotationDecl: out of memory\n");
+ return(NULL);
+ }
+ table->table[table->nb_notations] = ret;
/*
* fill the structure.
@@ -982,6 +1195,7 @@ xmlFreeNotation(xmlNotationPtr nota) {
if (nota->SystemID != NULL)
free((CHAR *) nota->SystemID);
memset(nota, -1, sizeof(xmlNotation));
+ free(nota);
}
/**
@@ -997,7 +1211,7 @@ xmlFreeNotationTable(xmlNotationTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_notations;i++) {
- xmlFreeNotation(&table->table[i]);
+ xmlFreeNotation(table->table[i]);
}
free(table->table);
free(table);
@@ -1022,8 +1236,8 @@ xmlCopyNotationTable(xmlNotationTablePtr table) {
fprintf(stderr, "xmlCopyNotationTable: out of memory !\n");
return(NULL);
}
- ret->table = (xmlNotationPtr) malloc(table->max_notations *
- sizeof(xmlNotation));
+ ret->table = (xmlNotationPtr *) malloc(table->max_notations *
+ sizeof(xmlNotationPtr));
if (ret->table == NULL) {
fprintf(stderr, "xmlCopyNotationTable: out of memory !\n");
free(ret);
@@ -1032,8 +1246,15 @@ xmlCopyNotationTable(xmlNotationTablePtr table) {
ret->max_notations = table->max_notations;
ret->nb_notations = table->nb_notations;
for (i = 0;i < ret->nb_notations;i++) {
- cur = &ret->table[i];
- nota = &table->table[i];
+ cur = (xmlNotationPtr) malloc(sizeof(xmlNotation));
+ if (cur == NULL) {
+ fprintf(stderr, "xmlCopyNotationTable: out of memory !\n");
+ free(ret);
+ free(ret->table);
+ return(NULL);
+ }
+ ret->table[i] = cur;
+ nota = table->table[i];
if (nota->name != NULL)
cur->name = xmlStrdup(nota->name);
else
@@ -1065,7 +1286,7 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
if (table == NULL) return;
for (i = 0;i < table->nb_notations;i++) {
- cur = &table->table[i];
+ cur = table->table[i];
xmlBufferWriteChar(buf, "<!NOTATION ");
xmlBufferWriteCHAR(buf, cur->name);
if (cur->PublicID != NULL) {
@@ -1082,3 +1303,1070 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
xmlBufferWriteChar(buf, " >\n");
}
}
+
+/************************************************************************
+ * *
+ * Routines for validity checking *
+ * *
+ ************************************************************************/
+
+/**
+ * xmlGetDtdElementDesc:
+ * @dtd: a pointer to the DtD to search
+ * @name: the element name
+ *
+ * Search the Dtd for the description of this element
+ *
+ * returns the xmlElementPtr if found or NULL
+ */
+
+xmlElementPtr
+xmlGetDtdElementDesc(xmlDtdPtr dtd, const CHAR *name) {
+ xmlElementTablePtr table;
+ xmlElementPtr cur;
+ int i;
+
+ if (dtd == NULL) return(NULL);
+ if (dtd->elements == NULL) return(NULL);
+ table = dtd->elements;
+
+ for (i = 0;i < table->nb_elements;i++) {
+ cur = table->table[i];
+ if (!xmlStrcmp(cur->name, name))
+ return(cur);
+ }
+ return(NULL);
+}
+
+/**
+ * xmlGetDtdAttrDesc:
+ * @dtd: a pointer to the DtD to search
+ * @elem: the element name
+ * @name: the attribute name
+ *
+ * Search the Dtd for the description of this attribute on
+ * this element.
+ *
+ * returns the xmlAttributePtr if found or NULL
+ */
+
+xmlAttributePtr
+xmlGetDtdAttrDesc(xmlDtdPtr dtd, const CHAR *elem, const CHAR *name) {
+ xmlAttributeTablePtr table;
+ xmlAttributePtr cur;
+ int i;
+
+ if (dtd == NULL) return(NULL);
+ if (dtd->attributes == NULL) return(NULL);
+ table = dtd->attributes;
+
+ for (i = 0;i < table->nb_attributes;i++) {
+ cur = table->table[i];
+ if ((!xmlStrcmp(cur->name, name)) &&
+ (!xmlStrcmp(cur->elem, elem)))
+ return(cur);
+ }
+ return(NULL);
+}
+
+/**
+ * xmlGetDtdNotationDesc:
+ * @dtd: a pointer to the DtD to search
+ * @name: the notation name
+ *
+ * Search the Dtd for the description of this notation
+ *
+ * returns the xmlNotationPtr if found or NULL
+ */
+
+xmlNotationPtr
+xmlGetDtdNotationDesc(xmlDtdPtr dtd, const CHAR *name) {
+ xmlNotationTablePtr table;
+ xmlNotationPtr cur;
+ int i;
+
+ if (dtd == NULL) return(NULL);
+ if (dtd->notations == NULL) return(NULL);
+ table = dtd->notations;
+
+ for (i = 0;i < table->nb_notations;i++) {
+ cur = table->table[i];
+ if (!xmlStrcmp(cur->name, name))
+ return(cur);
+ }
+ return(NULL);
+}
+
+/**
+ * xmlIsMixedElement
+ * @doc: the document
+ * @name: the element name
+ *
+ * Search in the DtDs whether an element accept Mixed content (or ANY)
+ * basically if it is supposed to accept text childs
+ *
+ * returns 0 if no, 1 if yes, and -1 if no element description is available
+ */
+
+int
+xmlIsMixedElement(xmlDocPtr doc, const CHAR *name) {
+ xmlElementPtr elemDecl;
+
+ if ((doc == NULL) || (doc->intSubset == NULL)) return(-1);
+
+ elemDecl = xmlGetDtdElementDesc(doc->intSubset, name);
+ if ((elemDecl == NULL) && (doc->extSubset != NULL))
+ elemDecl = xmlGetDtdElementDesc(doc->extSubset, name);
+ if (elemDecl == NULL) return(-1);
+ switch (elemDecl->type) {
+ case XML_ELEMENT_TYPE_ELEMENT:
+ return(0);
+ case XML_ELEMENT_TYPE_EMPTY:
+ /*
+ * return 1 for EMPTY since we want VC error to pop up
+ * on <empty> </empty> for example
+ */
+ case XML_ELEMENT_TYPE_ANY:
+ case XML_ELEMENT_TYPE_MIXED:
+ return(1);
+ }
+ return(1);
+}
+
+/**
+ * xmlValidateNameValue:
+ * @value: an Name value
+ *
+ * Validate that the given value match Name production
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNameValue(const CHAR *value) {
+ const CHAR *cur;
+
+ if (value == NULL) return(0);
+ cur = value;
+
+ if (!IS_LETTER(*cur) && (*cur != '_') &&
+ (*cur != ':')) {
+ return(0);
+ }
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+
+ if (*cur != 0) return(0);
+
+ return(1);
+}
+
+/**
+ * xmlValidateNamesValue:
+ * @value: an Names value
+ *
+ * Validate that the given value match Names production
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNamesValue(const CHAR *value) {
+ const CHAR *cur;
+
+ if (value == NULL) return(0);
+ cur = value;
+
+ if (!IS_LETTER(*cur) && (*cur != '_') &&
+ (*cur != ':')) {
+ return(0);
+ }
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+
+ while (IS_BLANK(*cur)) {
+ while (IS_BLANK(*cur)) cur++;
+
+ if (!IS_LETTER(*cur) && (*cur != '_') &&
+ (*cur != ':')) {
+ return(0);
+ }
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+ }
+
+ if (*cur != 0) return(0);
+
+ return(1);
+}
+
+/**
+ * xmlValidateNmtokenValue:
+ * @value: an Mntoken value
+ *
+ * Validate that the given value match Nmtoken production
+ *
+ * [ VC: Name Token ]
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNmtokenValue(const CHAR *value) {
+ const CHAR *cur;
+
+ if (value == NULL) return(0);
+ cur = value;
+
+ if (!IS_LETTER(*cur) && !IS_DIGIT(*cur) &&
+ (*cur != '.') && (*cur != '-') &&
+ (*cur != '_') && (*cur != ':') &&
+ (!IS_COMBINING(*cur)) &&
+ (!IS_EXTENDER(*cur)))
+ return(0);
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+
+ if (*cur != 0) return(0);
+
+ return(1);
+ return(1);
+}
+
+/**
+ * xmlValidateNmtokensValue:
+ * @value: an Mntokens value
+ *
+ * Validate that the given value match Nmtokens production
+ *
+ * [ VC: Name Token ]
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNmtokensValue(const CHAR *value) {
+ const CHAR *cur;
+
+ if (value == NULL) return(0);
+ cur = value;
+
+ if (!IS_LETTER(*cur) && !IS_DIGIT(*cur) &&
+ (*cur != '.') && (*cur != '-') &&
+ (*cur != '_') && (*cur != ':') &&
+ (!IS_COMBINING(*cur)) &&
+ (!IS_EXTENDER(*cur)))
+ return(0);
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+
+ while (IS_BLANK(*cur)) {
+ while (IS_BLANK(*cur)) cur++;
+
+ if (!IS_LETTER(*cur) && !IS_DIGIT(*cur) &&
+ (*cur != '.') && (*cur != '-') &&
+ (*cur != '_') && (*cur != ':') &&
+ (!IS_COMBINING(*cur)) &&
+ (!IS_EXTENDER(*cur)))
+ return(0);
+
+ while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
+ (*cur == '.') || (*cur == '-') ||
+ (*cur == '_') || (*cur == ':') ||
+ (IS_COMBINING(*cur)) ||
+ (IS_EXTENDER(*cur)))
+ cur++;
+ }
+
+ if (*cur != 0) return(0);
+
+ return(1);
+}
+
+/**
+ * xmlValidateNotationDecl:
+ * @doc: a document instance
+ * @nota: a notation definition
+ *
+ * Try to validate a single notation definition
+ * basically it does the following checks as described by the
+ * XML-1.0 recommendation:
+ * - it seems that no validity constraing exist on notation declarations
+ * But this function get called anyway ...
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNotationPtr nota) {
+ int ret = 1;
+
+ return(ret);
+}
+
+/**
+ * xmlValidateAttributeValue:
+ * @type: an attribute type
+ * @value: an attribute value
+ *
+ * Validate that the given attribute value match the proper production
+ *
+ * [ VC: ID ]
+ * Values of type ID must match the Name production....
+ *
+ * [ VC: IDREF ]
+ * Values of type IDREF must match the Name production, and values
+ * of type IDREFS must match Names ...
+ *
+ * [ VC: Entity Name ]
+ * Values of type ENTITY must match the Name production, values
+ * of type ENTITIES must match Names ...
+ *
+ * [ VC: Name Token ]
+ * Values of type NMTOKEN must match the Nmtoken production; values
+ * of type NMTOKENS must match Nmtokens.
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateAttributeValue(xmlAttributeType type, const CHAR *value) {
+ switch (type) {
+ case XML_ATTRIBUTE_IDREFS:
+ case XML_ATTRIBUTE_ENTITIES:
+ return(xmlValidateNamesValue(value));
+ case XML_ATTRIBUTE_IDREF:
+ case XML_ATTRIBUTE_ID:
+ case XML_ATTRIBUTE_ENTITY:
+ case XML_ATTRIBUTE_NOTATION:
+ return(xmlValidateNameValue(value));
+ case XML_ATTRIBUTE_NMTOKENS:
+ case XML_ATTRIBUTE_ENUMERATION:
+ return(xmlValidateNmtokensValue(value));
+ case XML_ATTRIBUTE_NMTOKEN:
+ return(xmlValidateNmtokenValue(value));
+ case XML_ATTRIBUTE_CDATA:
+ break;
+ }
+ return(1);
+}
+
+/**
+ * xmlValidateAttributeDecl:
+ * @doc: a document instance
+ * @attr: an attribute definition
+ *
+ * Try to validate a single attribute definition
+ * basically it does the following checks as described by the
+ * XML-1.0 recommendation:
+ * - [ VC: Attribute Default Legal ]
+ * - [ VC: Enumeration ]
+ * - [ VC: ID Attribute Default ]
+ *
+ * The ID/IDREF uniqueness and matching are done separately
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlAttributePtr attr) {
+ int ret = 1;
+ int val;
+ CHECK_DTD;
+ if(attr == NULL) return(1);
+
+ /* Attribute Default Legal */
+ /* Enumeration */
+ if (attr->defaultValue != NULL) {
+ val = xmlValidateAttributeValue(attr->type, attr->defaultValue);
+ if (val == 0) {
+ VERROR(ctxt->userData,
+ "Syntax of default value for attribute %s on %s is not valid\n",
+ attr->name, attr->elem);
+ }
+ ret &= val;
+ }
+
+ /* ID Attribute Default */
+ if ((attr->type == XML_ATTRIBUTE_ID)&&
+ (attr->def != XML_ATTRIBUTE_IMPLIED) &&
+ (attr->def != XML_ATTRIBUTE_REQUIRED)) {
+ VERROR(ctxt->userData,
+ "ID attribute %s on %s is not valid must be #IMPLIED or #REQUIRED\n",
+ attr->name, attr->elem);
+ ret = 0;
+ }
+
+ /* max ID per element */
+ if ((attr->type == XML_ATTRIBUTE_ID) && (doc->extSubset != NULL)) {
+ int nbId = 0;
+
+ /* the trick is taht we parse DtD as their own internal subset */
+ xmlElementPtr elem = xmlGetDtdElementDesc(doc->extSubset,
+ attr->elem);
+ if (elem != NULL) {
+ nbId = xmlScanIDAttributeDecl(NULL, elem);
+ }
+ if (nbId >= 1)
+ VERROR(ctxt->userData,
+ "Element %s has ID attribute defined in the external subset : %s\n",
+ attr->elem, attr->name);
+ }
+
+ return(ret);
+}
+
+/**
+ * xmlValidateElementDecl:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ * @elem: an element definition
+ *
+ * Try to validate a single element definition
+ * basically it does the following checks as described by the
+ * XML-1.0 recommendation:
+ * - [ VC: One ID per Element Type ]
+ * - [ VC: No Duplicate Types ]
+ * - [ VC: Unique Element Type Declaration ]
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlElementPtr elem) {
+ int ret = 1;
+ xmlElementPtr tst;
+
+ CHECK_DTD;
+
+ if (elem == NULL) return(1);
+
+ /* No Duplicate Types */
+ if (elem->type == XML_ELEMENT_TYPE_MIXED) {
+ xmlElementContentPtr cur, next;
+ const CHAR *name;
+
+ cur = elem->content;
+ while (cur != NULL) {
+ if (cur->type != XML_ELEMENT_CONTENT_OR) break;
+ if (cur->c1 == NULL) break;
+ if (cur->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
+ name = cur->c1->name;
+ next = cur->c2;
+ while (next != NULL) {
+ if (next->type == XML_ELEMENT_CONTENT_ELEMENT) {
+ if (!xmlStrcmp(next->name, name)) {
+ VERROR(ctxt->userData,
+ "Definition of %s has duplicate references of %s\n",
+ elem->name, name);
+ ret = 0;
+ }
+ break;
+ }
+ if (next->c1 == NULL) break;
+ if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break;
+ if (!xmlStrcmp(next->c1->name, name)) {
+ VERROR(ctxt->userData,
+ "Definition of %s has duplicate references of %s\n",
+ elem->name, name);
+ ret = 0;
+ }
+ next = next->c2;
+ }
+ }
+ cur = cur->c2;
+ }
+ }
+
+ /* VC: Unique Element Type Declaration */
+ tst = xmlGetDtdElementDesc(doc->intSubset, elem->name);
+ if ((tst != NULL ) && (tst != elem)) {
+ VERROR(ctxt->userData, "Redefinition of element %s\n",
+ elem->name);
+ ret = 0;
+ }
+ tst = xmlGetDtdElementDesc(doc->extSubset, elem->name);
+ if ((tst != NULL ) && (tst != elem)) {
+ VERROR(ctxt->userData, "Redefinition of element %s\n",
+ elem->name);
+ ret = 0;
+ }
+
+ /* One ID per Element Type */
+ if (xmlScanIDAttributeDecl(ctxt, elem) > 1) {
+ ret = 0;
+ }
+ return(ret);
+}
+
+/**
+ * xmlValidateOneAttribute:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ * @elem: an element instance
+ * @attr: an attribute instance
+ *
+ * Try to validate a single attribute for an element
+ * basically it * does the following checks as described by the
+ * XML-1.0 recommendation:
+ * - [ VC: Attribute Value Type ]
+ * - [ VC: Fixed Attribute Default ]
+ * - [ VC: Entity Name ]
+ * - [ VC: Name Token ]
+ * - [ VC: ID ]
+ * - [ VC: IDREF ]
+ * - [ VC: Entity Name ]
+ * - [ VC: Notation Attributes ]
+ *
+ * The ID/IDREF uniqueness and matching are done separately
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value) {
+ xmlElementPtr elemDecl;
+ xmlAttributePtr attrDecl;
+ int val;
+ int ret = 1;
+
+ CHECK_DTD;
+ if ((elem == NULL) || (elem->name == NULL)) return(0);
+ if ((attr == NULL) || (attr->name == NULL)) return(0);
+
+ attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, attr->name);
+ if ((attrDecl == NULL) && (doc->extSubset != NULL))
+ attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name, attr->name);
+
+
+ /* Validity Constraint: Attribute Value Type */
+ if (attrDecl == NULL) {
+ VERROR(ctxt->userData,
+ "No declaration for attribute %s on element %s\n",
+ attr->name, elem->name);
+ return(0);
+ }
+ val = xmlValidateAttributeValue(attrDecl->type, value);
+ if (val == 0) {
+ VERROR(ctxt->userData,
+ "Syntax of value for attribute %s on %s is not valid\n",
+ attr->name, elem->name);
+ ret = 0;
+ }
+
+ /* Validity Constraint: Notation Attributes */
+ if (attrDecl->type == XML_ATTRIBUTE_NOTATION) {
+ xmlEnumerationPtr tree = attrDecl->tree;
+ xmlNotationPtr nota;
+
+ /* First check that the given NOTATION was declared */
+ nota = xmlGetDtdNotationDesc(doc->intSubset, value);
+ if (nota == NULL)
+ nota = xmlGetDtdNotationDesc(doc->extSubset, value);
+
+ if (nota == NULL) {
+ VERROR(ctxt->userData,
+ "Value \"%s\" for attribute %s on %s is not a declared Notation\n",
+ value, attr->name, elem->name);
+ ret = 0;
+ }
+
+ /* Second, verify that it's among the list */
+ while (tree != NULL) {
+ if (!xmlStrcmp(tree->name, value)) break;
+ tree = tree->next;
+ }
+ if (tree == NULL) {
+ VERROR(ctxt->userData,
+ "Value \"%s\" for attribute %s on %s is among the enumerated notations\n",
+ value, attr->name, elem->name);
+ ret = 0;
+ }
+ }
+
+ /* Validity Constraint: Enumeration */
+ if (attrDecl->type == XML_ATTRIBUTE_ENUMERATION) {
+ xmlEnumerationPtr tree = attrDecl->tree;
+ while (tree != NULL) {
+ if (!xmlStrcmp(tree->name, value)) break;
+ tree = tree->next;
+ }
+ if (tree == NULL) {
+ VERROR(ctxt->userData,
+ "Value \"%s\" for attribute %s on %s is among the enumerated set\n",
+ value, attr->name, elem->name);
+ ret = 0;
+ }
+ }
+
+ /* Fixed Attribute Default */
+ if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
+ (xmlStrcmp(attrDecl->defaultValue, value))) {
+ VERROR(ctxt->userData,
+ "Value for attribute %s on %s must be \"%s\"\n",
+ attr->name, elem->name, attrDecl->defaultValue);
+ ret = 0;
+ }
+
+ elemDecl = xmlGetDtdElementDesc(doc->intSubset, elem->name);
+ if ((elemDecl == NULL) && (doc->extSubset != NULL))
+ elemDecl = xmlGetDtdElementDesc(doc->extSubset, elem->name);
+ if (elemDecl == NULL) {
+ /* the error has or will be reported soon in xmlValidateOneElement */
+ return(0);
+ }
+ return(ret);
+}
+
+int xmlValidateElementTypeElement(xmlValidCtxtPtr ctxt, xmlNodePtr *child,
+ xmlElementContentPtr cont);
+
+/**
+ * xmlValidateElementTypeExpr:
+ * @ctxt: the validation context
+ * @child: pointer to the child list
+ * @cont: pointer to the content declaration
+ *
+ * Try to validate the content of an element of type element
+ * but don't handle the occurence factor
+ *
+ * returns 1 if valid or 0 and -1 if PCDATA stuff is found,
+ * also update child value in-situ.
+ */
+
+int
+xmlValidateElementTypeExpr(xmlValidCtxtPtr ctxt, xmlNodePtr *child,
+ xmlElementContentPtr cont) {
+ xmlNodePtr cur;
+ int ret = 1;
+
+ if (cont == NULL) return(-1);
+ while (*child != NULL) {
+ if ((*child)->type == XML_PI_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ if ((*child)->type == XML_COMMENT_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ else if ((*child)->type != XML_ELEMENT_NODE) {
+ return(-1);
+ }
+ break;
+ }
+ switch (cont->type) {
+ case XML_ELEMENT_CONTENT_PCDATA:
+ /* Internal error !!! */
+ fprintf(stderr, "Internal: MIXED struct bad\n");
+ return(-1);
+ case XML_ELEMENT_CONTENT_ELEMENT:
+ if (*child == NULL) return(0);
+ ret = (!xmlStrcmp((*child)->name, cont->name));
+ if (ret == 1)
+ *child = (*child)->next;
+ return(ret);
+ case XML_ELEMENT_CONTENT_OR:
+ cur = *child;
+ ret = xmlValidateElementTypeElement(ctxt, child, cont->c1);
+ if (ret == -1) return(-1);
+ if (ret == 1) {
+ return(1);
+ }
+ /* rollback and retry the other path */
+ *child = cur;
+ ret = xmlValidateElementTypeElement(ctxt, child, cont->c2);
+ if (ret == -1) return(-1);
+ if (ret == 0) {
+ *child = cur;
+ return(0);
+ }
+ return(1);
+ case XML_ELEMENT_CONTENT_SEQ:
+ cur = *child;
+ ret = xmlValidateElementTypeElement(ctxt, child, cont->c1);
+ if (ret == -1) return(-1);
+ if (ret == 0) {
+ *child = cur;
+ return(0);
+ }
+ ret = xmlValidateElementTypeElement(ctxt, child, cont->c2);
+ if (ret == -1) return(-1);
+ if (ret == 0) {
+ *child = cur;
+ return(0);
+ }
+ return(1);
+ }
+ return(ret);
+}
+
+/**
+ * xmlValidateElementTypeElement:
+ * @ctxt: the validation context
+ * @child: pointer to the child list
+ * @cont: pointer to the content declaration
+ *
+ * Try to validate the content of an element of type element
+ * yeah, Yet Another Regexp Implementation, and recursive
+ *
+ * returns 1 if valid or 0 and -1 if PCDATA stuff is found,
+ * also update child and content values in-situ.
+ */
+
+int
+xmlValidateElementTypeElement(xmlValidCtxtPtr ctxt, xmlNodePtr *child,
+ xmlElementContentPtr cont) {
+ xmlNodePtr cur;
+ int ret = 1;
+
+ if (cont == NULL) return(-1);
+ while (*child != NULL) {
+ if ((*child)->type == XML_PI_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ if ((*child)->type == XML_COMMENT_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ else if ((*child)->type != XML_ELEMENT_NODE) {
+ return(-1);
+ }
+ break;
+ }
+ cur = *child;
+ ret = xmlValidateElementTypeExpr(ctxt, child, cont);
+ if (ret == -1) return(-1);
+ switch (cont->ocur) {
+ case XML_ELEMENT_CONTENT_ONCE:
+ if (ret == 1) {
+ return(1);
+ }
+ *child = cur;
+ return(0);
+ case XML_ELEMENT_CONTENT_OPT:
+ if (ret == 0) {
+ *child = cur;
+ return(1);
+ }
+ break;
+ case XML_ELEMENT_CONTENT_MULT:
+ if (ret == 0) {
+ *child = cur;
+ break;
+ }
+ /* no break on purpose */
+ case XML_ELEMENT_CONTENT_PLUS:
+ if (ret == 0) {
+ *child = cur;
+ return(0);
+ }
+ do {
+ cur = *child;
+ ret = xmlValidateElementTypeExpr(ctxt, child, cont);
+ } while (ret == 1);
+ if (ret == -1) return(-1);
+ *child = cur;
+ break;
+ }
+ while (*child != NULL) {
+ if ((*child)->type == XML_PI_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ if ((*child)->type == XML_COMMENT_NODE) {
+ *child = (*child)->next;
+ continue;
+ }
+ else if ((*child)->type != XML_ELEMENT_NODE) {
+ return(-1);
+ }
+ break;
+ }
+ return(1);
+}
+
+/**
+ * xmlSprintfElementChilds:
+ * @buf: an output buffer
+ * @content: An element
+ * @glob: 1 if one must print the englobing parenthesis, 0 otherwise
+ *
+ * This will dump the list of childs to the buffer
+ * Intended just for the debug routine
+ */
+void
+xmlSprintfElementChilds(char *buf, xmlNodePtr node, int glob) {
+ xmlNodePtr cur;
+
+ if (node == NULL) return;
+ if (glob) strcat(buf, "(");
+ cur = node->childs;
+ while (cur != NULL) {
+ switch (cur->type) {
+ case XML_ELEMENT_NODE:
+ strcat(buf, cur->name);
+ if (cur->next != NULL)
+ strcat(buf, " ");
+ break;
+ case XML_TEXT_NODE:
+ case XML_CDATA_SECTION_NODE:
+ case XML_ENTITY_REF_NODE:
+ strcat(buf, "CDATA");
+ if (cur->next != NULL)
+ strcat(buf, " ");
+ break;
+ case XML_ATTRIBUTE_NODE:
+ case XML_DOCUMENT_NODE:
+ case XML_DOCUMENT_TYPE_NODE:
+ case XML_DOCUMENT_FRAG_NODE:
+ case XML_NOTATION_NODE:
+ strcat(buf, "???");
+ if (cur->next != NULL)
+ strcat(buf, " ");
+ break;
+ case XML_ENTITY_NODE:
+ case XML_PI_NODE:
+ case XML_COMMENT_NODE:
+ break;
+ }
+ cur = cur->next;
+ }
+ if (glob) strcat(buf, ")");
+}
+
+
+/**
+ * xmlValidateOneElement:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ * @elem: an element instance
+ *
+ * Try to validate a single element and it's attributes,
+ * basically it does the following checks as described by the
+ * XML-1.0 recommendation:
+ * - [ VC: Element Valid ]
+ * - [ VC: Required Attribute ]
+ * Then call xmlValidateOneAttribute() for each attribute present.
+ *
+ * The ID/IDREF checkings are done separately
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem) {
+ xmlElementPtr elemDecl;
+ xmlElementContentPtr cont;
+ xmlNodePtr child;
+ int ret = 1;
+ const CHAR *name;
+
+ CHECK_DTD;
+
+ if ((elem == NULL) || (elem->name == NULL)) return(0);
+
+ elemDecl = xmlGetDtdElementDesc(doc->intSubset, elem->name);
+ if ((elemDecl == NULL) && (doc->extSubset != NULL))
+ elemDecl = xmlGetDtdElementDesc(doc->extSubset, elem->name);
+ if (elemDecl == NULL) {
+ VERROR(ctxt->userData, "No declaration for element %s\n",
+ elem->name);
+ return(0);
+ }
+
+ /* Check taht the element content matches the definition */
+ switch (elemDecl->type) {
+ case XML_ELEMENT_TYPE_EMPTY:
+ if (elem->childs != NULL) {
+ VERROR(ctxt->userData,
+ "Element %s was declared EMPTY this one has content\n",
+ elem->name);
+ ret = 0;
+ }
+ break;
+ case XML_ELEMENT_TYPE_ANY:
+ /* I don't think anything is required then */
+ break;
+ case XML_ELEMENT_TYPE_MIXED:
+ /* Hum, this start to get messy */
+ child = elem->childs;
+ while (child != NULL) {
+ if (child->type == XML_ELEMENT_NODE) {
+ name = child->name;
+ cont = elemDecl->content;
+ while (cont != NULL) {
+ if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
+ if (!xmlStrcmp(cont->name, name)) break;
+ } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
+ (cont->c1 != NULL) &&
+ (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) {
+ if (!xmlStrcmp(cont->c1->name, name)) break;
+ } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
+ (cont->c1 == NULL) ||
+ (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) {
+ /* Internal error !!! */
+ fprintf(stderr, "Internal: MIXED struct bad\n");
+ break;
+ }
+ cont = cont->c2;
+ }
+ if (cont == NULL) {
+ VERROR(ctxt->userData,
+ "Element %s is not declared in %s list of possible childs\n",
+ name, elem->name);
+ ret = 0;
+ }
+ }
+ child = child->next;
+ }
+ break;
+ case XML_ELEMENT_TYPE_ELEMENT:
+ child = elem->childs;
+ cont = elemDecl->content;
+ ret = xmlValidateElementTypeElement(ctxt, &child, cont);
+ if ((ret == 0) || (child != NULL)) {
+ char expr[1000];
+ char list[2000];
+
+ expr[0] = 0;
+ xmlSprintfElementContent(expr, cont, 1);
+ list[0] = 0;
+ xmlSprintfElementChilds(list, elem, 1);
+
+ VERROR(ctxt->userData,
+ "Element %s content doesn't follow the Dtd\nExpecting %s, got %s\n",
+ elem->name, expr, list);
+ ret = 0;
+ }
+ break;
+ }
+
+ return(ret);
+}
+
+/**
+ * xmlValidateRoot:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ *
+ * Try to validate a the root element
+ * basically it does the following check as described by the
+ * XML-1.0 recommendation:
+ * - [ VC: Root Element Type ]
+ * it doesn't try to recurse or apply other check to the element
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
+ if (doc == NULL) return(0);
+
+ if ((doc->intSubset == NULL) ||
+ (doc->intSubset->name == NULL)) {
+ VERROR(ctxt->userData, "Not valid: no DtD found\n");
+ return(0);
+ }
+ if ((doc->root == NULL) || (doc->root->name == NULL)) {
+ VERROR(ctxt->userData, "Not valid: no root element\n");
+ return(0);
+ }
+ if (xmlStrcmp(doc->intSubset->name, doc->root->name)) {
+ VERROR(ctxt->userData,
+ "Not valid: root and DtD name do not match %s and %s\n",
+ doc->root->name, doc->intSubset->name);
+ return(0);
+ }
+ return(1);
+}
+
+
+/**
+ * xmlValidateElement:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ * @elem: an element instance
+ *
+ * Try to validate the subtree under an element
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem) {
+ CHECK_DTD;
+
+ return(1);
+}
+
+/**
+ * xmlValidateDtd:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ * @dtd: a dtd instance
+ *
+ * Try to validate the dtd instance
+ *
+ * basically it does check all the definitions in the DtD.
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) {
+ return(1);
+}
+
+/**
+ * xmlValidateDocument:
+ * @ctxt: the validation context
+ * @doc: a document instance
+ *
+ * Try to validate the document instance
+ *
+ * basically it does the all the checks described by the
+ * i.e. validates the internal and external subset (if present)
+ * and validate the document tree.
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
+ if (!xmlValidateRoot(ctxt, doc)) return(0);
+
+ return(1);
+}
+
diff --git a/valid.h b/valid.h
index 084d97fa..7d58459e 100644
--- a/valid.h
+++ b/valid.h
@@ -11,6 +11,22 @@
#define __XML_VALID_H__
#include "tree.h"
+/**
+ * an xmlValidCtxt is used for error reporting when validating
+ */
+
+typedef void (*xmlValidityErrorFunc) (void *ctx, const char *msg, ...);
+typedef void (*xmlValidityWarningFunc) (void *ctx, const char *msg, ...);
+
+typedef struct xmlValidCtxt {
+ void *userData; /* user specific data block */
+ xmlValidityErrorFunc error; /* the callback in case of errors */
+ xmlValidityWarningFunc warning; /* the callback in case of warning */
+} xmlValidCtxt, *xmlValidCtxtPtr;
+
+extern void xmlParserValidityError(void *ctx, const char *msg, ...);
+extern void xmlParserValidityWarning(void *ctx, const char *msg, ...);
+
/*
* ALl notation declarations are stored in a table
* there is one table per DTD
@@ -21,7 +37,7 @@
typedef struct xmlNotationTable {
int nb_notations; /* number of notations stored */
int max_notations; /* maximum number of notations */
- xmlNotationPtr table; /* the table of attributes */
+ xmlNotationPtr *table; /* the table of attributes */
} xmlNotationTable;
typedef xmlNotationTable *xmlNotationTablePtr;
@@ -35,7 +51,7 @@ typedef xmlNotationTable *xmlNotationTablePtr;
typedef struct xmlElementTable {
int nb_elements; /* number of elements stored */
int max_elements; /* maximum number of elements */
- xmlElementPtr table; /* the table of elements */
+ xmlElementPtr *table; /* the table of elements */
} xmlElementTable;
typedef xmlElementTable *xmlElementTablePtr;
@@ -49,13 +65,13 @@ typedef xmlElementTable *xmlElementTablePtr;
typedef struct xmlAttributeTable {
int nb_attributes; /* number of attributes stored */
int max_attributes; /* maximum number of attributes */
- xmlAttributePtr table; /* the table of attributes */
+ xmlAttributePtr *table; /* the table of attributes */
} xmlAttributeTable;
typedef xmlAttributeTable *xmlAttributeTablePtr;
/* Notation */
-xmlNotationPtr xmlAddNotationDecl(xmlDtdPtr dtd, const CHAR *name,
- const CHAR *PublicID, const CHAR *SystemID);
+xmlNotationPtr xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *name, const CHAR *PublicID, const CHAR *SystemID);
xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table);
void xmlFreeNotationTable(xmlNotationTablePtr table);
void xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table);
@@ -66,8 +82,8 @@ xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
void xmlFreeElementContent(xmlElementContentPtr cur);
/* Element */
-xmlElementPtr xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
- xmlElementContentPtr content);
+xmlElementPtr xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *name, int type, xmlElementContentPtr content);
xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table);
void xmlFreeElementTable(xmlElementTablePtr table);
void xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table);
@@ -78,11 +94,32 @@ void xmlFreeEnumeration(xmlEnumerationPtr cur);
xmlEnumerationPtr xmlCopyEnumeration(xmlEnumerationPtr cur);
/* Attribute */
-xmlAttributePtr xmlAddAttributeDecl(xmlDtdPtr dtd, const CHAR *elem,
- const CHAR *name, int type, int def,
+xmlAttributePtr xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd,
+ const CHAR *elem, const CHAR *name, int type, int def,
const CHAR *defaultValue, xmlEnumerationPtr tree);
xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table);
void xmlFreeAttributeTable(xmlAttributeTablePtr table);
void xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table);
+/**
+ * The public function calls related to validity checking
+ */
+
+int xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
+int xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlElementPtr elem);
+int xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlAttributePtr attr);
+int xmlValidateNotationDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNotationPtr nota);
+int xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd);
+
+int xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc);
+int xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem);
+int xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem);
+int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
+ xmlNodePtr elem, xmlAttrPtr attr, const CHAR *value);
+
+int xmlIsMixedElement(xmlDocPtr doc, const CHAR *name);
#endif /* __XML_VALID_H__ */
diff --git a/xmlIO.c b/xmlIO.c
index 7df18eb3..d25a07b0 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -6,6 +6,10 @@
* Daniel.Veillard@w3.org
*/
+/*
+ * TODO: plug-in a generic transfer library, like libwww if available
+ */
+
#include "config.h"
#include <sys/types.h>
@@ -18,6 +22,7 @@
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
+#include <string.h>
#include "xmlIO.h"
@@ -319,3 +324,43 @@ xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len) {
return(xmlParserInputBufferGrow(in, len));
}
+/*
+ * xmlParserGetDirectory:
+ * @filename: the path to a file
+ *
+ * lookup the directory for that file
+ *
+ * Returns a new allocated string containing the directory, or NULL.
+ */
+char *
+xmlParserGetDirectory(const char *filename) {
+ char *ret = NULL;
+ char dir[1024];
+ char *cur;
+ char sep = '/';
+
+ if (filename == NULL) return(NULL);
+#ifdef WIN32
+ sep = '\\';
+#endif
+
+ strncpy(dir, filename, 1023);
+ dir[1023] = 0;
+ cur = &dir[strlen(dir)];
+ while (cur > dir) {
+ if (*cur == sep) break;
+ cur --;
+ }
+ if (*cur == sep) {
+ if (cur == dir) dir[1] = 0;
+ else *cur = 0;
+ ret = strdup(dir);
+ } else {
+ if (getcwd(dir, 1024) != NULL) {
+ dir[1023] = 0;
+ ret = strdup(dir);
+ }
+ }
+ return(ret);
+}
+
diff --git a/xmlIO.h b/xmlIO.h
index bdeecc3f..0e086d77 100644
--- a/xmlIO.h
+++ b/xmlIO.h
@@ -45,6 +45,7 @@ int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
+char *xmlParserGetDirectory(const char *filename);
#ifdef __cplusplus
}
diff --git a/xpath.c b/xpath.c
index 33c13f04..172dd5c4 100644
--- a/xpath.c
+++ b/xpath.c
@@ -13,24 +13,96 @@
* Author: Daniel.Veillard@w3.org
*/
+#include <config.h>
#include <malloc.h>
+#ifdef HAVE_MATH_H
#include <math.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <float.h>
+#endif
+#ifdef HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+#ifdef HAVE_NAN_H
+#include <nan.h>
+#endif
#include <stdio.h>
#include "tree.h"
#include "xpath.h"
#include "parserInternals.h"
/*
- * TODO: create a pseudo document element and affect it as the
- * actual root.
- */
-/*
* Setup stuff for floating point
*/
double xmlXPathNAN = 0;
double xmlXPathPINF = 1;
double xmlXPathMINF = -1;
+#ifndef isinf
+#ifndef HAVE_ISINF
+
+#if HAVE_FPCLASS
+
+int isinf(double d) {
+ fpclass_t type = fpclass(d);
+ switch (type) {
+ case FP_NINF:
+ return(-1);
+ case FP_PINF:
+ return(1);
+ default:
+ return(0);
+ }
+ return(0);
+}
+
+#elif defined(HAVE_FP_CLASS) || defined(HAVE_FP_CLASS_D)
+
+#if HAVE_FP_CLASS_H
+#include <fp_class.h>
+#endif
+
+int isinf(double d) {
+#if HAVE_FP_CLASS
+ int fpclass = fp_class(d);
+#else
+ int fpclass = fp_class_d(d);
+#endif
+ if (fpclass == FP_POS_INF)
+ return(1);
+ if (fpclass == FP_NEG_INF)
+ return(-1);
+ return(0);
+}
+
+#elif defined(HAVE_CLASS)
+
+int isinf(double d) {
+ int fpclass = class(d);
+ if (fpclass == FP_PLUS_INF)
+ return(1);
+ if (fpclass == FP_MINUS_INF)
+ return(-1);
+ return(0);
+}
+#elif defined(finite) || defined(HAVE_FINITE)
+int isinf(double x) { return !finite(x) && x==x; }
+#endif /* ! HAVE_FPCLASS */
+
+#endif /* ! HAVE_ISINF */
+#endif /* ! defined(isinf) */
+
+#ifndef isnan
+#ifndef HAVE_ISNAN
+
+#ifdef HAVE_ISNAND
+#define isnan(f) isnand(f)
+#endif /* HAVE_iSNAND */
+
+#endif /* ! HAVE_iSNAN */
+#endif /* ! defined(isnan) */
+
/**
* xmlXPathInit:
*
@@ -87,7 +159,7 @@ extern int name##Push(xmlXPathParserContextPtr ctxt, type value) { \
ctxt->name##Tab = (void *) realloc(ctxt->name##Tab, \
ctxt->name##Max * sizeof(ctxt->name##Tab[0])); \
if (ctxt->name##Tab == NULL) { \
- fprintf(xmlXPathDebug, "realloc failed !\n"); \
+ fprintf(xmlXPathDebug, "realloc failed !\n"); \
exit(1); \
} \
} \
@@ -458,7 +530,9 @@ xmlXPathDebugNodeSet(FILE *output, xmlNodeSetPtr obj) {
fprintf(output, " NULL !\n");
return;
}
- if (obj->nodeTab[i]->name == NULL)
+ if (obj->nodeTab[i]->type == XML_DOCUMENT_NODE)
+ fprintf(output, " /");
+ else if (obj->nodeTab[i]->name == NULL)
fprintf(output, " noname!");
else fprintf(output, " %s", obj->nodeTab[i]->name);
}
@@ -866,8 +940,6 @@ xmlXPathEqualValues(xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
* xmlXPathCompareValues:
* @inf: less than (1) or greater than (2)
* @strict: is the comparison strict
- * @arg1: first XPath object argument
- * @arg2: second XPath object argument
*
* Implement the compare operation on XPath objects:
* @arg1 < @arg2 (1, 1, ...
@@ -875,11 +947,9 @@ xmlXPathEqualValues(xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
* @arg1 > @arg2 (0, 1, ...
* @arg1 >= @arg2 (0, 0, ...
*
- * Returns 0 or 1 depending on the results of the test.
*/
int
-xmlXPathCompareValues(int inf, int strict, xmlXPathObjectPtr arg1,
- xmlXPathObjectPtr arg2) {
+xmlXPathCompareValues(int inf, int strict) {
TODO /* compare */
return(0);
}
@@ -1064,8 +1134,13 @@ xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
- if (cur == NULL)
+ if (cur == NULL) {
+ if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
+ return(ctxt->context->doc->root);
return(ctxt->context->node->childs);
+ }
+ if (ctxt->context->node->type == XML_DOCUMENT_NODE)
+ return(NULL);
return(cur->next);
}
@@ -1080,8 +1155,11 @@ xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
- if (cur == NULL)
+ if (cur == NULL) {
+ if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
+ return(ctxt->context->doc->root);
return(ctxt->context->node->childs);
+ }
if (cur->childs != NULL) return(cur->childs);
if (cur->next != NULL) return(cur->next);
@@ -1114,6 +1192,8 @@ xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
if (cur == NULL)
return(ctxt->context->node);
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(ctxt->context->doc->root);
if (cur->childs != NULL) return(cur->childs);
if (cur->next != NULL) return(cur->next);
@@ -1144,8 +1224,11 @@ xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
* the parent of an attribute or namespace node is the element
* to which the attribute or namespace node is attached
*/
- if (cur == NULL)
+ if (cur == NULL) {
+ if (ctxt->context->node->parent == NULL)
+ return((xmlNodePtr) ctxt->context->doc);
return(ctxt->context->node->parent);
+ }
return(NULL);
}
@@ -1168,9 +1251,15 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
* the parent of an attribute or namespace node is the element
* to which the attribute or namespace node is attached
*/
- if (cur == NULL)
+ if (cur == NULL) {
+ if (ctxt->context->node->parent == NULL)
+ return((xmlNodePtr) ctxt->context->doc);
return(ctxt->context->node->parent);
- if (cur == ctxt->context->doc->root) return(NULL);
+ }
+ if (cur == ctxt->context->doc->root)
+ return((xmlNodePtr) ctxt->context->doc);
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
return(cur->parent);
}
@@ -1194,7 +1283,10 @@ xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
if (cur == NULL)
return(ctxt->context->node);
- if (cur == ctxt->context->doc->root) return(NULL);
+ if (cur == ctxt->context->doc->root)
+ return((xmlNodePtr) ctxt->context->doc);
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
return(cur->parent);
}
@@ -1209,6 +1301,8 @@ xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
if (cur == NULL)
return(ctxt->context->node->next);
return(cur->next);
@@ -1226,6 +1320,8 @@ xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
if (cur == NULL)
return(ctxt->context->node->prev);
return(cur->prev);
@@ -1244,6 +1340,8 @@ xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
if (cur == NULL)
return(ctxt->context->node->next);; /* !!!!!!!!! */
if (cur->childs != NULL) return(cur->childs);
@@ -1274,6 +1372,8 @@ xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
+ if (cur == (xmlNodePtr) ctxt->context->doc)
+ return(NULL);
if (cur == NULL)
return(ctxt->context->node->prev); /* !!!!!!!!! */
if (cur->last != NULL) return(cur->last);
@@ -1515,14 +1615,19 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, int axis,
TODO /* NS search */
break;
case NODE_TEST_NAME:
- if (!xmlStrcmp(name, cur->name) &&
- (((prefix == NULL) ||
- ((cur->ns != NULL) &&
- (!xmlStrcmp(prefix, cur->ns->href)))))) {
+ switch (cur->type) {
+ case XML_ELEMENT_NODE:
+ if (!xmlStrcmp(name, cur->name) &&
+ (((prefix == NULL) ||
+ ((cur->ns != NULL) &&
+ (!xmlStrcmp(prefix, cur->ns->href)))))) {
#ifdef DEBUG_STEP
- n++;
+ n++;
#endif
- xmlXPathNodeSetAdd(ret, cur);
+ xmlXPathNodeSetAdd(ret, cur);
+ }
+ default:
+ break;
}
break;
@@ -1553,8 +1658,8 @@ void
xmlXPathRoot(xmlXPathParserContextPtr ctxt) {
if (ctxt->context->nodelist != NULL)
xmlXPathFreeNodeSet(ctxt->context->nodelist);
- ctxt->context->node = ctxt->context->doc->root;
- ctxt->context->nodelist = xmlXPathNodeSetCreate(ctxt->context->doc->root);
+ ctxt->context->node = (xmlNodePtr) ctxt->context->doc;
+ ctxt->context->nodelist = xmlXPathNodeSetCreate(ctxt->context->node);
}
/**
@@ -3125,8 +3230,7 @@ xmlXPathEvalRelationalExpr(xmlXPathParserContextPtr ctxt) {
(CUR == '>') ||
((CUR == '<') && (NXT(1) == '=')) ||
((CUR == '>') && (NXT(1) == '='))) {
- xmlXPathObjectPtr arg1, arg2, res;
- int inf, strict, equal;
+ int inf, strict;
if (CUR == '<') inf = 1;
else inf = 0;
@@ -3136,13 +3240,7 @@ xmlXPathEvalRelationalExpr(xmlXPathParserContextPtr ctxt) {
if (!strict) NEXT;
xmlXPathEvalAdditiveExpr(ctxt);
CHECK_ERROR;
- arg2 = valuePop(ctxt);
- arg1 = valuePop(ctxt);
- equal = xmlXPathCompareValues(inf, strict, arg1, arg2);
- res = xmlXPathNewBoolean(equal);
- valuePush(ctxt, res);
- xmlXPathFreeObject(arg1);
- xmlXPathFreeObject(arg2);
+ xmlXPathCompareValues(inf, strict);
}
}
@@ -3460,6 +3558,55 @@ xmlXPathEvalBasis(xmlXPathParserContextPtr ctxt) {
if (name != NULL)
free(name);
name = xmlXPathParseQName(ctxt, &prefix);
+ if (name == NULL) {
+ ERROR(XPATH_EXPR_ERROR);
+ }
+ type = xmlXPathGetNameType(ctxt, name);
+ switch (type) {
+ /*
+ * Simple case: no axis seach all given node types.
+ */
+ case NODE_TYPE_COMMENT:
+ if ((CUR != '(') || (NXT(1) != ')')) break;
+ SKIP(2);
+ nodetest = NODE_TEST_TYPE;
+ nodetype = XML_COMMENT_NODE;
+ goto search_nodes;
+ case NODE_TYPE_TEXT:
+ if ((CUR != '(') || (NXT(1) != ')')) break;
+ SKIP(2);
+ nodetest = NODE_TEST_TYPE;
+ nodetype = XML_TEXT_NODE;
+ goto search_nodes;
+ case NODE_TYPE_NODE:
+ if ((CUR != '(') || (NXT(1) != ')')) {
+ nodetest = NODE_TEST_NAME;
+ break;
+ }
+ SKIP(2);
+ nodetest = NODE_TEST_TYPE;
+ nodetype = XML_ELEMENT_NODE;
+ goto search_nodes;
+ case NODE_TYPE_PI:
+ if (CUR != '(') break;
+ if (NXT(1) != ')') {
+ /*
+ * Specific case: search a PI by name.
+ */
+ SKIP(2);
+ nodetest = NODE_TEST_PI;
+ xmlXPathEvalLiteral(ctxt);
+ CHECK_ERROR;
+ if (CUR != ')')
+ ERROR(XPATH_UNCLOSED_ERROR);
+ xmlXPathSearchPI(ctxt, 0);
+ return;
+ }
+ SKIP(2);
+ nodetest = NODE_TEST_TYPE;
+ nodetype = XML_PI_NODE;
+ goto search_nodes;
+ }
nodetest = NODE_TEST_NAME;
}
} else if ((CUR == ':') && (nodetest == NODE_TEST_NAME)) {
@@ -3618,7 +3765,8 @@ xmlXPathEvalLocationPath(xmlXPathParserContextPtr ctxt) {
} else if (CUR == '/') {
NEXT;
xmlXPathRoot(ctxt);
- xmlXPathEvalRelativeLocationPath(ctxt);
+ if (CUR != 0)
+ xmlXPathEvalRelativeLocationPath(ctxt);
} else {
xmlXPathEvalRelativeLocationPath(ctxt);
}