Commit Graph
279 Commits
Author SHA1 Message Date
Rolf Bjarne Kvinge a9b8a73f68 [System.Xml] Use profile-specific file names for generated files.
Otherwise parallel builds will break randomly.
2014-05-30 16:57:54 +02:00
Marek Safar 8e1391f63c Remove NET_2_0 2012-06-28 18:15:10 +01:00
Marek Safar 5b82f0e08c Clean up some NET_2_0 2012-06-14 15:44:35 +01:00
Marek Safar d5d4b9c22b Fix some warnings 2012-06-08 12:48:08 +01:00
Martin Baulig 7d170f400d Sync parameter names with .NET. 2012-06-03 04:02:28 +02: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
Atsushi Eno 9c9546c9ea Revert previous non-standard "ends-with" function.
A valid way to do equivalent, from IRC:

[12:05] <eno> miguel: I believe you shouldn't add non-standard "ends-with" as the standard XPath implementation. Use extension framework instead.
[12:05] <eno> regarding https://github.com/mono/mono/commit/9b07497f9067ab4d3f4a7964f2868c7eafef1b5d
[13:39] <migueld> Seems like it is XPath 2.0
[13:46] <eno> Yes, XPath 2.0 contains that one. .NET implementation is for 1.0.
[13:46] <eno> This would help you to use XSLT extension http://msdn.microsoft.com/en-us/library/tf741884.aspx
[13:47] <eno> or this might be handy: http://msdn.microsoft.com/en-us/library/wxaw5z5e.aspx
[13:49] <eno> Add this under <stylesheet> or <transform> : <msxsl:script language="C#" implements-prefix="x" xmlns:msxsl="urn:schemas-microsoft-com:xslt">public bool ends_with (string s, string target) { return s.EndsWith (target); }</msxsl:script>
[13:49] <eno> and use "x:ends_with(foo, bar)" instead
2012-03-01 23:51:55 +09:00
Miguel de Icaza 9b07497f90 Add ends-with function to our XPath processor 2012-02-29 20:44:39 -05: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
David Eisner daae18420a Fixed the XPath built-in position function for bug #497017
According to http://www.w3.org/TR/xpath#predicates, a predicate [n] should be equivalent to [position()=n] for a number expression n. However, we currently have a PredicateIterator intepretation of [n] that has been corrected for the issue outlined in the bug report, leaving the position() function behind with an inappropriate, document-order value for reverse axes. Note that [n] is not treated by parsing or transforming to the same form as [position()=n] before evaluation, valid as that would be.

The discussion in that same section of the recommendation about forward and reverse axes and further remarks in http://www.w3.org/TR/xpath#node-sets make it clear that the predicate [1] has the sense of "nearest" rather than "first in the document" which then, depending on the axis type, may be the same or reverse of the document order. It does not seem to me to be so clear whether the order given by a navigator for a location path expression should mirror this or always give the document order. The .Net implementation seems to always give the document order, as well as predicates having the correct reverse/forward senses, so I have added test cases that explore both.
2011-07-21 23:07:02 +01:00
Atsushi Eno 8b5e57c908 2009-11-20 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : do not use sloppy XmlConvert to parse xpath
	  number. Fixed bug #556619.

	* XslTransformTests.cs : added test for bug #556619 by
	  Tor Lillqvist.


svn path=/trunk/mcs/; revision=146613
2009-11-20 12:06:16 +00:00
Atsushi Eno 41d459231c 2009-09-15 Atsushi Enomoto <[email protected]>
* Expression.cs : to support external function that returns non-
	  double (such as int) as number, add conversion from non-double at
	  evaluation. This should fix bug #498389.


svn path=/trunk/mcs/; revision=141965
2009-09-15 13:20:14 +00:00
Atsushi Eno 60d5aeb3f8 2009-07-22 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : name test did not handle String.Empty cases
	  for name and ns (i.e. no filter). Fixed bug #515136.

	* XPathNavigatorTests.cs : added test for bug #515136.


svn path=/trunk/mcs/; revision=138384
2009-07-22 11:05:00 +00:00
Gonzalo Paniagua Javier a054484fab re-disable the cache that was enabled by mistake
svn path=/trunk/mcs/; revision=135817
2009-06-10 02:55:07 +00:00
Gonzalo Paniagua Javier 95bee485a2 2009-06-09 Gonzalo Paniagua, Miguel de Icaza <[email protected], [email protected]>
* Expression.cs: improve the ExpressionCache, it still does not
	work, but it will at least work better with multithreaded apps (we
	take locks) and we use WeakReferences correctly.

	For WeakReferences it is important to not depend on IsAlive to
	retrieve the target (this is a documented race).  IsAlive is only
	useful to determine if it has already been collected, but if true,
	the Target can still be released.

	This race condition is exposed by #505678 on x86-64 platforms (only).

	Sadly, this fix is not good enough to re-enable the cache, on
	x86-64 this with a single thread, it still crashes randomly
	

