Commit Graph
80 Commits
Author SHA1 Message Date
Marek Safar 8e1391f63c Remove NET_2_0 2012-06-28 18:15:10 +01:00
Atsushi Eno fe6e513cf7 Revert previous XPath fix. Fix is rather needed in XPathNodeIterator.GetEnumerator().
The thing is, XPathNodeIterator itself is stateful and does not behave
like IEnumerable, thus GetEnumerator() should not iterate nodes within
*itself*. Rather, it should have returned a clone of it.

After all we didn't have to damage performance to fix bug #3705, which is nice.
2012-03-08 18:11:30 +09:00
Atsushi Eno b88e6a3206 Reuse of XPathNavigator instance is error-prone. Fixed bug #3705. This may significantly harm performance though... 2012-03-08 17:32:16 +09:00
David Eisner 2c59464850 Removal of XPath debugging code relating to bug #497017, leaving the new test cases 2011-07-21 23:29:21 +01:00
David Eisner 1bcf143d6a XPath test cases and debugging code relating to bug #497017 2011-07-21 23:20:13 +01:00
David Eisner 342df43e69 Corrected XPath iterator for ancestor-or-self axes for runaway behaviour
Adding a test case for ancestor-or-self along the lines of the existing one for ancestor showed runaway, memory-eating behaviour. In changing CollectResults to remove the livelock, it seemed simplest to remove the extra yield of the root from MoveNextCore. I was unable to ascertain a good reason for producing this element in this special way compared to the AncestorIterator.
2011-07-21 23:19:00 +01:00
Atsushi Eno 0b09797b9f 2008-12-09 Atsushi Enomoto <[email protected]>
* Iterator.cs : DescendantIterator.Clone() was not cloning current
	  node in new code. Fixed bug #456103.

	* XPathNavigatorTests.cs : added test fo bug #456103.


svn path=/trunk/mcs/; revision=121080
2008-12-09 08:12:07 +00:00
Atsushi Eno e30d02ad83 merge XPath optimization branch. About 15% faster/less memory use so
far.


svn path=/trunk/mcs/; revision=118710
2008-11-13 13:05:44 +00:00
Marek Safar 2be4aa8ed9 Warnings cleanup
svn path=/trunk/mcs/; revision=111842
2008-08-28 17:11:51 +00:00
Konstantin Triger 1532e9daba prevent endless recursion in AncestorIterator while collecting results
svn path=/trunk/mcs/; revision=95369
2008-02-10 12:27:49 +00:00
Atsushi Eno 92692a36b5 2007-12-17 Atsushi Enomoto <[email protected]>
* Iterator.cs : oops, extra removal that causes perf. loss.


svn path=/trunk/mcs/; revision=91406
2007-12-17 08:51:58 +00:00
Atsushi Eno a7e430277e 2007-12-17 Atsushi Enomoto <[email protected]>
* Iterator.cs : be more strict to detect the end of
	  PredicateIterator. Fixed bug #349111.

	* XslTransformTests.cs : added test for bug #349111.


