1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-11 12:58:16 +03:00

3356 Commits

Author SHA1 Message Date
Daniel Veillard
6f9b0878c0 applied patch from Marton Illes to fix an allocation bug in
* xmlschemas.c: applied patch from Marton Illes to fix an allocation
  bug in xmlSchemaXPathEvaluate should close #351032
Daniel
2006-08-12 14:09:01 +00:00
Daniel Veillard
1131e116a0 applied patch from Bertrand Fritsch to fix a bug in
* xmlschemas.c: applied patch from Bertrand Fritsch to fix a bug in
  xmlSchemaClearValidCtxt
Daniel
2006-08-07 11:02:54 +00:00
Daniel Veillard
ddefe9cccf fixed the conversion of long parameters Daniel
* python/generator.py: fixed the conversion of long parameters
Daniel
2006-08-04 12:44:24 +00:00
Kasimier T. Buchcik
7b4e2e20fd Removed the automatic generation of CDATA sections for the content of the
* xmlsave.c: Removed the automatic generation of CDATA sections
  for the content of the "script" and "style" elements when
  serializing XHTML. The issue was reported by Vincent Lefevre,
  bug #345147.
* result/xhtml1 result/noent/xhtml1: Adjusted regression test
  results due to the serialization change described above.
2006-07-13 13:07:11 +00:00
Daniel Veillard
75acfeea32 applied patch from Andrew W. Nosenko to expose if zlib support was
* configure.in parser.c xmllint.c include/libxml/parser.h
  include/libxml/xmlversion.h.in: applied patch from Andrew W. Nosenko
  to expose if zlib support was compiled in, in the header, in the
  feature API and in the xmllint --version output.
Daniel
2006-07-13 06:29:56 +00:00
Daniel Veillard
77aad34c94 refactor to use normal warnings for entities problem and not straight SAX
* SAX2.c: refactor to use normal warnings for entities problem
  and not straight SAX callbacks.
Daniel
2006-07-13 06:21:09 +00:00
Kasimier T. Buchcik
f896d44aac Fixed bug #347316, reported by David Belius: The simple type, which was
* xmlschemas.c: Fixed bug #347316, reported by David Belius:
  The simple type, which was the content type definition
  of a complex type, which in turn was the base type of a
  extending complex type, was missed to be set on this
  extending complex type in the derivation machinery.
2006-07-12 15:18:08 +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
Daniel Veillard
065abe8565 applied const'ification of strings patch from Matthias Clasen Daniel
* HTMLparser.c: applied const'ification of strings patch from
  Matthias Clasen
Daniel
2006-07-03 08:55:04 +00:00
Daniel Veillard
a8b5413a5f patch from Andrew W. Nosenko, xmlFreeRMutex forgot to destroy the
* threads.c: patch from Andrew W. Nosenko, xmlFreeRMutex forgot to
  destroy the condition associated to the mutex.
Daniel
2006-06-29 11:50:18 +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
William M. Brack
40cca61fc1 Added code submitted by Andreas Pakulat to provide node equality,
* python/libxml.c, python/libxml.py, python/tests/compareNodes.py,
  python/tests/Makefile.am:
  Added code submitted by Andreas Pakulat to provide node
  equality, inequality and hash functions, plus a single
  test program to check the functions (bugs 345779 + 345961).
2006-06-26 18:25:40 +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
Daniel Veillard
dbcbbd2657 try to fix the crash raised by the parser in recover mode as pointed by
* parser.c: try to fix the crash raised by the parser in
  recover mode as pointed by Ryan Phillips
Daniel
2006-06-18 19:55:20 +00:00
Daniel Veillard
a4bd369232 patch from Nic Ferrier to provide a better type mapping from XPath to
* python/types.c: patch from Nic Ferrier to provide a better type
  mapping from XPath to python
Daniel
2006-06-18 17:40:53 +00:00
Daniel Veillard
381ff364dc applied patch from Boz for VMS and reporting Schemas errors. Daniel
* runtest.c: applied patch from Boz for VMS and reporting
  Schemas errors.
Daniel
2006-06-18 17:31:31 +00:00
Daniel Veillard
cc047b3384 applied patch from Felipe Contreras when compiling with --with-minimum
* testapi.c: applied patch from Felipe Contreras when compiling
  with --with-minimum