svn path=/trunk/mcs/; revision=135815
2009-06-10 01:07:50 +00:00
Atsushi Eno d54e48a2c1 2009-04-15 Atsushi Enomoto <[email protected]>
* Expression.cs : extensions could return null and it should be
	  regarded as empty node-set, not an error.


svn path=/trunk/mcs/; revision=131738
2009-04-15 08:54:10 +00:00
Atsushi Eno efb1509fd7 2009-03-17 Atsushi Enomoto <[email protected]>
* Expression.cs : gave up another optimization for bug #443090.

	* SelectNodesTests.cs : added 2nd test for bug #443490.


svn path=/trunk/mcs/; revision=129574
2009-03-17 11:29:32 +00:00
Atsushi Eno 40a7f089a1 2009-03-17 Atsushi Enomoto <[email protected]>
* XPathExpression.cs : eliminate use of ExpressionCache and lose
	  significant performance in some use for the sake of multithreaded
	  use. Fixed bug #477049.


svn path=/trunk/mcs/; revision=129545
2009-03-17 08:54:09 +00:00
Martin Baulig 5482c75a0a Add .gitignore's.
svn path=/trunk/mcs/; revision=128880
2009-03-09 14:14:56 +00:00
Atsushi Eno c982bb5013 2009-01-20 Atsushi Enomoto <[email protected]>
* Expression.cs : give up sortless iterator optimization.
	  Fixed bug #443490.

	* SelectNodesTests.cs : added test for bug #443490.


svn path=/trunk/mcs/; revision=123871
2009-01-20 11:37:44 +00: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
Atsushi Eno 5a15db1e4c 2008-09-19 Atsushi Enomoto <[email protected]>
* DefaultContext.cs, Expression.cs: do not premise BaseIterator.


svn path=/trunk/mcs/; revision=113511
2008-09-19 10:46:48 +00:00
Atsushi Eno ecf1894b4b 2008-09-19 Atsushi Enomoto <[email protected]>
* XPathComparer.cs : no need to limit to BaseIterator.


svn path=/trunk/mcs/; revision=113510
2008-09-19 10:45:23 +00:00
Atsushi Eno bf8280aac5 2008-09-19 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : oops, wrong #if ranges.


svn path=/trunk/mcs/; revision=113498
2008-09-19 08:58:05 +00:00
Atsushi Eno 1d36c92121 2008-09-19 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : made some 2.0-only methods available in 1.x
	  so that we don't have to hesitate to optimize xpath using them.


svn path=/trunk/mcs/; revision=113491
2008-09-19 04:09:39 +00:00
Marek Safar 2be4aa8ed9 Warnings cleanup
svn path=/trunk/mcs/; revision=111842
2008-08-28 17:11:51 +00:00
Marek Safar 95a6e77b85 Warnings cleanup
svn path=/trunk/mcs/; revision=111839
2008-08-28 16:53:31 +00:00
Atsushi Eno 2fd35a1f5c 2008-06-03 Atsushi Enomoto <[email protected]>
* Expression.cs : help diagnose variable resolution failure.


svn path=/trunk/mcs/; revision=104745
2008-06-03 11:41:34 +00:00
Atsushi Eno bea2f84c76 2008-04-02 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : fixed InnerXml to not give up with root node.
	  Indent InnerXml. Fixed bug #376191.

	* XPathNavigatorTests.cs : added test for bug #376191.


svn path=/trunk/mcs/; revision=99623
2008-04-02 08:23:10 +00:00
Atsushi Eno d6fa107ffc 2008-02-27 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : in some MoveTo*() methods, it should allow any
	  destination node when "type" is XPathNodeType.All. Based on the
	  patch by Sanghyeon Seo, fixed bug #365112.

	* XPathNavigatorTests.cs : added test for bug #365112.


svn path=/trunk/mcs/; revision=96753
2008-02-27 11:45:11 +00:00
Atsushi Eno 6f49cb9172 2008-02-12 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : now number formatting for "R" works fine, so
	  just use it (and remove conditional compilation for TARGET_JVM).