svn path=/trunk/mcs/; revision=91405
2007-12-17 08:25:12 +00:00
Atsushi Eno bea7460582 2006-02-26 Atsushi Enomoto <[email protected]>
* Iterator.cs : seems like MS XPathNodeIterator.MoveNext() itself does
	  not handle XsltContext.PreserveWhitespace() unlike ours. It results
	  in not a small performance improvement. (just removed it since it
	  didn't cause any errors in XSLT standalone tests.)


svn path=/trunk/mcs/; revision=57298
2006-02-26 12:38:08 +00:00
Atsushi Eno 17a250dd3e 2006-02-21 Atsushi Enomoto <[email protected]>
* Iterator.cs : removed extra field from AxisIterator.


svn path=/trunk/mcs/; revision=57107
2006-02-21 20:57:33 +00:00
Atsushi Eno 51c391133e 2006-02-14 Atsushi Enomoto <[email protected]>
* Iterator.cs : tiny message fix (thanks to alp).


svn path=/trunk/mcs/; revision=56851
2006-02-14 13:09:35 +00:00
Atsushi Eno 95eed2d2f4 2006-01-11 Atsushi Enomoto <[email protected]>
* Iterator.cs : Nowadays removal of cloning of the argument list
          in ListIterator is safe. Thanks to Joshua Tauberer for the hint.


svn path=/trunk/mcs/; revision=55394
2006-01-11 18:47:40 +00:00
Atsushi Eno 2e628264bb 2006-01-11 Atsushi Enomoto <[email protected]>
* Iterator.cs : (DescendantOrSelfIterator/DescendantIterator)
          the error message is for blaming custom XPathNavigator
          implementation, not us ;-) (see also #77194)


svn path=/trunk/mcs/; revision=55389
2006-01-11 17:50:16 +00:00
Vladimir Krasnov e9759877ca * Iterator.cs: fixed UnionIterator.SetCurrent method, the navigators may be from different xml files.
svn path=/trunk/mcs/; revision=53399
2005-11-23 17:32:01 +00:00
Vladimir Krasnov 2d6e92d133 * Iterator.cs: fixed SimpleSlashIterator.MoveNextCore method, the navigators may be from different xml files.
svn path=/trunk/mcs/; revision=53398
2005-11-23 17:25:05 +00:00
Atsushi Eno 9c904a47d5 2004-03-25 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : reduced some Clone().
	  Simplified ComparePosition().
	* Iterator.cs : some iterators are not actually reverse axis.


svn path=/trunk/mcs/; revision=42246
2005-03-25 05:35:58 +00:00
Atsushi Eno b6ab8c257e 2004-03-16 Atsushi Enomoto <[email protected]>
* Iterator.cs : reduced extra clone.


svn path=/trunk/mcs/; revision=41870
2005-03-16 05:53:02 +00:00
Atsushi Eno 91af8aea97 2004-03-15 Atsushi Enomoto <[email protected]>
* DefaultContext.cs,
	  Expression.cs,
	  Iterator.cs : Now RequireSorting is not required in BaseIterator
	  (it is now fully in Expression).
	  Removed the last ListIterator .ctor() argument.

	* XslKey.cs : removed last ListIterator.ctor() argument.
	  Reverted the last commit that changed internal key index change 
	  from ArrayList to Hashtable. Avoid clone in CollectIndex().
	  Sort results in Evaluate() before passing list to ListIterator.
	* XslFunctions.cs : removed last ListIterator.ctor() argument.

	* XslVariable.cs : removed last ListIterator.ctor() argument.


svn path=/trunk/mcs/; revision=41864
2005-03-15 21:34:04 +00:00
Atsushi Eno fa27b95fd6 2004-03-14 Atsushi Enomoto <[email protected]>
* Expression.cs,
	  DefaultContext.cs : Basic constant folding optimization (not so
	  effective right now). Unified number-to-string conversion code into
	  XPathFunctions.ToString(double) to avoid roundtrip format right now.
	* Iterator.cs : removed unused code.


svn path=/trunk/mcs/; revision=41781
2005-03-14 04:32:30 +00:00
Atsushi Eno 62dc883eac 2004-03-11 Atsushi Enomoto <[email protected]>
* Iterator.cs : more clone reduction.


svn path=/trunk/mcs/; revision=41714
2005-03-11 19:07:43 +00:00
Atsushi Eno a643fbe57b 2004-03-11 Atsushi Enomoto <[email protected]>
* Expression.cs,
	  DefaultContext.cs : Removed unused NeedAbsoluteMatching.
	  Added Peer and Subtree (for "peer & subtree optimization. See:
	  http://idealliance.org/papers/dx_xmle04/papers/02-03-02/02-03-02.html
	  Fixed some ToString() that caused NullReferenceException.

	* Iterator.cs : Predicate does not affect on RequireSorting.
	  Added SimpleSlashIterator for peer & subtree optimization.

	  Added PreserveWhitespace() consideration in BaseIterator.MoveNext().

	* XslKey.cs : removed unused NeedAbsoluteMatching.
	* XslFunctions.cs : Added Peer (for peer & subtree optimization).
	  Added some missing ToString() overrides.


svn path=/trunk/mcs/; revision=41687
2005-03-11 11:33:30 +00:00
Atsushi Eno 8584919df5 2004-03-09 Atsushi Enomoto <[email protected]>
* Expression.cs,
	  Iterator.cs, :
	  SlashIterator is now constructed with requireSorting parameter 
	  that thus just use RequireSorting from both left/right Expressions, 
	  not iterators.
	  When attribute axis is on the left expression, the result needs to
	  be sorted.


svn path=/trunk/mcs/; revision=41614
2005-03-09 20:06:59 +00:00
Atsushi Eno 57543d7be7 2005-03-09 Atsushi Enomoto <[email protected]>
* XslVariable.cs : clone stored XPathNavigator items before storing.
	* XslAttribute.cs : tiny code reduction.

	* Iterator.cs : Now for most of iterator types, Current property always
	  returns the same instance. It results in huge memory reduction.


svn path=/trunk/mcs/; revision=41591
2005-03-09 10:11:52 +00:00
Atsushi Eno ccbee83783 2004-03-04 Atsushi Enomoto <[email protected]>
* Iterator.cs : (SlashIterator.MoveNext()) For SortedList.Add(), the
	  key should be iterator itself. Key by list count never makes sense.



svn path=/trunk/mcs/; revision=41556
2005-03-08 10:48:37 +00:00
Atsushi Eno 2ae16a5f2b 2004-02-23 Atsushi Enomoto <[email protected]>
* Iterator.cs :
	  In FollowingIterator, attribute and namespace nodes should be 
	  considered to have following nodes. See XPath 1.0 section 5 (esp.
	  the description on "document order").
	  On fixing @*/following::*, attribute nodes are regarded as to be
	  RequireSorting = true (which might result in duplicate).



svn path=/trunk/mcs/; revision=41074
2005-02-23 01:22:59 +00:00
Atsushi Eno 86cb03be47 2004-12-02 Atsushi Enomoto <[email protected]>
* Iterator.cs : when PredicateIterator has a numeric predicate, it
	  will never be true twice. So just break up the iteration on true.
	* XPathNavigator.cs : implemented LookupPrefix().
	* Expression.cs : ExprParens.Optimize() could just return the content
	  expression.



svn path=/trunk/mcs/; revision=36944
2004-12-02 16:01:25 +00:00
Atsushi Eno f54b64bcfb 2004-12-01 Atsushi Enomoto <[email protected]>
* Iterator.cs : with related to the previous patch, many comments
	  got making no sense. Thanks to Harinath.



svn path=/trunk/mcs/; revision=36892
2004-12-01 10:23:11 +00:00
Atsushi Eno 32db6338bd 2004-12-01 Atsushi Enomoto <[email protected]>
* Iterator.cs : actually I mean this patch.



svn path=/trunk/mcs/; revision=36881
2004-12-01 06:54:14 +00:00
Atsushi Eno 1c66f8ee48 2004-12-01 Atsushi Enomoto <[email protected]>
* Iterator.cs : Create _current clone only when required. So just set
	  null when MoveNextCore() succeeded (except for some cases that
	  _current is _nav, such as SelfIterator).



svn path=/trunk/mcs/; revision=36879
2004-12-01 05:27:59 +00:00
Atsushi Eno adae6ad585 2004-11-30 Atsushi Enomoto <[email protected]>
* Iterator.cs : SlashIterator.RequireSorting is always false. Whether
	  it has to collect nodes in prior or not and whether it might return
	  nodes in inconsistent order is different matter.
	  (It still needs to store nodes when either of branches requires
	  sorting, because they might return the same node later.)



svn path=/trunk/mcs/; revision=36850
2004-11-30 17:20:34 +00:00
Atsushi Eno dcadbf1ba2 2004-11-30 Atsushi Enomoto <[email protected]>
* Iterator.cs : reduced some extraneous ComparePosition() that could
	  be written as IsSamePosition(). ParentIterator doesn't have to be
	  RequireSorting.



svn path=/trunk/mcs/; revision=36848
2004-11-30 16:31:04 +00:00
Atsushi Eno aa244372ec 2004-11-30 Atsushi Enomoto <[email protected]>
* Iterator.cs : reimplemented AncestorIterator and 
	  AncestorOrSelfIterator just to collect parents and not to move to
	  siblings. In some cases like thousands of siblings, it used to be
	  so slow, while we usually don't have so deep ancestors.



svn path=/trunk/mcs/; revision=36847
2004-11-30 15:53:31 +00:00
Atsushi Eno f0687f3392 2004-11-07 Atsushi Enomoto <[email protected]>
* Iterator.cs :
	  - Made copy constructor certainly different from other constructors.
	  - Position is never computed in each derived type. All MoveNext() are
	    now MoveNextCore().
	  - Most of the protected members could just be private.

svn path=/trunk/mcs/; revision=35776
2004-11-07 12:46:00 +00:00
Atsushi Eno 2cdd898c24 2004-11-05 Atsushi Enomoto <[email protected]>
* Iterator.cs : SimpleIterator._current could be cloned only when
	  it is required.

svn path=/trunk/mcs/; revision=35765
2004-11-06 12:04:35 +00:00
Atsushi Eno f6c2c59e66 2004-11-05 Atsushi Enomoto <[email protected]>
* Iterator.cs : Some removal of Clone() were harmless.

svn path=/trunk/mcs/; revision=35763
2004-11-06 11:46:18 +00:00
Atsushi Eno b8f5a25be1 2004-10-14 Atsushi Enomoto <[email protected]>
* Iterator.cs :
	  - Added WrapperIterator to return BaseIterator in such case that
	    variable reference is resolved to XPathNodeIterator. This fixes
	    bug #68267.
	  - Path ".." is reverse axis (actually no effect).
	  - Fixed DescendantIterator.Clone() that missed "_finished" field.
	* Expression.cs :
	  In ExprVariable.Evaluate(), use WrapperIterator() for custom
	  XPathNodeIterator.

svn path=/trunk/mcs/; revision=34996
2004-10-14 15:07:36 +00:00
Atsushi Eno a57cd64a04 2004-07-11 Atsushi Enomoto <[email protected]>
* Expression.cs, Iterator.cs, XPathNavigator.cs :
	  Use IXmlNamespaceResolver for net 2.0. Removed unused code.
	* XPathEditableNavigator.cs : fixed namespace.
	* XPathNavigator.cs :
	  Fixed inheritance. Added missing MonoTODO.
	  Removed old .net 1.2 code.

svn path=/trunk/mcs/; revision=31000
2004-07-11 09:51:49 +00:00
Duncan Mak 8fa6e766dd Add MIT license to System.XML.DLL
svn path=/trunk/mcs/; revision=30055
2004-06-21 18:07:31 +00:00
Atsushi Eno 6f208edbf7 2004-06-18 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : Globalization.
	* Iterator.cs : In SlashIterator.MoveNext() position might keep 0
	  in case of empty list. Thus extraneous iteration might happened.
	  Removed unused (and clone unsafe) EnumeratorIterator.

svn path=/trunk/mcs/; revision=29828
2004-06-18 01:30:02 +00:00
Atsushi Eno 1fdaec5cc7 2004-03-16 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs, Iterator.cs : Considered detached nodes, the
	  result of MoveToParent() should be checked.

svn path=/trunk/mcs/; revision=24106
2004-03-16 04:32:06 +00:00
Atsushi Eno 99012ec054 2004-02-16 Atsushi Enomoto <[email protected]>
* Expression.cs : Added EvaluatedNodeType and NeedAbsoluteMatching
	  to reduce extraneous Matches() trial.
	* Iterator.cs : Removed unused MergedIterator.
	* XPathNavigator.cs : Optimized Matches() not to evaluate ancestors
	  unnecessarily. (Test with NeedAbsoluteMatching).

svn path=/trunk/mcs/; revision=23144
2004-02-16 20:28:42 +00:00
Atsushi Eno 848087839d 2004-02-10 Atsushi Enomoto <[email protected]>
* Iterator.cs : Added overriden Count properties for some iterators
	  (this fixes the half of #50678).
	  Added ListIterator class (which can reduce GetEnumerator()).
	  In some places we can omit clone for Current property, so added
	  some check logic (It has no effect as yet).
	* Expression.cs, DefaultContext.cs :
	  use ListIterator instead of EnumeratorIterator.

svn path=/trunk/mcs/; revision=22934
2004-02-10 06:04:28 +00:00
Atsushi Eno 99b1f3bfd3 2004-02-08 Atsushi Enomoto <[email protected]>
* DefaultContext.cs, Expression.cs, Iterator.cs :
	  tiny foreach elimination.

svn path=/trunk/mcs/; revision=22889
2004-02-08 20:23:41 +00:00
Atsushi Eno bbc8ceabde 2004-01-27 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : Avoid exception if possible.
	* Iterator.cs : Fixed PrecedingSiblingIterator.MoveNext(). When the
	  nav was positioned at the first, it incorrectly points itself.
	  Don't add names to name table while it is useless and expensive.

svn path=/trunk/mcs/; revision=22544
2004-01-27 15:57:08 +00:00
Nick Drochak 074d8f46d5 2004-01-08 Nick Drochak <[email protected]>
* Iterator.cs: Removed unused variable.

svn path=/trunk/mcs/; revision=21820
2004-01-07 15:13:11 +00:00
Atsushi Eno 8c751bda97 2003-12-16 Atsushi Enomoto <[email protected]>
* Iterator.cs : On its iteration, moving Current must not affect to
	  MoveNext(). To assure this, Current must be a clone of navigator.
	  Removed unused code.

svn path=/trunk/mcs/; revision=21225
2003-12-16 05:27:27 +00:00