1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00
Commit Graph

342 Commits

Author SHA1 Message Date
Daniel Veillard
48b3eb22c2 fixes for Borland/CodeGear/Embarcadero compilers by Eric Zurcher Daniel
* include/wsockcompat.h win32/Makefile.bcb xpath.c: fixes for
  Borland/CodeGear/Embarcadero compilers by Eric Zurcher
Daniel

svn path=/trunk/; revision=3822
2009-03-25 09:51:19 +00:00
Daniel Veillard
db3ce96906 xmlXPathRegisterNs should not allow enpty prefixes daniel
* xpath.c: xmlXPathRegisterNs should not allow enpty prefixes
daniel

svn path=/trunk/; revision=3821
2009-03-25 09:43:49 +00:00
Daniel Veillard
f63085de5e port patch from Marcus Meissner to add gcc checking for printf like
* include/libxml/parser.h include/libxml/xmlwriter.h
  include/libxml/relaxng.h include/libxml/xmlversion.h.in
  include/libxml/xmlwin32version.h.in include/libxml/valid.h
  include/libxml/xmlschemas.h include/libxml/xmlerror.h:
  port patch from Marcus Meissner to add gcc checking for
  printf like functions parameters, should fix #65068
* doc/apibuild.py doc/*: modified the script accordingly
  and regenerated
* xpath.c xmlmemory.c threads.c: fix a few warnings
Daniel

svn path=/trunk/; revision=3813
2009-01-18 20:53:59 +00:00
Daniel Veillard
074f37e7eb applied a couple of patches from Martin avoiding some leaks, fixinq QName
* schematron.c xpath.c: applied a couple of patches from Martin
  avoiding some leaks, fixinq QName checks in XPath, XPath debugging
  and schematron code cleanups.
* python/tests/Makefile.am python/tests/xpathleak.py: add the
  specific regression tests, just tweak it to avoid output by default
Daniel

svn path=/trunk/; revision=3791
2008-09-01 13:38:22 +00:00
Daniel Veillard
45490aebe7 space and tabs cleanup Daniel
* xpath.c: space and tabs cleanup
Daniel

svn path=/trunk/; revision=3756
2008-07-29 09:13:19 +00:00
Daniel Veillard
f88d849a4e two patches from Alvaro Herrera to avoid problem when running out of
* xpath.c: two patches from Alvaro Herrera to avoid problem when
  running out of memory in XPath evaluations.
Daniel

svn path=/trunk/; revision=3721
2008-04-01 08:00:31 +00:00
William M. Brack
f179456d0f fixed mlXPathCompOpEvalPositionalPredicate problem with object caching
* xpath.c: fixed mlXPathCompOpEvalPositionalPredicate problem
  with object caching (bug #469410)

svn path=/trunk/; revision=3653
2007-08-23 12:58:13 +00:00
William M. Brack
31700e6306 fixed problem in previous fix to xmlXPathNodeSetSort
* xpath.c: fixed problem in previous fix to xmlXPathNodeSetSort

svn path=/trunk/; revision=3640
2007-06-13 20:33:02 +00:00
William M. Brack
97ac819cc6 fixed problem with xmlXPathNodeSetSort; fixed problem with
* xpath.c: fixed problem with xmlXPathNodeSetSort;
  fixed problem with xmlXPathNodeTrailingSorted (both bug#413451)

svn path=/trunk/; revision=3622
2007-06-06 17:19:24 +00:00
William M. Brack
d611c88a01 fixed problem with string value for PI node (bug #442275)
* xpath.c: fixed problem with string value for PI node
  (bug #442275)

svn path=/trunk/; revision=3621
2007-05-31 05:07:17 +00:00
William M. Brack
d2f682a495 fixed problem on gzip streams (bug #438045) fixed minor spot of redundant
* nanohttp.c: fixed problem on gzip streams (bug #438045)
* xpath.c: fixed minor spot of redundant code - no logic change.

svn path=/trunk/; revision=3616
2007-05-15 19:42:08 +00:00
William M. Brack
ca79788eaa enhanced the coding for xmlXPathCastNumberToString in order to produce the
* xpath.c: enhanced the coding for xmlXPathCastNumberToString
  in order to produce the required number of significant digits
  (bug #437179)

svn path=/trunk/; revision=3615
2007-05-11 14:45:53 +00:00
William M. Brack
ee0b982fe8 fixed xmlXPathCmpNodes for incorrect result on certain cases when
* xpath.c: fixed xmlXPathCmpNodes for incorrect result on certain
  cases when comparing identical nodes (bug 415567) with patch
  from Oleg Paraschenko

svn path=/trunk/; revision=3587
2007-03-07 08:15:01 +00:00
William M. Brack
0bcec06d4c Fixed memory bug with invalid function reported by Francois Delyon on
* xpath.c: Fixed memory bug with invalid function reported by Francois Delyon on mailing list

svn path=/trunk/; revision=3584
2007-02-14 02:15:19 +00:00
William M. Brack
11be2d02b0 added checks for alloc fail on calls to xmlXPathNewContext (libxslt bug
* xpath.c: added checks for alloc fail on calls to xmlXPathNewContext
  (libxslt bug #400242)

svn path=/trunk/; revision=3575
2007-01-24 19:17:19 +00:00
Daniel Veillard
fe3970e09f fixed a bug where the principal node type of an axis wasn't tested on name
* xpath.c: fixed a bug where the principal node type of an axis
  wasn't tested on name check, fixes bug #377432
daniel
2006-11-23 16:08:30 +00:00
Daniel Veillard
17970a72ca William spotted an obvious bug Daniel
* xpath.c: William spotted an obvious bug
Daniel
2006-10-26 08:55:47 +00:00
Daniel Veillard
c465ffc20c applied patch from Olaf Walkowiak which should fix #334104 Daniel
* xpath.c: applied patch from Olaf Walkowiak which should fix #334104
Daniel
2006-10-17 19:39:33 +00:00
Kasimier T. Buchcik
50128ad7cc Applied the proposed fix for the documentation of xmlXPathCastToString();
* xpath.c: Applied the proposed fix for the documentation
  of xmlXPathCastToString(); see bug #346202.
2006-08-15 13:04:07 +00:00
Kasimier T. Buchcik
889b76229b Changed xmlXPathCollectAndTest() to use xmlXPathNodeSetAddNs() when adding
* xpath.c: Changed xmlXPathCollectAndTest() to use
  xmlXPathNodeSetAddNs() when adding a ns-node in case of
  NODE_TEST_TYPE (the ns-node was previously added plainly
  to the list). Since for NODE_TEST_ALL and NODE_TEST_NAME
  this specialized ns-addition function was already used,
  I assume it was missed to be used with NODE_TEST_TYPE.
2006-07-03 11:44:13 +00:00
Kasimier T. Buchcik
2bdb12ff9f Fixed a double-free in xmlXPathCompOpEvalToBoolean(), revealed by a
* xpath.c: Fixed a double-free in xmlXPathCompOpEvalToBoolean(),
  revealed by a Libxslt regression test.
2006-06-29 10:49:59 +00:00
Kasimier T. Buchcik
324c75b3c3 Enhanced xmlXPathCompOpEvalToBoolean() to be also usable outside predicate
* xpath.c: Enhanced xmlXPathCompOpEvalToBoolean() to be also
  usable outside predicate evaluation; the intention is to
  use it via xmlXPathCompiledEvalToBoolean() for XSLT tests,
  like in <xsl:if test="/foo">.
2006-06-29 10:31:35 +00:00
Kasimier T. Buchcik
8af1f0bb83 Fix a memory leak which occurred when using
* xpath.c: Fix a memory leak which occurred when using
  xmlXPathCompiledEvalToBoolean().
2006-06-28 17:13:19 +00:00
Kasimier T. Buchcik
631ea8176a Added xmlXPathCompiledEvalToBoolean() to the API and adjusted/added
* xpath.c: Added xmlXPathCompiledEvalToBoolean() to the API and
  adjusted/added xmlXPathRunEval(), xmlXPathRunStreamEval(),
  xmlXPathCompOpEvalToBoolean(), xmlXPathNodeCollectAndTest()
  to be aware of a boolean result request. The new function
  is now used to evaluate predicates.
2006-06-26 16:47:25 +00:00
Kasimier T. Buchcik
6422d916d9 Fixed an bug in xmlXPathCompExprAdd(): the newly introduced field
* xpath.c: Fixed an bug in xmlXPathCompExprAdd(): the newly
  introduced field @rewriteType on xmlXPathStepOp was not
  initialized to zero here; this could lead to the activation
  of the axis rewrite code in xmlXPathNodeCollectAndTest() when
  @rewriteType is randomly set to the value 1. A test
  (hardcoding the intial value to 1) revealed that the
  resulting incorrect behaviour is similar to the behaviour
  as described by Arnold Hendriks on the mailing list; so I
  hope that will fix the issue.
2006-06-26 14:31:53 +00:00
Kasimier T. Buchcik
766ed7e1e5 Fixed an error in xmlXPathEvalExpr(), which was introduced with the
* xpath.c: Fixed an error in xmlXPathEvalExpr(), which
  was introduced with the addition of the d-o-s rewrite
  and made xpath.c unable to compile if XPATH_STREAMING
  was not defined (reported by Kupriyanov Anatolij -
  #345752). Fixed the check for d-o-s rewrite
  to work on the correct XPath string, which is ctxt->base
  and not comp->expr in this case.
2006-06-23 16:32:41 +00:00
Kasimier T. Buchcik
9bca933a6e Added optimization for positional predicates (only short-hand form "[n]"),
* xpath.c: Added optimization for positional predicates
  (only short-hand form "[n]"), which have a preceding
  predicate: "/foo[descendant::bar][3]".
2006-06-19 10:26:42 +00:00
Kasimier T. Buchcik
7cb3fa9d51 Fixed self-invented a segfault in xmlXPathCtxtCompile(), when the
* xpath.c: Fixed self-invented a segfault in xmlXPathCtxtCompile(),
  when the expression was not valid and @comp was NULL and I
  tried to do the d-o-s rewrite.
2006-06-06 15:27:46 +00:00
Kasimier T. Buchcik
080152c901 Enabled the compound traversal again; I added a check to use this only if
* xpath.c: Enabled the compound traversal again; I added a
  check to use this only if the have an expression starting
  with the document node; so in the case of "//foo", we
  already know at compilation-time, that there will be only
  1 initial context node. Added the rewrite also to
  xmlXPathEvalExpr().
2006-06-06 09:42:15 +00:00
Kasimier T. Buchcik
c42e9f6409 Disabled the compound traversal for the release; I need first to assure
* xpath.c: Disabled the compound traversal for the release;
  I need first to assure that this is done only if we have
  1 initial node.
2006-06-02 20:48:50 +00:00
Aleksey Sanin
1b2be101e8 fixed memory leak in xpath error reporting
* xpath.c: fixed memory leak in xpath error reporting
2006-05-31 20:53:43 +00:00
Kasimier T. Buchcik
5869469f42 Changed the name of the recently added public function
* xpath.c include/libxml/xpath.h runsuite.c:
  Changed the name of the recently added public function
  xmlXPathContextSetObjectCache() to
  xmlXPathContextSetCache(); so a more generic one, in
  case we decide to cache more things than only XPath
  objects.
2006-05-31 12:37:28 +00:00
Kasimier T. Buchcik
df0ba26409 Optimized xmlXPathNodeCollectAndTest() and xmlXPathNodeCollectAndTestNth()
* xpath.c: Optimized xmlXPathNodeCollectAndTest() and
  xmlXPathNodeCollectAndTestNth() to evaluate a compound
  traversal of 2 axes when we have a "//foo" expression.
  This is done with a rewrite of the XPath AST in
  xmlXPathRewriteDOSExpression(); I added an additional field
  to xmlXPathStepOp for this (but the field's name should be
  changed). The mechanism: the embracing descendant-or-self
  axis traversal (also optimized to return only nodes which
  can hold elements), will produce context nodes for the
  inner traversal of the child axis. This way we avoid a full
  node-collecting traversal of the descendant-or-self axis.
  Some tests indicate that this can reduce execution time of
  "//foo" to 50%. Together with the XPath object cache this
  all significantly speeds up libxslt.
2006-05-30 19:45:37 +00:00
Kasimier T. Buchcik
75af2a87e5 Enhanced xmlXPathNodeCollectAndTest() to avoid recreation (if possible) of
* xpath.c: Enhanced xmlXPathNodeCollectAndTest() to avoid
  recreation (if possible) of the node-set which is used to
  collect the nodes in the current axis for the currect context
  node. Especially for "//foo" this will decrease dramatically
  the number of created node-sets, since for each node in the
  result node-set of the evaluation of descendant-or-self::node()
  a new temporary node-set was created. Added node iterator
  xmlXPathNextChildElement() as a tiny optimization for
  child::foo.
2006-05-30 09:29:23 +00:00
Kasimier T. Buchcik
a72484438f Added an XPath object cache. It sits on an xmlXPathContext and need to be
* xpath.c include/libxml/xpath.h: Added an XPath object cache.
  It sits on an xmlXPathContext and need to be explicitely
  activated (or deactivated again) with
  xmlXPathContextSetObjectCache(). The cache consists of 5
  lists for node-set, string, number, boolean and misc XPath
  objects. Internally the xpath.c module will use object-
  deposition and -acquisition functions which will try to reuse
  as many XPath objects as possible, and fallback to normal
  free/create behaviour if no cache is available or if the cache
  is full.
* runsuite.c: Adjusted to deactivate the cache for XML Schema
  tests if a cache-creation is turned on by default for the whole
  library, e.g. for testing purposes of the cache. It is
  deactivated here in order to avoid confusion of the memory leak
  detection in runsuite.c.
2006-05-29 16:15:36 +00:00
Kasimier T. Buchcik
984a9aeddf Removed a memcpy if xmlXPathNodeSetMerge(); it seems we really need to
* xpath.c: Removed a memcpy if xmlXPathNodeSetMerge(); it
  seems we really need to walk the whole list, since those
  nastly namespace nodes need to be added with
  xmlXPathNodeSetDupNs(); thus a pure memcpy is not possible.
  A flag on the node-set indicating if namespace nodes are in
  the set would help here; this is the 3rd flag which would
  be usefull with node-sets. The current flags I have in mind:
  1) Is a node-set already sorted?
     This would allow for rebust and optimizable sorting
     behaviour.
  2) Of what type are the nodes in the set (or of mixed type)?
     This would allow for faster merging of node-sets.
  3) Are namespace nodes in the set?
     This would allow to skipp all the namespace node specific
     special handling. Faster node-set merging if the first
     set is empty; just memcpy the set.
2006-05-24 09:02:35 +00:00
Kasimier T. Buchcik
5691f436d9 Optimization of count(): eliminated sorting (see bug #165547).
* xpath.c: Optimization of count(): eliminated sorting
  (see bug #165547). Optimization of XPATH_OP_FILTER if the
  predicate is a [1] (disable with XP_OPTIMIZED_FILTER_FIRST if
  it produces trouble). Tiny opt in xmlXPathNodeSetMerge().
2006-05-22 15:19:55 +00:00
Kasimier T. Buchcik
64f7e1a85f Substituted all remaining calls to xmlXPathCmpNodes() for
* xpath.c: Substituted all remaining calls to xmlXPathCmpNodes()
  for xmlXPathCmpNodesExt(). Tiny further enhancement of
  xmlXPathCmpNodesExt(). Added additional checks in various code
  parts to avoid calling sorting or merging functions if the
  node-set(s) don't need them; i.e., if they are empty or contain
  just one node.
2006-05-19 19:59:54 +00:00
Kasimier T. Buchcik
2bdabbd711 Optimized the comparison for non-element nodes in xmlXPathCmpNodesExt();
* xpath.c: Optimized the comparison for non-element nodes
  in xmlXPathCmpNodesExt(); the comparison is used for sorting
  of node-sets. This enhancement is related to bug #165547.
  There are other places where the old comparison function
  xmlXPathCmpNodes() is still called, but I currently don't
  know exactly what those calls are for; thus if they can be
  substituted (if it makes sense) for the new function.
2006-05-19 11:26:15 +00:00
Kasimier T. Buchcik
6ed2eb47fc Applied patch from Rob Richards, fixing a potential memory leak in
* xpath.c: Applied patch from Rob Richards, fixing a potential
  memory leak in xmlXPathTryStreamCompile(), when a list of
  namespaces was assigned to the XPath compilation context;
  here a new namespace list was created and passed to
  xmlPatterncompile(); but this list was not freed afterwards.
  Additionally we avoid now in xmlXPathTryStreamCompile() to
  compile the expression, if it has a colon - indicating
  prefixed name tests - and no namespace list was given. The
  streaming XPath mechanism needs a namespace list at
  compilation time (unlike normal XPath, where we can bind
  namespace names to prefixes at execution time).
* pattern.c: Enhanced to use a string dict for local-names,
  ns-prefixes and and namespace-names.
  Fixed xmlStreamPushInternal() not to use string-pointer
  comparison if a dict is available; this won't work, since
  one does not know it the given strings originate from the
  same dict - and they normally don't do, since e.g.
  namespaces are hold on xmlNs->href. I think this would be
  worth an investigation: if we can add a @doc field to xmlNs
  and put the @href in to a additionan namespace dict hold
  in xmlDoc. Daniel will surely not like this idea :-) But
  evaluation of tons of elements/attributes in namespaces
  with xmlStrEqual() isn't the way we should go forever.
2006-05-16 15:13:37 +00:00
Daniel Veillard
aac7c68e87 fix a few warning raised by gcc-4.1 and latests changes Daniel
* c14n.c encoding.c xmlschemas.c xpath.c xpointer.c: fix a few
  warning raised by gcc-4.1 and latests changes
Daniel
2006-03-10 13:40:16 +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
d3ff7ef6d3 workaround HP-UX compiler bug by Rick Jones Daniel
* xpath.c: workaround HP-UX compiler bug by Rick Jones
Daniel
2006-02-27 19:43:17 +00:00
Kasimier T. Buchcik
97258713d3 Fixed bug #322928, reported by Erich Schubert: The bug was in pattern.c,
* pattern.c xpath.c include/libxml/pattern.h:
  Fixed bug #322928, reported by Erich Schubert: The bug was
  in pattern.c, which is used for a tiny subset of xpath
  expression which can be evaluated in an optimized way.
  The doc-node was never considered when evaluating "//"
  expressions. Additionally, we fixed resolution
  to nodes of any type in pattern.c; i.e. a "//." didn't work
  yet, as it did select only element-nodes. Due to this
  issue the pushing of nodes in xpath.c needed to be adjusted
  as well.
2006-01-05 12:30:43 +00:00
Daniel Veillard
b3d1491b69 prepare for release work for #303289, fix a formatting bug for MIN_INT
* configure.in doc/* configure.in: prepare for release
* xpath.c: work for #303289, fix a formatting bug for MIN_INT
Daniel
2005-09-04 20:47:39 +00:00
Daniel Veillard
f03a8cdacd fixing yet another pattern induced XPath bug #314282 reverted back last
* pattern.c xpath.c include/libxml/pattern.h: fixing yet another
  pattern induced XPath bug #314282
* relaxng.c: reverted back last change it was seriously broken
Daniel
2005-09-04 12:01:57 +00:00
Daniel Veillard
8bda20f73c removed a potentially uninitialized variable error fixed a deprecation
* xpath.c: removed a potentially uninitialized variable error
* python/generator.py: fixed a deprecation warning
* python/tests/tstLastError.py: silent the damn test when Okay !
Daniel
2005-08-24 09:36:47 +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
Daniel Veillard
ed6c54971f changed xmlPatterncompile signature to pass an int and not an enum since
* pattern.c include/libxml/pattern.h: changed xmlPatterncompile
  signature to pass an int and not an enum since it can generate
  ABI compat troubles.
* include/libxml/schematron.h schematron.c: adding the new
  schematron code, work in progress lots to be left and needing
  testing
* include/libxml/xmlversion.h.in include/libxml/xmlwin32version.h.in
  Makefile.am configure.in: integration of schematron into the
  build
* xpath.c include/libxml/xpath.h: adding flags to control compilation
  options right now just XML_XPATH_CHECKNS.
Daniel
2005-07-23 15:00:22 +00:00
William M. Brack
32f0f717d1 Changed the behaviour of xmlXPathEqualNodeSetFloat to return TRUE if a
* xpath.c: Changed the behaviour of xmlXPathEqualNodeSetFloat to
  return TRUE if a nodeset with a numeric value of NaN is compared
  for inequality with any numeric value (bug 309914).
2005-07-14 07:00:33 +00:00