Commit 07cb8226 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Time to commit 3 days of work rewriting the parser internal,

fixing bugs and migrating to SAX2 interface by default. There
is some work letf TODO, like namespace validation and attributes
normalization (this break C14N right now)
* Makefile.am: fixed the test rules
* include/libxml/SAX2.h include/libxml/parser.h
  include/libxml/parserInternals.h SAX2.c parser.c
  parserInternals.c: changing the parser, migrating to SAX2,
  adding new interface to switch back to SAX1 or initialize a
  SAX block for v1 or v2. Most of the namespace work is done
  below SAX, as well as attribute defaulting
* globals.c: changed initialization of the default SAX handlers
* hash.c tree.c include/libxml/hash.h: added QName specific handling
* xmlIO.c: small fix
* xmllint.c testSAX.c: provide a --sax1 switch to test the old
  version code path
* result/p3p result/p3p.sax result/noent/p3p test/p3p: the new code
  pointed out a typo in a very old test namespace
Daniel
parent 8e36e6a0
...@@ -222,11 +222,14 @@ XMLtests : xmllint$(EXEEXT) ...@@ -222,11 +222,14 @@ XMLtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/$$name ] ; then \ if [ ! -f $(srcdir)/result/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \ $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/$$name result.$$name ; \ diff $(srcdir)/result/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name ; \ diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \ rm result.$$name result2.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -242,11 +245,14 @@ XMLtests : xmllint$(EXEEXT) ...@@ -242,11 +245,14 @@ XMLtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/$$name ] ; then \ if [ ! -f $(srcdir)/result/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --push $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --push $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/$$name result.$$name ; \ diff $(srcdir)/result/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint --push result.$$name > result2.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --push result.$$name > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name ; \ diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \ rm result.$$name result2.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -261,12 +267,14 @@ XMLtests : xmllint$(EXEEXT) ...@@ -261,12 +267,14 @@ XMLtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/$$name ] ; then \ if [ ! -f $(srcdir)/result/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --memory $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --memory $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name result.$$name ; \ diff $(srcdir)/result/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint --memory result.$$name > result2.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --memory result.$$name > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name ; \ diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \ rm result.$$name result2.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -302,11 +310,14 @@ XMLenttests : xmllint$(EXEEXT) ...@@ -302,11 +310,14 @@ XMLenttests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/noent/$$name ] ; then \ if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --noent $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --noent $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff $(srcdir)/result/noent/$$name result.$$name ; \ diff $(srcdir)/result/noent/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint --noent result.$$name > result2.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --noent result.$$name > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result.$$name result2.$$name ; \ diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \ rm result.$$name result2.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -322,6 +333,7 @@ URItests : testURI$(EXEEXT) ...@@ -322,6 +333,7 @@ URItests : testURI$(EXEEXT)
if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \ $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > result.$$name ; \
...@@ -335,6 +347,7 @@ URItests : testURI$(EXEEXT) ...@@ -335,6 +347,7 @@ URItests : testURI$(EXEEXT)
if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \ $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/testURI < $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/testURI < $$i > result.$$name ; \
...@@ -399,10 +412,11 @@ XPtrtests : testXPath$(EXEEXT) ...@@ -399,10 +412,11 @@ XPtrtests : testXPath$(EXEEXT)
if [ ! -d $$j ] ; then \ if [ ! -d $$j ] ; then \
if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \ if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
./testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \ $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
./testXPath -xptr -f -i $$i $$j > result.$$name ; \ $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/XPath/xptr/$$name result.$$name ; \ diff $(srcdir)/result/XPath/xptr/$$name result.$$name ; \
rm result.$$name ; \ rm result.$$name ; \
...@@ -421,6 +435,7 @@ XIncludetests : xmllint$(EXEEXT) ...@@ -421,6 +435,7 @@ XIncludetests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name ; \
...@@ -442,6 +457,7 @@ Scripttests : xmllint$(EXEEXT) ...@@ -442,6 +457,7 @@ Scripttests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \ if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name ; \
...@@ -462,6 +478,7 @@ Catatests : xmlcatalog$(EXEEXT) ...@@ -462,6 +478,7 @@ Catatests : xmlcatalog$(EXEEXT)
if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i > $(srcdir)/result/catalogs/$$name ; \ $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i > $(srcdir)/result/catalogs/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i > result.$$name ; \
...@@ -476,6 +493,7 @@ Catatests : xmlcatalog$(EXEEXT) ...@@ -476,6 +493,7 @@ Catatests : xmlcatalog$(EXEEXT)
if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \ $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
...@@ -514,11 +532,14 @@ SVGtests : xmllint$(EXEEXT) ...@@ -514,11 +532,14 @@ SVGtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \ if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \ $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/SVG/$$name result.$$name ; \ diff $(srcdir)/result/SVG/$$name result.$$name ; \
$(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff result.$$name result2.$$name ; \ diff result.$$name result2.$$name ; \
rm result.$$name result2.$$name ; \ rm result.$$name result2.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -527,7 +548,8 @@ Threadtests : testThreads$(EXEEXT) ...@@ -527,7 +548,8 @@ Threadtests : testThreads$(EXEEXT)
@echo "##" @echo "##"
@echo "## Threaded regression tests" @echo "## Threaded regression tests"
@echo "##" @echo "##"
$(CHECKER) $(top_builddir)/testThreads -@($(CHECKER) $(top_builddir)/testThreads ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";)
SAXtests : testSAX$(EXEEXT) SAXtests : testSAX$(EXEEXT)
@(echo > .memdump) @(echo > .memdump)
...@@ -540,9 +562,11 @@ SAXtests : testSAX$(EXEEXT) ...@@ -540,9 +562,11 @@ SAXtests : testSAX$(EXEEXT)
if [ ! -f $(srcdir)/result/$$name.sax ] ; then \ if [ ! -f $(srcdir)/result/$$name.sax ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax ; \ $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/testSAX $$i > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/$$name.sax result.$$name ; \ diff $(srcdir)/result/$$name.sax result.$$name ; \
rm result.$$name ; \ rm result.$$name ; \
fi ; fi ; done) fi ; fi ; done)
...@@ -569,6 +593,7 @@ Validtests : xmllint$(EXEEXT) ...@@ -569,6 +593,7 @@ Validtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/VC/$$name ] ; then \ if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \ $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
...@@ -585,6 +610,7 @@ Validtests : xmllint$(EXEEXT) ...@@ -585,6 +610,7 @@ Validtests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/valid/$$name ] ; then \ if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \ $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \ $(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
...@@ -605,6 +631,7 @@ Regexptests: testRegexp$(EXEEXT) ...@@ -605,6 +631,7 @@ Regexptests: testRegexp$(EXEEXT)
if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \ if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \ $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/testRegexp -i $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/testRegexp -i $$i > result.$$name ; \
...@@ -624,6 +651,7 @@ Automatatests: testAutomata$(EXEEXT) ...@@ -624,6 +651,7 @@ Automatatests: testAutomata$(EXEEXT)
if [ ! -f $(srcdir)/result/automata/$$name ] ; then \ if [ ! -f $(srcdir)/result/automata/$$name ] ; then \
echo New test file $$name ; \ echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \ $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing $$name ; \ echo Testing $$name ; \
$(CHECKER) $(top_builddir)/testAutomata $$i > result.$$name ; \ $(CHECKER) $(top_builddir)/testAutomata $$i > result.$$name ; \
...@@ -658,6 +686,7 @@ C14Ntests : testC14N$(EXEEXT) ...@@ -658,6 +686,7 @@ C14Ntests : testC14N$(EXEEXT)
else \ else \
echo "C14N failed"; \ echo "C14N failed"; \
fi; \ fi; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
fi; \ fi; \
rm -f $(srcdir)/test/c14n/test.tmp; \ rm -f $(srcdir)/test/c14n/test.tmp; \
done; \ done; \
...@@ -680,6 +709,7 @@ Schemastests: testSchemas$(EXEEXT) ...@@ -680,6 +709,7 @@ Schemastests: testSchemas$(EXEEXT)
$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ $(CHECKER) $(top_builddir)/testSchemas $$i $$j \
> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \
2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \ 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing "$$name"_"$$sno"_"$$xno" ; \ echo Testing "$$name"_"$$sno"_"$$xno" ; \
$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ $(CHECKER) $(top_builddir)/testSchemas $$i $$j \
...@@ -706,6 +736,7 @@ Relaxtests: xmllint$(EXEEXT) ...@@ -706,6 +736,7 @@ Relaxtests: xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
> $(srcdir)/result/relaxng/"$$name"_valid \ > $(srcdir)/result/relaxng/"$$name"_valid \
2> $(srcdir)/result/relaxng/"$$name"_err; \ 2> $(srcdir)/result/relaxng/"$$name"_err; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Checking schemas $$name ; \ echo Checking schemas $$name ; \
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
...@@ -727,6 +758,7 @@ Relaxtests: xmllint$(EXEEXT) ...@@ -727,6 +758,7 @@ Relaxtests: xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
> $(srcdir)/result/relaxng/"$$name"_"$$xno" \ > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing "$$name"_"$$xno" ; \ echo Testing "$$name"_"$$xno" ; \
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
...@@ -757,6 +789,7 @@ Relaxtests: xmllint$(EXEEXT) ...@@ -757,6 +789,7 @@ Relaxtests: xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
> $(srcdir)/result/relaxng/"$$name"_"$$xno" \ > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \ else \
echo Testing "$$name"_"$$xno" ; \ echo Testing "$$name"_"$$xno" ; \
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \ $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \
......
...@@ -15,16 +15,21 @@ to test those - More testing on RelaxNG ...@@ -15,16 +15,21 @@ to test those - More testing on RelaxNG
Schemas Schemas
2.5.11: Sep 9 2003:
A bugfix only release: - risk of crash in Relax-NG
- risk of crash when using multithreaded programs
2.5.10: Aug 15 2003: 2.5.10: Aug 15 2003:
A bugfixes only release - Windows Makefiles (William Brack) A bugfixes only release - Windows Makefiles (William Brack)
- UTF-16 support fixes (Mark Itzcovitz) - UTF-16 support fixes (Mark Itzcovitz)
- Makefile and portability (William Brack) automake, Linux alpha, Mingw - Makefile and portability (William Brack) automake, Linux alpha, Mingw
on Windows (Mikhail Grushinskiy) on Windows (Mikhail Grushinskiy)
- HTML parser (Oliver Stoeneberg) - HTML parser (Oliver Stoeneberg)
- XInclude performance problem reported by Kevin Ruscoe - XInclude performance problem reported by Kevin Ruscoe
- XML parser performance problem reported by Grant Goodale - XML parser performance problem reported by Grant Goodale
- xmlSAXParseDTD() bug fix from Malcolm Tredinnick - xmlSAXParseDTD() bug fix from Malcolm Tredinnick
- and a couple other cleanup - and a couple other cleanup
2.5.9: Aug 9 2003: 2.5.9: Aug 9 2003:
......
...@@ -274,8 +274,6 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) { ...@@ -274,8 +274,6 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
if (len < 0) if (len < 0)
len = xmlStrlen(name); len = xmlStrlen(name);
if (len <= 0)
return(NULL);
/* /*
* Check for duplicate and insertion location. * Check for duplicate and insertion location.
......
...@@ -361,7 +361,6 @@ xmlSAXHandler xmlDefaultSAXHandler = { ...@@ -361,7 +361,6 @@ xmlSAXHandler xmlDefaultSAXHandler = {
0, 0,
NULL, NULL,
NULL, NULL,
NULL,
NULL NULL
}; };
...@@ -415,7 +414,6 @@ xmlSAXHandler htmlDefaultSAXHandler = { ...@@ -415,7 +414,6 @@ xmlSAXHandler htmlDefaultSAXHandler = {
0, 0,
NULL, NULL,
NULL, NULL,
NULL,
NULL NULL
}; };
#endif /* LIBXML_HTML_ENABLED */ #endif /* LIBXML_HTML_ENABLED */
...@@ -457,7 +455,6 @@ xmlSAXHandler docbDefaultSAXHandler = { ...@@ -457,7 +455,6 @@ xmlSAXHandler docbDefaultSAXHandler = {
0, 0,
NULL, NULL,
NULL, NULL,
NULL,
NULL NULL
}; };
#endif /* LIBXML_DOCB_ENABLED */ #endif /* LIBXML_DOCB_ENABLED */
...@@ -486,16 +483,16 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs) ...@@ -486,16 +483,16 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
xmlMutexLock(xmlThrDefMutex); xmlMutexLock(xmlThrDefMutex);
#ifdef LIBXML_DOCB_ENABLED #ifdef LIBXML_DOCB_ENABLED
initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); xmlSAX2InitDocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
#endif #endif
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); xmlSAX2InitHtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
#endif #endif
gs->oldXMLWDcompatibility = 0; gs->oldXMLWDcompatibility = 0;
gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); xmlSAX2InitDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
gs->xmlDefaultSAXLocator.getPublicId = getPublicId; gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
gs->xmlDefaultSAXLocator.getSystemId = getSystemId; gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber; gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
......
...@@ -103,6 +103,21 @@ XMLPUBFUN void XMLCALL ...@@ -103,6 +103,21 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2EndElement (void *ctx, xmlSAX2EndElement (void *ctx,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN void XMLCALL
xmlSAX2StartElementNs (void *ctx,
const xmlChar *localname,
const xmlChar *prefix,
const xmlChar *URI,
int nb_namespaces,
const xmlChar **namespaces,
int nb_attributes,
int nb_defaulted,
const xmlChar **attributes);
XMLPUBFUN void XMLCALL
xmlSAX2EndElementNs (void *ctx,
const xmlChar *localname,
const xmlChar *prefix,
const xmlChar *URI);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2Reference (void *ctx, xmlSAX2Reference (void *ctx,
const xmlChar *name); const xmlChar *name);
...@@ -142,6 +157,12 @@ XMLPUBFUN void XMLCALL ...@@ -142,6 +157,12 @@ XMLPUBFUN void XMLCALL
const xmlChar *value, const xmlChar *value,
int len); int len);
XMLPUBFUN int XMLCALL
xmlSAXDefaultVersion (int version);
XMLPUBFUN int XMLCALL
xmlSAXVersion (xmlSAXHandler *hdlr,
int version);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
int warning); int warning);
......
...@@ -150,6 +150,24 @@ XMLPUBFUN void * XMLCALL ...@@ -150,6 +150,24 @@ XMLPUBFUN void * XMLCALL
const xmlChar *name, const xmlChar *name,
const xmlChar *name2, const xmlChar *name2,
const xmlChar *name3); const xmlChar *name3);
XMLPUBFUN void * XMLCALL
xmlHashQLookup (xmlHashTablePtr table,
const xmlChar *name,
const xmlChar *prefix);
XMLPUBFUN void * XMLCALL
xmlHashQLookup2 (xmlHashTablePtr table,
const xmlChar *name,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *prefix2);
XMLPUBFUN void * XMLCALL
xmlHashQLookup3 (xmlHashTablePtr table,
const xmlChar *name,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *prefix2,
const xmlChar *name3,
const xmlChar *prefix3);
/* /*
* Helpers. * Helpers.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <libxml/dict.h> #include <libxml/dict.h>
#include <libxml/hash.h>
#include <libxml/valid.h> #include <libxml/valid.h>
#include <libxml/entities.h> #include <libxml/entities.h>
...@@ -246,14 +247,19 @@ struct _xmlParserCtxt { ...@@ -246,14 +247,19 @@ struct _xmlParserCtxt {
*/ */
const xmlChar *str_xml; const xmlChar *str_xml;
const xmlChar *str_xmlns; const xmlChar *str_xmlns;
const xmlChar *str_xml_ns;
/* /*
* Everything below is related to the new SAX mode * Everything below is used only by the new SAX mode
*/ */
int sax2; /* operating in the new SAX mode */ int sax2; /* operating in the new SAX mode */
int nsNr; /* the number of inherited namespaces */ int nsNr; /* the number of inherited namespaces */
int nsMax; /* the size of the arrays */ int nsMax; /* the size of the arrays */
const xmlChar * *nsTab; /* the array of prefix/namespace name */ const xmlChar * *nsTab; /* the array of prefix/namespace name */
int *attallocs; /* which attribute were allocated */
void * *pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
}; };
/** /**
...@@ -622,12 +628,14 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx); ...@@ -622,12 +628,14 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
* @nb_namespaces: number of namespace definitions on that node * @nb_namespaces: number of namespace definitions on that node
* @namespaces: pointer to the array of prefix/URI pairs namespace definitions * @namespaces: pointer to the array of prefix/URI pairs namespace definitions
* @nb_attributes: the number of attributes on that node * @nb_attributes: the number of attributes on that node
* @nb_defaulted: the number of defaulted attributes. The defaulted
* ones are at the end of the array
* @attributes: pointer to the array of (localname/prefix/URI/value/end)
* attribute values.
* *
* SAX2 callback when an element start has been detected by the parser. * SAX2 callback when an element start has been detected by the parser.
* It provides the namespace informations for the element, as well as * It provides the namespace informations for the element, as well as
* the new namespace declarations on the element. * the new namespace declarations on the element.
* The number of attributes is given in this callback but the attributes
* themselves will be provided as separate callbacks.
*/