svn path=/trunk/mcs/; revision=95479
2008-02-12 08:38:54 +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
Sebastien Pouliot 999d3d2182 2008-01-12 Sebastien Pouliot <[email protected]>
* DefaultContext.cs: Fix direct comparison with NaN. Found by 
	Gendarme.


svn path=/trunk/mcs/; revision=92755
2008-01-12 16:55:24 +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 e6024b90d2 2007-12-17 Atsushi Enomoto <[email protected]>
* Expression.cs : In any comparison expr, treat RTF as equivalent to
	  string type (as specified in XSLT 1.0 section 11.1: "An operation
	  is permitted on a result tree fragment only if that operation would
	  be permitted on a string." ...). Fixed bug #349035.

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


svn path=/trunk/mcs/; revision=91402
2007-12-17 07:28:33 +00:00
Atsushi Eno 2ef590022e 2007-11-29 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : implemented ValueAs().

	* XPathNavigatorTests.cs : added ValueAs() test.


svn path=/trunk/mcs/; revision=90443
2007-11-29 17:20:54 +00:00
Atsushi Eno 372164c127 2007-01-30 Atsushi Enomoto <[email protected]>
* Expression.cs : typo. Close #80669


svn path=/trunk/mcs/; revision=71948
2007-01-30 11:07:40 +00:00
Atsushi Eno 8da0d1e779 2007-01-05 Atsushi Enomoto <[email protected]>
* Expression.cs : text() should match whitespace and significant
	  whitespace nodes.

	* XPathNavigatorTests.cs : added test for text() and whitespace/
	  significantwhitespace node.


svn path=/trunk/mcs/; revision=70536
2007-01-05 16:20:04 +00:00
Atsushi Eno 1d3440fc5d sanitizing MonoTODOs.
svn path=/trunk/mcs/; revision=67899
2006-11-15 11:31:25 +00:00
Atsushi Eno 25fc3e1f3b 2006-11-10 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs :
	  - ReadSubtree() should reject everything but Element or Root.
	  - InnerXml and OuterXml should not use ReadSubtree() when it is
	    not positioned on an Element or the Root. Thus, implement them
	    in their own ways. Fixed bug #79875.

	* XPathNavigatorTests.cs : added test for bug #79875, and some
	  "escaped" text tests for InnerXml.
	* XPathNavigatorReaderTests.cs : make sure that most of XPath nodes
	  are rejected to read subtree.


svn path=/trunk/mcs/; revision=67659
2006-11-10 01:39:23 +00:00
Atsushi Eno e19092967f 2006-11-10 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : InnerXml should allow Text-only content. Fixed
	  bug #79874, when tied to XPathNavigatorReader fix.

	* XPathNavigatorReader.cs : removed node type restriction on 
	  initialization.  Fixed bug #79874, when tied to XPathNavigator fix.

	* XPathNavigatorTests.cs : added test for bug #79874.


svn path=/trunk/mcs/; revision=67653
2006-11-10 00:08:43 +00:00
Atsushi Eno 5bcb1c6d8d 2006-04-10 Atsushi Enomoto <[email protected]>
* XPathNavigatorCommonTests.cs : added test for bug #78067.
	* XPathNavigatorReaderTests.cs : ditto, for ReadSubtree() part.

	* XPathNavigatorReader.cs : Read() did not compute Depth correctly.
	  It caused bug #78067.

	* XPathNavigator.cs : get_OuterXml() returns indented output, without
	  XML declaration.

	* XmlWriter.cs : WriteNode(XPathNavigator) : directly write element
	  and root nodes instead of dispatching to ReadSubtree().


svn path=/trunk/mcs/; revision=59286
2006-04-10 09:37:41 +00:00
Atsushi Eno a40a00bcde 2006-03-15 Atsushi Enomoto <[email protected]>
* XslTransformProcessor.cs,
	  Compiler.cs : eliminate ExpressionStore. Now sorting is done
	  inside XslSortEvaluator.
	* XslSortEvaluator.cs : new file. It handles current node in XSLT
	  context. Fixed bug #77781.

	* Expression.cs : extracted XPathSortElement, XPathSorters
	  and XPathSorter from CompiledExpression, and split
	  XPathSorters.Sort() into some methods. Those changes are to make
	  them reusable in XslSortEvaluator.

	* System.Xml.dll.sources : added XslSortEvaluator.cs.

	* knownFailures.txt : removed two xsl:sort+current() tests.


svn path=/trunk/mcs/; revision=58015
2006-03-15 14:43:45 +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