1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00
Commit Graph

215 Commits

Author SHA1 Message Date
Nick Wellnhofer
6c128fd58a Fuzz XInclude engine 2020-08-08 14:32:44 +02:00
Nick Wellnhofer
1abf2967f9 Fix exponential runtime and memory in xi:fallback processing
When creating XML_XINCLUDE_START nodes, the children of the original
xi:include node must be freed, otherwise fallback content is copied
twice, doubling runtime and memory consumption for each nested
xi:fallback/xi:include pair.

Found with libFuzzer.
2020-08-07 19:59:07 +02:00
Nick Wellnhofer
11b5745927 Don't process siblings of root in xmlXIncludeProcess
xmlXIncludeDoProcess would follow the siblings of the tree root and
also expand these nodes. When using an XML reader, this could lead to
siblings of the current node being expanded without having been parsed
completely.
2020-08-07 18:51:52 +02:00
Nick Wellnhofer
0f9817c75b Don't recurse into xi:include children in xmlXIncludeDoProcess
Otherwise, nested xi:include nodes might result in a use-after-free
if XML_PARSE_NOXINCNODE is specified.

Found with libFuzzer and ASan.
2020-08-06 14:29:33 +02:00
Nick Wellnhofer
5725c1153a Fix memory leak in xmlXIncludeIncludeNode error paths
Found with libFuzzer and ASan.
2020-08-06 14:29:24 +02:00
Nick Wellnhofer
ff009f9913 Fix memory leak in xmlXIncludeLoadDoc error path
Found by OSS-Fuzz.
2020-05-30 15:43:34 +02:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
e91cbcf639 Don't read external entities or XIncludes from stdin
The file input callbacks try to read from stdin if "-" is passed as URL.
This should never be done when loading indirect resources like external
entities or XIncludes. Unfortunately, the stdin substitution happens
deep inside the IO code, so we simply replace "-" with "./-" in specific
locations.

This issue also affects other users of the library like libxslt.
Ideally, stdin should only be substituted on explicit request. But more
intrusive changes could break existing code.

Closes #90 and #102.
2019-09-20 13:26:51 +02:00
Nick Wellnhofer
e32afd3fd7 Fix error message when processing XIncludes with fallbacks
Fixes bug #616491
https://bugzilla.gnome.org/show_bug.cgi?id=616491

Based on merge request !41
2019-09-13 15:45:21 +02:00
Wang Kirin
a6a578675b Fix memory leak in xmlXIncludeLoadTxt 2019-08-25 14:12:34 +02:00
Nick Wellnhofer
e03f0a199a Fix hash callback signatures
Make sure that all parameters and return values of hash callback
functions exactly match the callback function type. This is required
to pass clang's Control Flow Integrity checks and to allow compilation
to asm.js with Emscripten.

Fixes bug 784861.
2017-11-09 16:42:47 +01:00
David Kilzer
4472c3a5a5 Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029

Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports.
2016-05-23 15:01:07 +08:00
Nicolas Le Cam
41586ca667 Fix compilation with minimum and xinclude.
xinclude needs xmlAddNextSibling().
Compile out use of xmlLocationSetPtr when xptr is disabled.
Include xpath header.
2014-02-10 10:36:40 +08:00
Alexey Neyman
0b86537dfa Remove premature XInclude check on URI being relative
As it gives false negatives, see
  https://mail.gnome.org/archives/xml/2013-April/msg00023.html
2013-05-06 10:20:18 +08:00
Daniel Veillard
f8e3db0445 Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
2012-09-11 13:26:36 +08:00
Vitaly Ostanin
dce1c8baae Patch for xinclude of text using multibyte characters
for bug https://bugzilla.gnome.org/show_bug.cgi?id=633166

When you xinclude a text file, reading portions (by 4000 bytes) of the
buffer incorrectly handled the situation when the end comes across
portions of the bytes in a multibyte character.
2012-08-17 22:59:44 +08:00
Daniel Veillard
3e62adbe39 Adding various checks on node type though the API
Specifially checking against namespace nodes before accessing node
pointers
2012-08-09 14:24:02 +08:00
Daniel Veillard
345ee8b620 Convert XInclude to the new input buffers
A few xmlBuffer...() calls changed to their xmlBuf...() counterparts
2012-07-23 14:24:27 +08:00
Shaun McCance
4cf7325e1f xinclude with parse="text" does not use the entity loader
For https://bugzilla.gnome.org/show_bug.cgi?id=552479

The code for xinclude parse="text" was not using the registered
entity loader, defeating attempts to control loading of files.
2012-05-10 20:59:33 +08:00
Daniel Veillard
06c93b7509 Remove a few warnings 2010-03-15 16:08:44 +01:00
Daniel Veillard
594e5dfb48 Chasing dead assignments reported by clang-scan
* SAX2.c dict.c error.c hash.c nanohttp.c parser.c python/libxml.c
  relaxng.c runtest.c tree.c valid.c xinclude.c xmlregexp.c xmlsave.c
  xmlschemas.c xpath.c xpointer.c: mostly removing unneded affectations,
  but this led to a few real bugs and some part not yet understood
  (relaxng/interleave)
2009-09-07 14:58:47 +02:00
Daniel Veillard
cb6f525fff 584220 xpointer(/) and xinclude problems
* xinclude.c: xpointer(/) in xinclude could lead to sub-document nodes
  and also fixed the code to inherit the dictionary from the embedding
  document
