xpath.c


Log

Author Commit Date CI Message
Nick Wellnhofer 3eaedba1 2015-07-11T14:27:34 Fix previous change to node sort order Commit ba58f23 broke comparison of nodes from different documents. Thanks to Olli Pottonen for the report.
Nick Wellnhofer ba58f23c 2015-03-08T16:44:11 Fix order of root nodes Make sure root nodes are sorted before other nodes.
Nick Wellnhofer f6aaabce 2015-03-08T16:05:26 Allow attributes on descendant-or-self axis If the context node is an attribute, the attribute itself is on the descendant-or-self axis. The principal node type of this axis is element, so the only node test that can return the attribute is "node()". In other words, "@attr/descendant-or-self::node()" is equivalent to "@attr". This matches the behavior of Saxon-CE.
Nick Wellnhofer 07def30f 2014-03-21T19:38:08 Restore context size and position after XPATH_OP_ARG Fixes a bug with predicates: https://mail.gnome.org/archives/xml/2014-March/msg00014.html
Jan Pokorný 75801652 2013-12-19T15:09:14 Fix typos in {tree,xpath}.c (errror) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Nick Wellnhofer 03c67230 2013-12-20T00:01:53 Handling of XPath function arguments in error case The XPath engine tries to guarantee that every XPath function can pop 'nargs' non-NULL values off the stack. libxslt, for example, relies on this assumption. But the check isn't thorough enough if there are errors during the evaluation of arguments. This can lead to segfaults: https://mail.gnome.org/archives/xslt/2013-December/msg00005.html This commit makes the handling of function arguments more robust. * Bail out early when evaluation of XPath function arguments fails. * Make sure that there are 'nargs' arguments in the current call frame.
Gaurav fcd45831 2013-11-28T23:01:44 Fix XPath node comparison bug For https://bugzilla.gnome.org/show_bug.cgi?id=715143
Nick Wellnhofer e8de99f9 2013-08-05T01:26:25 Fix XPath expressions of the form '@ns:*' Use namespace for match-all queries on the attribute axis.
Nick Wellnhofer b4bcba23 2013-08-05T00:15:11 Fix XPath '//' optimization with predicates My attempt to optimize XPath expressions containing '//' caused a regression reported in bug #695699. This commit disables the optimization for expressions of the form '//foo[predicate]'.
Denis Pauk e28c8a1a 2013-08-03T14:22:54 #705267 - add additional defines checks for support "./configure --with-minimum" https://bugzilla.gnome.org/show_bug.cgi?id=705267
Daniel Veillard b9e4d5b6 2013-07-22T13:21:31 Remove occasional leading space in XPath number formatting https://bugzilla.gnome.org/show_bug.cgi?id=704528 Somehow snprintf "%*.*e" can generate a leading space, remove it
Alex Bligh 28876afb 2013-03-23T17:23:27 Add xmlXPathSetContextNode and xmlXPathNodeEval This patch adds xmlXPathSetContextNode and xmlXPathNodeEval, which make it easier to evaluation XPath expressions with a context node other than the document root without poking about inside the internals of the context. This patch is compile-tested only, and is my first libxml2 contribution, so please go easy. Signed-off-by: Alex Bligh <alex@alex.org.uk>
Daniel Veillard 713434d2 2012-09-26T10:21:06 Silence a clang warning as reported by Hans Wennborg <hans@chromium.org>
Daniel Veillard 7651606f 2012-09-11T14:02:08 Various cleanups to avoid compiler warnings
Daniel Veillard f8e3db04 2012-09-11T13:26:36 Big space and tab cleanup Remove all space before tabs and space and tabs at end of lines.
Daniel Veillard 47881284 2012-09-07T14:24:50 Add a forbidden variable error number and message to XPath Related to https://bugzilla.gnome.org/show_bug.cgi?id=680938 When the XML_XPATH_NOVAR flags is being used it means that variables are forbidden, not that they are missing
Daniel Veillard 1bd45d13 2012-09-05T15:35:19 Change the XPath code to percolate allocation errors looping 1000 time on an error stating that a nodeset has grown out of control is useless, make sure we percolate error up to the various loops and break when errors occurs
Daniel Veillard 510e7583 2012-09-04T11:50:36 Fix a Timsort function helper comment
Vojtech Fried 3e031b7d 2012-08-24T16:52:44 Switching XPath node sorting to Timsort I use libxml xpath engine on quite large (and mostly "flat") xml files. It seems that Shellsort, that is used in xmlXPathNodeSetSort is a performance bottleneck for my case. I have read some posts about sorting in libxml in the libxml archive, but I agree that qsort was not the way to go. I experimented with Timsort instead and my results were good for me. For about 10000 nodes, my test was about 5x faster with Timsort, for 1000 nodes about 10% faster, for small data files, the difference was not measurable. * timsort.h: the algorithm, kept in a separate header * xpath.c: plug in the new algorithm in xmlXPathNodeSetSort * Makefile.am: add the header to the EXTRA_DIST * doc/apibuild.py: avoid indexing the new header
Nick Wellnhofer 62270539 2012-08-19T19:42:38 Optimizing '//' in XPath expressions When investigating the libxslt performance problem reported in bug #657665, I found that '//' in XPath expressions can be very slow when working on large subtrees. One of the reasons is the seemingly quadratic time complexity of the duplicate checks when merging result nodes. The other is a missed optimization for expressions of the form 'descendant-or-self::node()/axis::test'. Since '//' is expanded to '/descendant-or-self::node()/', this type of expression is quite common. Depending on the axis of the expression following the 'descendant-or-self' step, the following replacements can be made: from descendant-or-self::node()/child::test to descendant::test from descendant-or-self::node()/descendant::test to descendant::test from descendant-or-self::node()/self::test to descendant-or-self::test from descendant-or-self::node()/descendant-or-self::test to descendant-or-self::test 'test' can be any kind of node test. With these replacements the possibly huge result of 'descendant-or-self::node()' doesn't have to be stored temporarily, but can be processsed in one pass. If the resulting nodeset is small, the duplicate checks aren't a problem. I found that there already is a function called xmlXPathRewriteDOSExpression which performs this optimization for a very limited set of cases. It employs a complicated iteration scheme for rewritten expressions. AFAICS, this can be avoided by simply changing the axis of the expression like described above. With the attached patch against libxml2 and the files from bug #657665 I got the following results. Before: $ time xsltproc/xsltproc --noout service-names-port-numbers.xsl service-names-port-numbers.xml real 2m56.213s user 2m56.123s sys 0m0.080s After: $ time xsltproc/xsltproc --noout service-names-port-numbers.xsl service-names-port-numbers.xml real 0m3.836s user 0m3.764s sys 0m0.060s I also ran the libxml2 and libxslt test suites with the patch and couldn't detect any breakage. Nick >From e0f5a8261760e4f257b90410be27657e984237c8 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer <wellnhofer@aevum.de> Date: Sun, 19 Aug 2012 18:20:22 +0200 Subject: [PATCH] Optimizations for descendant-or-self::node() Currently, the function xmlXPathRewriteDOSExpression optimizes expressions of type '//child'. Instead of adding a 'rewriteType' and doing a compound traversal, the same can be achieved simply by setting the axis of the node test from 'child' to 'descendant'. There are also many other cases that can be optimized similarly. This commit augments xmlXPathRewriteDOSExpression to essentially rewrite the following subexpressions: - descendant-or-self::node()/child:: to descendant:: - descendant-or-self::node()/descendant:: to descendant:: - descendant-or-self::node()/self:: to descendant-or-self:: - descendant-or-self::node()/descendant-or-self:: to descendant-or-self:: Since the '//' shortcut in XPath is translated to '/descendant-or-self::node()/', this greatly speeds up expressions using '//' on large subtrees.
Daniel Veillard 3e62adbe 2012-08-09T14:24:02 Adding various checks on node type though the API Specifially checking against namespace nodes before accessing node pointers
Daniel Veillard cd852ad1 2012-07-30T10:12:18 Implement some default limits in the XPath module This adds some internal limitationson XPath expression complexity, and limits at runtime like depth of the stack and maximum size for nodeset. * xpath.c: implement the above as well as the maximum Name lenght
Daniel Veillard ade10f2c 2012-07-12T09:43:27 Convert XPath to xmlBuf Easy as no buffer was exported in the APIs
Daniel Veillard 1d4526f6 2011-10-11T16:34:34 Fix missing error status in XPath evaluation Started by Chris Evans, I added a few more place where the error should have been set in the evaluation context.
Daniel Veillard f5048b3e 2011-08-18T17:10:13 Hardening of XPath evaluation Add a mechanism of frame for XPath evaluation when entering a function or a scoped evaluation, also fix a potential problem in predicate evaluation.
Stefan Kost a1540403 2011-05-06T17:03:51 xpath: remove unused variable As noted by gcc, this variable is not beeing used.
Chris Evans d7958b21 2011-03-23T08:13:06 Fix some potential problems on reallocation failures The count was incremented before the allocation and not fixed in case of failure * xpath.c: corrects a few instances where the available count of some structure is updated before we know the allocation actually succeeds
Daniel Veillard fec31bcd 2010-11-18T11:07:24 Small fix for previous commit
Daniel Veillard df83c17e 2010-11-17T14:12:14 Fix a potential freeing error in XPath
Daniel Veillard 0cbeb50e 2010-11-15T12:06:29 Fix a potential memory access error in case of a previus allocation error
Phil Shafer ee32ad3c 2010-11-03T20:53:55 629325 XPath rounding errors first cleanup https://bugzilla.gnome.org/show_bug.cgi?id=629325 not a full solution as Vincent Lefevre pointed out but an incremental improvement over the status-quo
Daniel Veillard ea90b894 2010-10-22T15:50:50 Fix a change of semantic on XPath preceding and following axis This was introduced in the prevous fix, while preceding-sibling and following sibling axis are empty for attributes and namespaces, preceding and following axis should still work based on the parent element. However the parent element is not available for a namespace node, so we keep the axis empty in that case.
Daniel Veillard 2f3523f6 2010-10-15T18:30:29 Fix a leak in XPath compilation Sometimes a not well formed XPath expression could lead to a leak as reported by Ralf Junker <ralfjunker@gmx.de>
Daniel Veillard 91d19754 2010-10-15T14:30:52 Fix the semantic of XPath axis for namespace/attribute context nodes The processing of namespace and attributes nodes was not compliant to the XPath-1.0 specification
Marius Wachtler 2ddecc23 2010-10-12T09:09:07 Fix a small bug in XPath evaluation code
Martin 729601f1 2009-10-12T22:42:26 Fix memory leak in xmlXPathEvalExpression() * xpath.c: plug some leaks when parsing misformed XPath expressions * python/tests/xpathleak.py: expand the regression tests for those
Daniel Veillard 594e5dfb 2009-09-07T14:58:47 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)
Daniel Veillard 13cee4e3 2009-09-05T14:52:55 Fix a bunch of scan 'dead increments' and cleanup * HTMLparser.c c14n.c debugXML.c entities.c nanohttp.c parser.c testC14N.c uri.c xmlcatalog.c xmllint.c xmlregexp.c xpath.c: fix unused variables, or unneeded increments as well as a couple of space issues * runtest.c: check for NULL before calling unlink()
Daniel Veillard bccae2d2 2009-06-04T11:22:45 * c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string patch by Christian Persch, fixes #581612
Daniel Veillard 48b3eb22 2009-03-25T09:51:19 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
Daniel Veillard db3ce969 2009-03-25T09:43:49 xmlXPathRegisterNs should not allow enpty prefixes daniel * xpath.c: xmlXPathRegisterNs should not allow enpty prefixes daniel svn path=/trunk/; revision=3821
Daniel Veillard f63085de 2009-01-18T20:53:59 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
Daniel Veillard 074f37e7 2008-09-01T13:38:22 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
Daniel Veillard 45490aeb 2008-07-29T09:13:19 space and tabs cleanup Daniel * xpath.c: space and tabs cleanup Daniel svn path=/trunk/; revision=3756
Daniel Veillard f88d849a 2008-04-01T08:00:31 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
William M. Brack f179456d 2007-08-23T12:58:13 fixed mlXPathCompOpEvalPositionalPredicate problem with object caching * xpath.c: fixed mlXPathCompOpEvalPositionalPredicate problem with object caching (bug #469410) svn path=/trunk/; revision=3653
William M. Brack 31700e63 2007-06-13T20:33:02 fixed problem in previous fix to xmlXPathNodeSetSort * xpath.c: fixed problem in previous fix to xmlXPathNodeSetSort svn path=/trunk/; revision=3640
William M. Brack 97ac819c 2007-06-06T17:19:24 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
William M. Brack d611c88a 2007-05-31T05:07:17 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
William M. Brack d2f682a4 2007-05-15T19:42:08 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
William M. Brack ca79788e 2007-05-11T14:45:53 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
William M. Brack ee0b982f 2007-03-07T08:15:01 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
William M. Brack 0bcec06d 2007-02-14T02:15:19 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
William M. Brack 11be2d02 2007-01-24T19:17:19 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
Daniel Veillard fe3970e0 2006-11-23T16:08:30 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
Daniel Veillard 17970a72 2006-10-26T08:55:47 William spotted an obvious bug Daniel * xpath.c: William spotted an obvious bug Daniel
Daniel Veillard c465ffc2 2006-10-17T19:39:33 applied patch from Olaf Walkowiak which should fix #334104 Daniel * xpath.c: applied patch from Olaf Walkowiak which should fix #334104 Daniel
Kasimier T. Buchcik 50128ad7 2006-08-15T13:04:07 Applied the proposed fix for the documentation of xmlXPathCastToString(); * xpath.c: Applied the proposed fix for the documentation of xmlXPathCastToString(); see bug #346202.
Kasimier T. Buchcik 889b7622 2006-07-03T11:44:13 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.
Kasimier T. Buchcik 2bdb12ff 2006-06-29T10:49:59 Fixed a double-free in xmlXPathCompOpEvalToBoolean(), revealed by a * xpath.c: Fixed a double-free in xmlXPathCompOpEvalToBoolean(), revealed by a Libxslt regression test.
Kasimier T. Buchcik 324c75b3 2006-06-29T10:31:35 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">.
Kasimier T. Buchcik 8af1f0bb 2006-06-28T17:13:19 Fix a memory leak which occurred when using * xpath.c: Fix a memory leak which occurred when using xmlXPathCompiledEvalToBoolean().
Kasimier T. Buchcik 631ea817 2006-06-26T16:47:25 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.
Kasimier T. Buchcik 6422d916 2006-06-26T14:31:53 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.
Kasimier T. Buchcik 766ed7e1 2006-06-23T16:32:41 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.
Kasimier T. Buchcik 9bca933a 2006-06-19T10:26:42 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]".
Kasimier T. Buchcik 7cb3fa9d 2006-06-06T15:27:46 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.
Kasimier T. Buchcik 080152c9 2006-06-06T09:42:15 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().
Kasimier T. Buchcik c42e9f64 2006-06-02T20:48:50 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.
Aleksey Sanin 1b2be101 2006-05-31T20:53:43 fixed memory leak in xpath error reporting * xpath.c: fixed memory leak in xpath error reporting
Kasimier T. Buchcik 5869469f 2006-05-31T12:37:28 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.
Kasimier T. Buchcik df0ba264 2006-05-30T19:45:37 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.
Kasimier T. Buchcik 75af2a87 2006-05-30T09:29:23 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.
Kasimier T. Buchcik a7248443 2006-05-29T16:15:36 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.
Kasimier T. Buchcik 984a9aed 2006-05-24T09:02:35 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.
Kasimier T. Buchcik 5691f436 2006-05-22T15:19:55 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().
Kasimier T. Buchcik 64f7e1a8 2006-05-19T19:59:54 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.
Kasimier T. Buchcik 2bdabbd7 2006-05-19T11:26:15 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.
Kasimier T. Buchcik 6ed2eb47 2006-05-16T15:13:37 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.
Daniel Veillard aac7c68e 2006-03-10T13:40:16 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
Daniel Veillard 11ce4004 2006-03-10T00:36:23 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
Daniel Veillard d3ff7ef6 2006-02-27T19:43:17 workaround HP-UX compiler bug by Rick Jones Daniel * xpath.c: workaround HP-UX compiler bug by Rick Jones Daniel
Kasimier T. Buchcik 97258713 2006-01-05T12:30:43 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.
Daniel Veillard b3d1491b 2005-09-04T20:47:39 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
Daniel Veillard f03a8cda 2005-09-04T12:01:57 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
Daniel Veillard 8bda20f7 2005-08-24T09:36:47 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
Daniel Veillard 24505b0f 2005-07-28T23:49:35 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
Daniel Veillard ed6c5497 2005-07-23T15:00:22 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
William M. Brack 32f0f717 2005-07-14T07:00:33 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).
Daniel Veillard 1f33c4d6 2005-07-10T21:38:31 preparing to make testsuite releases along with code source releases fixed * xstc/Makefile.am README README.tests Makefile.tests Makefile.am: preparing to make testsuite releases along with code source releases * gentest.py testapi.c: fixed a couple of problem introduced by the new Schemas support for Readers * xpath.c: fixed the XPath attribute:: bug #309580, #309864 in a crude but simple way. * xmlschemas.c include/libxml/tree.h: fixed a couple of problems raised by the doc builder. * doc/*: made rebuild Daniel
William M. Brack ea152c05 2005-06-09T18:12:28 Further enhancement for XPath streaming, consolidated with schemas usage * pattern.c, xpath.c, include/libxml/pattern.h: Further enhancement for XPath streaming, consolidated with schemas usage of pattern.c. Added a new enum xmlPatternFlags. * doc/*, testapi.c, elfgcchack.h: updated to reflect new enum. * test/XPath/tests/mixedpat, test/XPath/docs/mixed, result/XPath/mixedpat: added regression test for problems reported in bug306348
William M. Brack fbb619f4 2005-06-06T13:49:18 Enhanced xmlXPathRunStreamEval, fixed handling of depth/level for cases * xpath.c, pattern.c: Enhanced xmlXPathRunStreamEval, fixed handling of depth/level for cases like union operator (bug #306348 reported by Bob Stayton). Also enhanced several comments throughout pattern.c. * doc/apibuild.py: fixed problem in handling of 'signed' declaration. Rebuilt the docs.
Daniel Veillard dbfe05af 2005-05-04T09:18:00 on linux/gcc use weak definitions to avoid linking with pthread library on * Makefile.am configure.in threads.c: on linux/gcc use weak definitions to avoid linking with pthread library on non-threaded environments. * xpath.c: applied patch from Mark Vakoc w.r.t. a buggy namespace list allocation. Daniel
William M. Brack 3d426663 2005-04-19T14:40:28 Added some code to avoid integer overflow for ceil, floor and round * xpath.c: Added some code to avoid integer overflow for ceil, floor and round functions (bug 301162)
William M. Brack d6e347e8 2005-04-15T01:34:41 Applied Daniel's fix for memory leak in dtd prefix (bug 300550). minor * valid.c: Applied Daniel's fix for memory leak in dtd prefix (bug 300550). * xpath.c: minor change to comment only
William M. Brack 2c19a7bf 2005-04-10T01:03:23 fixed several places where memory cleanup was not properly done after an * xpath.c: fixed several places where memory cleanup was not properly done after an error was detected (problem was reported on the mailing list by Pawel Palucha)
Daniel Veillard 4ddaa56d 2005-04-06T14:09:08 fixed the bug in lang() as raised by Elliotte Rusty Harold added a * xpath.c: fixed the bug in lang() as raised by Elliotte Rusty Harold * result/XPath/tests/langsimple test/XPath/tests/langsimple test/XPath/docs/lang: added a regression test Daniel
Daniel Veillard 5d4644ef 2005-04-01T13:11:58 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
William M. Brack 12d37ab6 2005-02-21T13:54:07 fixed problem when XMLLINT_INDENT was empty (bug 168033). fixed * xmlsave.c: fixed problem when XMLLINT_INDENT was empty (bug 168033). * xpath.c: fixed compilation warning, no change to logic. * xmlschemastypes.c: fixed compilation warning, no change to logic.
Daniel Veillard fa1f77f2 2005-02-21T10:44:36 fixed remaining known bugs in the XPath streaming, and switched XPath to * pattern.c xpath.c: fixed remaining known bugs in the XPath streaming, and switched XPath to use it by default when possible Daniel