Daniel
2006-06-18 17:20:33 +00:00
Kasimier T. Buchcik
978039bbd8 Fixed a bug in xmlDOMWrapAdoptNode(); the tree traversal stopped if the
* tree.c include/libxml/tree.h: Fixed a bug in
  xmlDOMWrapAdoptNode(); the tree traversal stopped if the
  very first given node had an attribute node :-( This was due
  to a missed check in the traversal mechanism.
  Expanded the xmlDOMWrapCtxt: it now holds the namespace map
  used in xmlDOMWrapAdoptNode() and xmlDOMWrapCloneNode() for
  reusal; so the map-items don't need to be created for every
  cloning/adoption. Added a callback function to it for
  retrieval of xmlNsPtr to be set on node->ns; this is needed
  for my custom handling of ns-references in my DOM wrapper.
  Substituted code which created the XML namespace decl on
  the doc for a call to xmlTreeEnsureXMLDecl(). Removed
  those nastly "warnigns" from the docs of the clone/adopt
  functions; they work fine on my side.
2006-06-16 19:46:26 +00:00
Kasimier T. Buchcik
1d0f7ad610 Adjusted the result of a regression test, since the fix of
* result/pattern/namespaces: Adjusted the result of a
  regression test, since the fix of xmlGetNodePath() revealed a
  bug in this test result.
2006-06-12 11:25:50 +00:00
Kasimier T. Buchcik
43ceb1ec88 Got rid of a compiler warning in xmlGetNodePath().
* tree.c: Got rid of a compiler warning in xmlGetNodePath().
2006-06-12 11:08:18 +00:00
Kasimier T. Buchcik
d38c63f329 Fixed xmlGetNodePath() to generate the node test "*" for elements in the
* tree.c: Fixed xmlGetNodePath() to generate the node test "*"
  for elements in the default namespace, rather than generating
  an unprefixed named node test and loosing the namespace
  information.
2006-06-12 10:58:24 +00:00
Kasimier T. Buchcik
803e37ac2c Clarified in the docs that the tree must not be tried to be modified if
* include/libxml/parser.h: Clarified in the docs that the tree
  must not  be tried to be modified if using the parser flag
  XML_PARSE_COMPACT as suggested by Stefan Behnel
  (#344390).
2006-06-09 19:46:46 +00:00
Daniel Veillard
f781dbaee8 Fix the breakages introduced by amaya, Daniel 2006-06-09 13:34:49 +00:00
Daniel Veillard
fabafd54c7 preparing release of 2.6.26 Daniel
* configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.26
Daniel
2006-06-08 08:16:33 +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.
LIBXML2_2_6_26
2006-06-06 15:27:46 +00:00
Daniel Veillard
69839ba197 preparing release of 2.6.25 Daniel
* configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.25
Daniel
2006-06-06 13:27:03 +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
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
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
Daniel Veillard
f79fbfc006 applied patch from Olli Savia for LynxOS Daniel
* libxml.h triodef.h: applied patch from Olli Savia for LynxOS
Daniel
2006-05-31 13:35:28 +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
e5f810f69b A warning will now be reported in the value of the XSD attribute
* xmlschemas.c: A warning will now be reported in the value of
  the XSD attribute 'schemaLocation' does not consist of tuples
  (namespace-name, document-URI). A warning will be reported
  if a schema document could not be found at the specified
  location (via 'schemaLocation' or
  'noNamespaceSchemaLocation').
* include/libxml/xmlerror.h: Added XML_SCHEMAV_MISC to
  xmlParserErrors.
2006-05-30 09:41:25 +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
Rob Richards
a512d76edc Revert behavior change in xmlSetProp to handle attributes with colons in
* tree.c: Revert behavior change in xmlSetProp to handle attributes
  with colons in name and no namespace.
2006-05-22 11:34:44 +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
Kasimier T. Buchcik
9b02e295c1 Fixed bug #341337, reported by David Grohmann. The code expected a node
* xmlschemas.c: Fixed bug #341337, reported by David Grohmann.
  The code expected a node (xmlNodePtr) on the info for a
  non-existent default attribute, which clearly cannot be
  expected, since the attribute does not exist. I can only
  guess that this sneaked trying to eliminate the query
  for the owner-element, which is unavoidable actually.
  Note that creation of default attributes won't have an
  effect if validating via SAX/XMLReader; i.e., the processor
  won't fire additional start-attribute events (I'm not even
  sure if Libxml2 has such a SAX-event; I think it hands them
  all over in the start-element event).
2006-05-11 16:25:44 +00:00
Kjartan Maraas
7c7c0590f8 Shut up CVS 2006-05-10 08:58:19 +00:00
Kasimier T. Buchcik
92b394fcf3 Fixed bug #341150, reported by Michael Romer. In
* xmlschemas.c: Fixed bug #341150, reported by Michael Romer.
  In xmlSchemaBuildContentModelForSubstGroup(),
  xmlAutomataNewOnceTrans2() was incorrectly used instead of
  xmlAutomataNewTransition2() to mimic a xs:choice for
  substitution-groups.
* test/schemas/subst-group-1_1.xsd
  test/schemas/subst-group-1_0.xml
  result/schemas/subst-group-1_0_1
  result/schemas/subst-group-1_0_1.err: Added regression test
  supplied by Michael Romer for bug #341150.
2006-05-09 19:59:54 +00:00