2009-08-25 19:24:15 +02:00
Stefan Behnel
b9590e9cd2 440226 Add xmlXIncludeProcessTreeFlagsData API
* xinclude.c include/libxml/xinclude.h: new function similar to
  xmlXIncludeProcessFlagsData but operating on a subtree
2009-08-24 19:45:54 +02:00
Daniel Veillard
54bd29b79b patch based on Wieant Nielander contribution to add the option of not
* include/libxml/parser.h xinclude.c xmllint.c: patch based on
  Wieant Nielander contribution to add the option of not doing
  URI base fixup in XInclude
Daniel

svn path=/trunk/; revision=3775
2008-08-26 07:26:55 +00:00
Daniel Veillard
37d2d16c89 patch from Vasily Chekalkin fixes memory leaks, should fix 512647 Daniel
* parser.c xinclude.c: patch from Vasily Chekalkin fixes memory
  leaks, should fix 512647
Daniel

svn path=/trunk/; revision=3706
2008-03-14 10:54:00 +00:00
Daniel Veillard
b242b08831 applied patch from Florent Guilian to remove an useless mutex in the
* dict.c: applied patch from Florent Guilian to remove an
  useless mutex in the xmlDict structure.

older, not commited ...

* SAX2.c: another leak reported by Ashwin
* xinclude.c: fixed the behaviour when XIncluding a fragment
  of the current document, patch from Chris Ryan

Daniel


svn path=/trunk/; revision=3686
2008-02-08 09:56:31 +00:00
William M. Brack
b0a94e8bfa applied patch from bug #454608 from Patrik Fimml. Fixes bug #454608.
* xinclude.c: applied patch from bug #454608 from Patrik Fimml.
  Fixes bug #454608.

svn path=/trunk/; revision=3644
2007-07-18 18:04:55 +00:00
William M. Brack
53ce98cd03 fixed problem with invalid char encountered during text include (reported
* xinclude.c: fixed problem with invalid char encountered during text include (reported on xslt mailing list)

svn path=/trunk/; revision=3583
2007-02-13 00:37:20 +00:00
Daniel Veillard
a658582e1a anothe XInclude user data propagation patch from Michael Day Daniel
* xinclude.c: anothe XInclude user data propagation patch from
  Michael Day
Daniel
2006-12-04 09:21:28 +00:00
Daniel Veillard
681e904e37 fixed a comment applied a patch from Michael Day to add a new function
* xmlsave.c: fixed a comment
* xinclude.c include/libxml/xinclude.h: applied a patch from Michael Day
  to add a new function providing the _private field for the generated
  parser contexts xmlXIncludeProcessFlagsData()
Daniel
2006-09-29 09:16:00 +00:00
Daniel Veillard
bf630c0d8b fix bug #343968, include='text' can't lead to a recursion. Daniel
* xinclude.c: fix bug #343968, include='text' can't lead to a
  recursion.
Daniel
2006-06-06 08:21:41 +00:00
Daniel Veillard
11ce4004d8 end of first pass on coverity reports. Daniel
* runtest.c schematron.c testAutomata.c tree.c valid.c xinclude.c
  xmlcatalog.c xmlreader.c xmlregexp.c xpath.c: end of first
  pass on coverity reports.
Daniel
2006-03-10 00:36:23 +00:00
Daniel Veillard
e0fd93f5d3 fixed bug #302302, nasty but the fix is rather simple. Daniel
* xinclude.c: fixed bug #302302, nasty but the fix is rather simple.
Daniel
2005-08-10 13:39:10 +00:00
Daniel Veillard
24505b0f5c a lot of small cleanups based on Linus' sparse check output. Daniel
* HTMLparser.c SAX2.c encoding.c globals.c parser.c relaxng.c
  runsuite.c runtest.c schematron.c testHTML.c testReader.c
  testRegexp.c testSAX.c testThreads.c valid.c xinclude.c xmlIO.c
  xmllint.c xmlmodule.c xmlschemas.c xpath.c xpointer.c: a lot of
  small cleanups based on Linus' sparse check output.
Daniel
2005-07-28 23:49:35 +00:00
William M. Brack
0b13a091e8 Enhanced handling of xml:base for included elements, fixing bugs 169209
* xinclude.c: Enhanced handling of xml:base for included
  elements, fixing bugs 169209 and 302353.
2005-06-01 03:37:59 +00:00
Daniel Veillard
5d4644ef6e revamped the elfgcchack.h format to cope with gcc4 change of aliasing
* doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h
  format to cope with gcc4 change of aliasing allowed scopes, had
  to add extra informations to doc/libxml2-api.xml to separate
  the header from the c module source.
* *.c: updated all c library files to add a #define bottom_xxx
  and reimport elfgcchack.h thereafter, and a bit of cleanups.
* doc//* testapi.c: regenerated when rebuilding the API
Daniel
2005-04-01 13:11:58 +00:00
William M. Brack
a22da29921 fixed xmlXIncludeParseFile to prevent overwriting XML_COMPLETE_ATTRS when
* xinclude.c: fixed xmlXIncludeParseFile to prevent
  overwriting XML_COMPLETE_ATTRS when setting pctxt->loadsubset
  (bug 166199)
* Makefile.am, python/tests/Makefile.am, xstc/Makefile.am: added
  code to add $(top_builddir)/.libs to LD_LIBRARY_PATH whenever
  PYTHONPATH is set, to assure new libxml2 routines are used.
2005-02-12 01:08:22 +00:00
Daniel Veillard
ce244ad595 fixed the way the generator works, extended the testing, especially with
* gentest.py testapi.c: fixed the way the generator works,
  extended the testing, especially with more real trees and nodes.
* HTMLtree.c tree.c valid.c xinclude.c xmlIO.c xmlsave.c: a bunch
  of real problems found and fixed.
* entities.c: fix error reporting to go through the new handlers
Daniel
2004-11-05 10:03:46 +00:00
Daniel Veillard
03a53c34db added checking for names values and dictionnaries generates a tons of
* debugXML.c include/libxml/xmlerror.h: added checking for names
  values and dictionnaries generates a tons of errors
* SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c
  include/libxml/tree.h: fixing the errors in the regression tests
Daniel
2004-10-26 16:06:51 +00:00
Daniel Veillard
c14c3892a2 added help for new set shell command added parser option to not generate
* debugXML.c: added help for new set shell command
* xinclude.c xmllint.c xmlreader.c include/libxml/parser.h:
  added parser option to not generate XInclude start/end nodes,
  added a specific option to xmllint to test it fixes #130769
* Makefile.am: regression test the new feature
* doc/xmllint.1 doc/xmllint.xml: updated man page to document option.
Daniel
2004-08-16 12:34:50 +00:00
William M. Brack
b85c9205f9 added some code to check, when an include is done, whether the requested
* xinclude.c: added some code to check, when an include is
  done, whether the requested URL gets mapped to some other
  location (e.g. with a catalog entry) and, if so, take care
  of the xml:base properly (bug 146988)
2004-07-26 00:20:13 +00:00
William M. Brack
abf598b548 some further enhancement to take care of xml:base for XPointer elements
* xinclude.c: some further enhancement to take care of
  xml:base for XPointer elements (bug 143886).  Also fixed
  a problem when xml:base was already specified on an
  XInclude'd element.
2004-06-08 02:01:28 +00:00
William M. Brack
f7789b13c5 added a new routine xmlBuildRelativeURI needed for enhancement of
* uri.c, include/libxml/uri.h: added a new routine
  xmlBuildRelativeURI needed for enhancement of xinclude.c
* xinclude.c: changed handling of xml:base (bug 135864)
* result/XInclude/*: results of 5 tests changed as a result
  of the above change
2004-06-07 08:57:27 +00:00
William M. Brack
7b0e276395 a little further fixing of fallback processing, this time for fallback
* xinclude.c: a little further fixing of fallback processing, this
  time for fallback with children (bug 139520).
2004-05-12 09:33:23 +00:00
William M. Brack
87640d5f14 minor warning cleanup (no change to logic) fixed return value for internal
* xmlschemas.c, xmlwriter.c, doc/examples/parse4.c,
  doc/examples/io2.c: minor warning cleanup (no change to logic)
* xinclude: fixed return value for internal function
  xmlXIncludeLoadFallback (now always 0 or -1)
2004-04-17 14:58:15 +00:00
William M. Brack
5d8d10bba3 fixed problem causing duplicate fallback execution (bug 139520) added
* xinclude.c: fixed problem causing duplicate fallback
  execution (bug 139520)
* test/XInclude/docs/fallback2.xml result/XInclude/fallback2.*:
  added testcase
2004-04-16 08:11:26 +00:00
Daniel Veillard
500a1de533 applied patch from Alfred Mickautsch for better DTD support. fixed bug
* xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from
  Alfred Mickautsch for better DTD support.
* SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c
  xmlschemas.c: fixed bug #137867 i.e. fixed properly the way
  reference counting is handled in the XML parser which had the
  side effect of removing a lot of hazardous cruft added to try
  to fix the problems associated as they popped up.
* xmlIO.c: FILE * close fixup for stderr/stdout
Daniel
2004-03-22 15:22:58 +00:00
William M. Brack
57e9e9180a Changed the flag to xmlDocCopyNode (and similar routines), previously used
* tree.c: Changed the flag to xmlDocCopyNode (and similar routines),
  previously used only for recursion, to use a value of '2' to
  indicate copy properties & namespaces, but not children.
* xinclude.c: changed the handling of ranges to use the above new
  facility.  Fixes Bug 134268.
2004-03-09 16:19:02 +00:00
William M. Brack
4d59e22a19 enhanced to assure that if xpointer is called for a document, the
* xinclude.c: enhanced to assure that if xpointer is called
  for a document, the XML_PARSE_NOENT flag is set before parsing
  the included document so that entities will automatically get
  taken care of.
* xpointer.c: corrected code so that, if an XML_ENTITY_REF node
  is encountered, it will log it and not crash (bug 135713)
2004-03-08 14:42:31 +00:00
William M. Brack
a11e483e8a modified to make sub-includes inherit the parse flags from the parent
* xinclude.c: modified to make sub-includes inherit the
  parse flags from the parent document (bug 132597)
2004-03-07 11:03:43 +00:00
Daniel Veillard
f54cd533d8 fixing compilation and link option when configuring with --without-valid
* debugXML.c relaxng.c valid.c xinclude.c xmllint.c xmlreader.c:
  fixing compilation and link option when configuring with
  --without-valid should fix #135309
Daniel
2004-02-25 11:52:31 +00:00
Daniel Veillard
5bb9ccd56a remove the warning on the 2001 namespace remove some warnings when
* xinclude.c: remove the warning on the 2001 namespace
* parser.c parserInternals.c xpath.c: remove some warnings
  when compiling with MSVC6
* nanohttp.c: applied a patch when using _WINSOCKAPI_
Daniel
2004-02-09 12:39:02 +00:00
William M. Brack
95af594b0b added a small hack to fix interference between my fixes for bugs 132585
* xinclude.c: added a small hack to fix interference between
  my fixes for bugs 132585 and 132588.
* python/libxml.c: fixed problem with serialization of namespace
  reported on the mailing list by Anthony Carrico
2004-02-08 04:12:49 +00:00
William M. Brack
6bdacd7aee fixed problem with function xmlXIncludeCopyRange (bug 133686).
* xinclude.c: fixed problem with function xmlXIncludeCopyRange
  (bug 133686).
2004-02-07 08:53:23 +00:00
William M. Brack
6b1a28d34e changed coding to output good XIncludes when one or more bad ones are
* xinclude.c: changed coding to output good XIncludes when
  one or more bad ones are present (bug 132588)
2004-02-06 11:24:44 +00:00
William M. Brack
ef245fda92 corrected handling of empty fallback condition (bug 132585)
* xinclude.c: corrected handling of empty fallback condition
  (bug 132585)
2004-02-06 09:33:59 +00:00
William M. Brack
b2d25dd760 fixed problem regarding freeing of dictionary when there are errors within
* xinclude.c: fixed problem regarding freeing of dictionary
  when there are errors within an XInclude file (bug 133106).
  Thanks to Oleg Paraschenko for the assistance.
2004-02-04 00:51:21 +00:00
Daniel Veillard
03c2f0a41d fixing #130453 XInclude element with no href attribute fully integrating
* xinclude.c: fixing #130453 XInclude element with no href attribute
* relaxng.c rngparser.c include/libxml2/relaxng.h: fully integrating
  the compact syntax will require more work, postponed for the
  2.6.5 release.
Daniel
2004-01-25 19:54:59 +00:00
Daniel Veillard
4773df2a58 added io1.c an example ox xmlIO usage and io1.res test result, fixed a
* doc/examples/*: added io1.c an example ox xmlIO usage and io1.res
  test result, fixed a awful lot of memory leaks showing up in
  testWriter.c, changed the examples and the Makefiles to test
  memory leaks.
* xmlwriter.c: fixed a memory leak
* Makefile.am: run the doc/examples regression tests as part of
  make tests
* xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to
  compile an XPath expression within a context, currently the goal
  is to be able to reuse the XSLT stylesheet dictionnary, but this
  opens the door to others possible optimizations.
* dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows
  to build a new dictionnary based on another read-only dictionnary.
  This is needed for XSLT to keep the stylesheet dictionnary read-only
  while being able to reuse the strings for the transformation
  dictionnary.
* xinclude.c: fixed a dictionnar reference counting problem occuring
  when document parsing failed.
* testSAX.c: adding option --repeat for timing 100times the parsing
* doc/* : rebuilt all the docs
Daniel
2004-01-23 13:15:13 +00:00
William M. Brack
aae10527fa fixed problem with "recursive" include (fallback contains another include
* xinclude.c: fixed problem with "recursive" include (fallback
  contains another include - Bug 129969)
2004-01-02 14:59:41 +00:00
William M. Brack
1ff4213edd fixed problem caused by wrong dictionary reference count, reported on the
* xinclude.c: fixed problem caused by wrong dictionary
  reference count, reported on the list by Christopher
  Grayce.
2003-12-31 14:05:15 +00:00
William M. Brack
f7eb794c14 fixed problem pointed out by Stphane Bidoul on the list. completed
* python/generator.py, python/libxml2class.txt: fixed problem
  pointed out by Stphane Bidoul on the list.
* xinclude.c, xpointer.c, xpath.c, include/libxml/xpointer.h:
  completed modifications required to fix Bug 129967 (at last!).
  Now wait to see how long before further trouble...
2003-12-31 07:59:17 +00:00
William M. Brack
72ee48d55f Fixed memory leak reported by Dave Beckett Removed spurious comment
* parser.c, xmlmemory.c, include/libxml/xmlmemory.h: Fixed
  memory leak reported by Dave Beckett
* xmlschemas.c: Removed spurious comment reported on the mailing
  list
* xinclude.c, xpath.c, xpointer.c, libxml/include/xpointer.h:
  Further work on Bug 129967 concerning xpointer range handling
  and range-to function; much better, but still not complete
2003-12-30 08:30:19 +00:00
Daniel Veillard
b98d082eef XInclude xpointer support was broken with the new namespace. Fixes #129932
* xinclude.c result/XInclude/nodes2.*: XInclude xpointer support
  was broken with the new namespace. Fixes #129932
Daniel
2003-12-24 11:06:25 +00:00
Daniel Veillard
2d2f155224 fixed a serious problem in XInclude #129021 Daniel
* xinclude.c: fixed a serious problem in XInclude #129021
Daniel
2003-12-21 23:36:39 +00:00
Daniel Veillard
e74d2e1cb8 augmented the XInclude API to be able to pass XML parser flags down to the
* xinclude.c xmllint.c xmlreader.c include/libxml/xinclude.h
  include/libxml/xmlerror.h: augmented the XInclude API
  to be able to pass XML parser flags down to the Inclusion
  process. Also resynchronized with the Last Call W3C Working
  Draft 10 November 2003 for the xpointer attribute.
* Makefile.am test/XInclude/docs/nodes[23].xml
  result/XInclude/*: augmented the tests for the new namespace and
  testing the xpointer attribute, changed the way error messages
  are tested
* doc/*: regenerated the documentation
Daniel
2003-12-09 11:35:37 +00:00
Daniel Veillard
b5fa02085e filter warning messages if the global setting blocks them updated the
* error.c: filter warning messages if the global setting blocks them
* xinclude.c xmlreader.c include/libxml/xinclude.h
  include/libxml/xmlerror.h: updated the change of namespace at
  the XInclude level, raise a warning if the old one is found,
  and some cleanup
Daniel
2003-12-08 17:41:29 +00:00
Daniel Veillard
a152c4d6bd fix an error message added tree2 example from Lucas Brasilino Daniel
* xinclude.c: fix an error message
* doc/examples/*: added tree2 example from Lucas Brasilino
Daniel
2003-11-19 16:24:26 +00:00
Daniel Veillard
798ae54344 fixed bug #125812, about XPointer in XInclude failing but not returning an
* xinclude.c: fixed bug #125812, about XPointer in XInclude
  failing but not returning an error.
Daniel
2003-11-03 17:13:52 +00:00
Daniel Veillard
7899c5c5d6 adding XInclude support to the reader interface. Lot of testing of the
* xinclude.c xmlreader.c include/libxml/xinclude.h: adding XInclude
  support to the reader interface. Lot of testing of the walker,
  various bug fixes.
* xmllint.c: added --walker and made sure --xinclude --stream --debug
  works as expected
* Makefile.am result/dtd11.rdr result/ent6.rdr test/dtd11 test/ent6
  result/XInclude/*.rdr: added regression tests for the walker and
  XInclude xmlReader support, had to slightly change a couple of tests
  because the walker can't distinguish <foo/> from <foo></foo>
Daniel
2003-11-03 12:31:38 +00:00
Daniel Veillard
659e71ec24 Setting up the framework for structured error reporting, touches a lot of
* HTMLparser.c c14n.c catalog.c error.c globals.c parser.c
  parserInternals.c relaxng.c valid.c xinclude.c xmlIO.c xmlregexp.c
  xmlschemas.c xpath.c xpointer.c include/libxml/globals.h
  include/libxml/parser.h include/libxml/valid.h
  include/libxml/xmlerror.h: Setting up the framework for structured
  error reporting, touches a lot of modules, but little code now
  the error handling trail has been cleaned up.
Daniel
2003-10-10 14:10:40 +00:00
Daniel Veillard
69d2c171fa comment fix migrating the catalog code to the new infrastructure Daniel
* xinclude.c: comment fix
* catalog.c include/libxml/xmlerror.h: migrating the catalog code
  to the new infrastructure
Daniel
2003-10-09 11:46:07 +00:00
Daniel Veillard
cd6ff28211 final error handling cleanup converted XInclude to the new error handling
* xmlIO.c: final error handling cleanup
* xinclude.c error.c: converted XInclude to the new error handling
* include/libxml/xmlerror.h: added XInclude errors
Daniel
2003-10-08 22:38:13 +00:00
Daniel Veillard
10acc2f37a patch from Mark Vakoc that allows compiling with XInclude but without
* xinclude.c: patch from Mark Vakoc that allows compiling
  with XInclude but without XPointer support.
Daniel
2003-09-01 20:59:40 +00:00
Daniel Veillard
9848532c2a get rid of some compilation warnings. fix the performance problem reported
* DOCBparser.c globals.c include/libxml/xmlmemory.h: get rid of
  some compilation warnings.
* xinclude.c: fix the performance problem reported by Kevin Ruscoe
  plus some cleanup and better error reporting.
Daniel
2003-08-14 15:44:40 +00:00
William M. Brack
78637da0ea fixing bug 118559 2003-07-31 14:47:38 +00:00
Daniel Veillard
8edf1c5c6c added a new API xmlXIncludeProcessTree() to process XInclude only on a
* xinclude.c include/libxml/xinclude.h: added a new API
  xmlXIncludeProcessTree() to process XInclude only on a subtree
  this should fix bug #115385
Daniel
2003-07-22 20:52:14 +00:00
Daniel Veillard
ffe4f5ec16 fixed bug #116095 removing the error message when reapplying XInclude to a
* xinclude.c: fixed bug #116095 removing the error message when
  reapplying XInclude to a document.
Daniel
2003-07-06 17:35:43 +00:00
Daniel Veillard
a507fbf3c2 try to work on bug #109225 and provide better error reports. this change
* relaxng.c: try to work on bug #109225 and provide better
  error reports.
* result/relaxng/* : this change the output of a number of tests
* xinclude.c: fixing the parsed entity redefinition problem
  raised on the list.
* test/schemas/date_0.xsd: updated the date test c.f. E2-12
Daniel
2003-03-31 16:09:37 +00:00
Daniel Veillard
b6c7f415b7 forgot to apply one check from #106931 patch more work on XML Schemas
* xinclude.c: forgot to apply one check from #106931 patch
* xmlschemastypes.c: more work on XML Schemas datatypes
Daniel
2003-03-29 16:41:55 +00:00
Daniel Veillard
d9b72839b3 should fix #109327 errors on memory accesses Daniel
* xinclude.c: should fix #109327 errors on memory accesses
Daniel
2003-03-27 14:24:00 +00:00
Daniel Veillard
2406abda9c Fixes bug #106931 in XInclude entities merging. Daniel
* xinclude.c: Fixes bug #106931 in XInclude entities merging.
Daniel
2003-02-24 18:16:47 +00:00
Daniel Veillard
f4b4f98839 added TODO for the DTD compatibility spec more bug fixes driven by the
* relaxng.c: added TODO for the DTD compatibility spec
* xinclude.c: more bug fixes driven by the testsuite
Daniel
2003-02-13 11:02:08 +00:00
Daniel Veillard
d581b7edd4 Work on the W3C/NIST regression tests for XInclude, improved the script,
* check-xinclude-test-suite.py xinclude.c: Work on the W3C/NIST
  regression tests for XInclude, improved the script, improving
  XInclude error reporting mechanism
Daniel
2003-02-11 18:03:05 +00:00
Daniel Veillard
97fd5670df applied another bug fix from Sean Chittenden Daniel
* xinclude.c: applied another bug fix from Sean Chittenden
Daniel
2003-02-07 13:01:54 +00:00
Daniel Veillard
4287c57a0e fixing bug #105137 about entities declaration needing to be copied to the
* xinclude.c: fixing bug #105137 about entities declaration
  needing to be copied to the including document.
Daniel
2003-02-04 22:48:53 +00:00
Daniel Veillard
0650345dea fallback was only copying the first child not the full child list of the
* xinclude.c: fallback was only copying the first child not the
  full child list of the fallback element, closes #89684 as reopened
  by Bernd Kuemmerlen
Daniel
2002-12-13 10:42:08 +00:00
Daniel Veillard
d076a20ea6 fixed #99082 for xi:include encoding="..." support on text includes. added
* xinclude.c parserInternals.c encoding.c: fixed #99082
  for xi:include encoding="..." support on text includes.
* result/XInclude/tstencoding.xml test/XInclude/docs/tstencoding.xml
  test/XInclude/ents/isolatin.txt : added a specific regression test
* python/generator.py python/libxml2class.txt: fixed the generator
  the new set of comments generated for doc/libxml2-api.xml were
  breaking the python generation.
Daniel
2002-11-20 13:28:31 +00:00
Daniel Veillard
dda8f1ba9f make sure ATTRIBUTE_UNUSED is always put after the attribute declaration,
* xinclude.c xmlschemas.c xmlschemastypes.c xpath.c: make sure
  ATTRIBUTE_UNUSED is always put after the attribute declaration,
  not before
Daniel
2002-09-26 09:47:36 +00:00
Daniel Veillard
118aed78f3 fixed the data callback on transition functionality which was broken when
* xmlregexp.c: fixed the data callback on transition functionality
  which was broken when using the compact form
* result/schemas/*: updated the results, less verbose, all tests
  pass like before
* DOCBparser.c testAutomata.c testC14N.c testSchemas.c testThreads.c
  testXPath.c valid.c xinclude.c xmllint.c xmlregexp.c xmlschemas.c
  xmlschemastypes.c xpath.c python/libxml.c: removed a bunch of
  annoying warnings
* xpath.c: try to provide better error report when possible
Daniel
2002-09-24 14:13:13 +00:00
Daniel Veillard
bbc72c3abf reimplemented a large part of the XInclude processor, trying to minimize
* xinclude.c: reimplemented a large part of the XInclude
  processor, trying to minimize resources used, James Henstridge
  provided a huge test case which was exhibiting severe memory
  consumption problems.
Daniel
2002-09-05 10:52:10 +00:00
Daniel Veillard
c4bad4a77c oops I was missing the xml:base fixup too this adds xml:base attributes to
* xinclude.c: oops I was missing the xml:base fixup too
* result/XInclude/*.xml: this adds xml:base attributes to most
  results of the tests
Daniel
2002-08-14 14:45:25 +00:00
Daniel Veillard
e3b7d9a165 quick but apparently working implementation of xi:fallback, should close
* xinclude.c: quick but apparently working implementation of
  xi:fallback, should close bug #89684
* Makefile.am test/XInclude/docs/fallback.xml
  result/XInclude/fallback.xml: added a basic test for fallback,
  and run with --nowarning to avoid a spurious warning
* configure.in: applied patch from Frederic Crozat for python
  bindings on AMD 64bits machines.
Daniel
2002-08-14 14:11:30 +00:00
Daniel Veillard
58e44c9daf adding a new API for Christian Glahn: xmlParseBalancedChunkMemoryRecover
* parser.c include/libxml/parser.h: adding a new API for Christian
  Glahn: xmlParseBalancedChunkMemoryRecover
* valid.c: patch from Rick Jones for some grammar cleanup in
  validation messages
* result/VC/* result/valid/*: this slightly change some of the
  regression tests outputs
Daniel
2002-08-02 22:19:49 +00:00
Daniel Veillard
34ce8bece2 preparing 2.4.18 updated and rebuilt the web site implement the new
* configure.in: preparing 2.4.18
* doc/*: updated and rebuilt the web site
* *.c libxml.h: implement the new IN_LIBXML scheme discussed with
  the Windows and Cygwin maintainers.
* parser.c: humm, changed the way the SAX parser work when
  xmlSubstituteEntitiesDefault(1) is set, it will then
  do the entity registration and loading by itself in case the
  user provided SAX getEntity() returns NULL.
* testSAX.c: added --noent to test the behaviour.
Daniel
2002-03-18 19:37:11 +00:00
Daniel Veillard
c5f05ada40 fix #68882, cleanup the XInclude copying of node, merge back IDs in the
* tree.c valid.c xinclude.c: fix #68882, cleanup the XInclude
  copying of node, merge back IDs in the target document.
* result/XInclude/docids.xml test/XInclude/docs/docids.xml
  test/XInclude/ents/ids.xml: test case
* result/VC/ElementValid4: output changed due to a typo fix
Daniel
2002-02-10 11:57:22 +00:00
Daniel Veillard
cbaf399537 applied 42 documentation patches from Charlie Bozeman. Regenerated the
* *.c include/libxml/*.h doc/html/*: applied 42 documentation
  patches from Charlie Bozeman. Regenerated the HTML docs.
Daniel
2001-12-31 16:16:02 +00:00
Daniel Veillard
3c01b1d81b - include/libxml/globals.h include/libxml/threads.h threads.c
testThreads.c: far more testing, cleaning up bugs
- *.c : make sure globals.h is always included.
Daniel
2001-10-17 15:58:35 +00:00
Daniel Veillard
c5d64345cf Summer's cleanup, a really big one:
* AUTHORS: added William and Bjorn
* include/libxml/*.h *.c README doc/*.html etc.: changed old email to
  daniel@veillard.com hopefully I won't have to do this again
* doc/Makefile.am doc/html/*.html: cleanup makefile, checked that
  docs can be rebuilt cleanly now
* include/libxml/xml*version.h*: removed include/libxml/xmlversion.h
  from CVs it's generated, added include/libxml/xmlwin32version.h
  also generated but which should change far less frequently.
* catalog.c nanoftp.c: made sure to include libxml.h not
  libxml/xmlversion.h directly
* include/libxml/*.h: include xmlwin32version.h instead of xmlversion.h
  when compiling on WIN32 and MSC
Daniel
2001-06-24 12:13:24 +00:00
Daniel Veillard
017b108fcf - Makefile.am: cleanup when --without-debug is specified
- xinclude.c xpath.c xpathInternals.h xpointer.c: cleanup
  w.r.t. --without-debug and other include points
- catalog.h testCatalog.c: a bit of cleanup and prepare for XML
  Catalogs
- configure.in entities.h tree.h HTMLparser.c: removed
  --without-corba, made the _private field mandatory
Daniel
2001-06-21 11:20:21 +00:00
Daniel Veillard
39196eba17 - tree.c xinclude.c xpointer.c: bug #56402 exposed a number of
weakness in the node copy the XPointer and the XInclude
  implementations. Serious cleanup.
Daniel
2001-06-19 18:09:42 +00:00
Daniel Veillard
4497e6984d - xinclude.c: Raphael Hertzog had a trouble with DTD nodes
being processed, applied his patch
- tree.c: fixed a bug raised in xmlStaticCopyNodeList()
Daniel
2001-06-09 14:19:02 +00:00
Daniel Veillard
d16df9f6ef - xinclude.c: fixed XInclude recursive behaviour bug #54678
- result/XInclude/recursive.xml test/XInclude/docs/recursive.xml
  test/XInclude/ents/inc.txt test/XInclude/ents/sub-inc.ent:
  added specific regression test
- parser.h: preparing for the XSLT mode where DTD inherited
  attributes are added to the tree.
Daniel
2001-05-23 13:44:21 +00:00
Daniel Veillard
bbd2245844 - xinclude.[ch]: Updated the namespace for the Last Call version
- result/XInclude/include test/XInclude/include: updated the
  testsuite accordingly
Daniel
2001-05-23 12:02:27 +00:00
Bjorn Reese
70a9da54eb trio upgrade and integration 2001-04-21 16:57:29 +00:00
Daniel Veillard
92ad210417 Spring cleanup ...: - configure.in Makefile.am config.h.in
Spring cleanup ...:
- configure.in Makefile.am config.h.in xmlversion.h.in: detect if
  we need string functions
- trio.[ch] strio.[ch]: embedded the Trio-0.23 string functions
  to be able to use them where needed. Applied some changes
  to reduce name linking pollution and compile in only what's
  needed.
- HTMLtree.c debugXML.c entities.c error.c nanoftp.c valid.c
  xlink.c xmlversion.h.in xpath.c: got rid of the #ifdef
  for the string manipulation functions
- xmlmemory.[ch]: removed DEBUG_MEMORY_FREED and added it automatically
  to the free() function of xmlmemory.c
- entities.c HTMLtree.c parserInternals.c tree.c uri.c valid.c
  xinclude.c xmlIO.c xpath.c xpointer.c: removed the MEM_CLEANUP
  usage.
Daniel
2001-03-27 12:47:33 +00:00
Daniel Veillard
56a4cb8c4d Huge cleanup, I switched to compile with
-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit
-Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat
-Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline
- HTMLparser.[ch] HTMLtree.c SAX.c debugXML.c encoding.[ch]
  encoding.h entities.c error.c list.[ch] nanoftp.c
  nanohttp.c parser.[ch] parserInternals.[ch] testHTML.c
  testSAX.c testURI.c testXPath.c tree.[ch] uri.c
  valid.[ch] xinclude.c xmlIO.[ch] xmllint.c xmlmemory.c
  xpath.c xpathInternals.h xpointer.[ch] example/gjobread.c:
  Cleanup, staticfied a number of non-exported functions,
  detected and cleaned up a dozen of problem found this way,
  avoided a lot of public function name/typedef/system names clashes
- doc/xml.html: updated
- configure.in: switched private flags to the really pedantic ones.
Daniel
2001-03-24 17:00:36 +00:00
Daniel Veillard
edac3c9084 - xinclude.c: fixed a problem building on Mac
Daniel
2001-02-26 01:36:19 +00:00
Daniel Veillard
48b2f8968e Okay time to improve performances, gprof session:
before  real 0m2.483s (2.3.2 release yesterday)
current real 0m1.763s
when parsing (with tree build/freeing) db10000.xml from XSLTMark:
- xmlmemory.h HTMLparser.c HTMLtree.c entities.c parser.c
  xpath.c xpointer.c tree.c uri.c valid.c xinclude.c xmlIO.c:
  avoiding memcpy in production builds MEM_CLEANUP macro use
- parser.[ch] parserInternals.c: optimizations of the tightest
  internal loops inside the parser. Better checking of I/O
  flushing/loading conditions
- xmllint.c : added --timing
Daniel
2001-02-25 16:11:03 +00:00
Owen Taylor
3473f88a7a Revert directory structure changes 2001-02-23 17:55:21 +00:00
CET 2001 Tomasz Koczko
64636e7f6e moved to libxml directory - this allow simplify automake/autoconf. Now
Thu Feb 23 02:03:56 CET 2001 Tomasz Koczko <kloczek@pld.org.pl>

        * *.c *.h libxml files: moved to libxml directory - this allow
	  simplify automake/autoconf. Now isn't neccessary hack on
	  am/ac level for make and remove libxml symlink (modified for this
	  also configure.in and main Makefile.am). Now automake abilities
	  are used in best way (like in many other projects with libraries).
	* include/win32config.h: moved to libxml directory (now include
	  directory isn't neccessary).
	* Makefile.am, examples/Makefile.am, libxml/Makefile.am:
	  added empty DEFS and in INCLUDES rest only -I$(top_builddir) -
	  this allow minimize parameters count passed to libtool script
	  (now compilation is also slyghtly more quiet).
	* configure.in: simplifies libzdetestion - prepare separated
	  variables for keep libz name and path to libz header files isn't
	  realy neccessary (if someone have libz installed in non standard
	  prefix path to header files ald library can be passed as:
	  $ CFALGS="-I</libz.h/path>" LDFLAGS="-L</libz/path>" ./configure
	* autogen.sh: check now for libxml/entities.h.

	After above building libxml pass correctly and also pass
	"make install DESTDIR=</install/prefix>" from tar ball generated by
	"make dist". Seems ac/am reorganization is finished. This changes
	not touches any other things on *.{c,h} files level.
2001-02-23 01:37:32 +00:00
Daniel Veillard
bf43275dd1 Bug fixes new Xinclude tests:
- nanoftp.c: fixed gcc 2.95 new warnings
- SAX.c: fixed a stupid bug
- tree.c: fixed a formatting problem when round-tripping
  from/to memory
- xinclude.c: chased memleak, fixed a base problem
- xpointer.c: added xmlXPtrBuildRangeNodeList(), finished ?
  xmlXPtrBuildNodeList()
- TODO: updated
- Makefile.am test/XInclude/docs test/XInclude/ents result/XInclude:
  adding a first small set of regression tests for XInclude
Daniel
2000-11-12 15:56:56 +00:00
Daniel Veillard
c2def84b48 Various patches and bug fixes, and XInclude progresses:
- nanohttp.[ch]: applied Wayne Davison patches to access
  the WWW-Authorization header.
- parser.c: Closed Bug#30847: Problems when switching encoding
  in short files by applying Simon Berg's patch.
- valid.c: fixed a validation problem
- hash.c parser.h parserInternals.h testHTML.c testSAX.c tree.h
  xmlerror.h xmlmemory.h xmlversion.h.in: applied a DLL patch from
  Wayne Davison
- xpointer.[ch]: added first version of xmlXPtrBuildNodeList()
  need to be extended to non full nodes selections.
- xinclude.c: starts to work decently
Daniel
2000-11-07 14:21:01 +00:00
Daniel Veillard
9e8bfae59a XInclude and other stuff while travelling. Contributed patches:
- tree.[ch] xinclude.[ch] xmllint.c configure.in valid.c
  debugXML.c xmlversion.h.in: Started adding XInclude support,
  this is a new xmllint option
- tree.c xpath.c: applied TOM patches for XPath
- xpointer.c: fixed a couple of errors.
- uri.c: added an escaping function needed for xinclude
- testXPath.c hash.c HTMLtree.c: minor cleanups raised by
  new warning from RH70 gcc's version
Daniel
2000-11-06 16:43:11 +00:00