Commit Graph
94 Commits
Author SHA1 Message Date
Marek Safar 5b82f0e08c Clean up some NET_2_0 2012-06-14 15:44:35 +01: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
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
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 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 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 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 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 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 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 3ed15e6d44 2004-09-22 Atsushi Enomoto <[email protected]>
* Expression.cs : Now that managed collation is default, we don't need
	  reversive case-order anymore.


svn path=/trunk/mcs/; revision=50530
2005-09-22 18:59:50 +00:00
Atsushi Eno 36b186ae4f 2004-07-23 Atsushi Enomoto <[email protected]>
* Expression.cs : don't expect namespace resolver; namespace could be
	  supplied in QName without nsresolver need (i.e. SelectChildren()).
	  Fixed bug #75609.

	* XPathNavigatorCommonTests.cs : added test for bug #75609


svn path=/trunk/mcs/; revision=47573
2005-07-23 07:00:51 +00:00
Atsushi Eno 104d203349 2004-06-07 Atsushi Enomoto <[email protected]>
* Expression.cs : set TARGET_JVM where collation matters.


svn path=/trunk/mcs/; revision=45577
2005-06-07 13:34:27 +00:00
Atsushi Eno 59f1697a06 2004-05-05 Atsushi Enomoto <[email protected]>
* System.Xml.dll.sources : XPathAtomicValue.cs -> XmlAtomicValue.cs.

	* XmlAtomicValue.cs : moved from XPathAtomicValue, removed some stuff.

	* SubtreeXmlReader.cs :
	  removed atomizedName related 2.0 member (deprecated).

	* XPathAtomicValue.cs :
	  it is now XmlAtomicValue and in sys.xml.schema.
	* XPathNavigator.cs, Expression.cs :
	  removed atomizedName related 2.0 members (deprecated).

	* XsdValidatingReader.cs :
	  removed atomicName related 2.0 members (deprecated in beta2).

	* XmlNodeReader2.cs, XmlTextReader2.cs, XmlValidatingReader.cs,
	  XmlNamespaceManager.cs, IXmlNamespaceResolver.cs,
	  DTDValidatingReader.cs : Removed most of "atomizedName" related
	  stuff that are obsoleted in 2.0 beta2.
	* XQueryConvert.cs : XPathAtomicValue -> XmlAtomicValue.

	* XmlNamespaceManagerTests.cs : removed atomizedName related tests.


svn path=/trunk/mcs/; revision=44083
2005-05-05 14:14:57 +00:00
Atsushi Eno 8922e4e424 2004-03-25 Atsushi Enomoto <[email protected]>
* Expression.cs : In ExprSLASH2, replace A//B with A/descendant::B if
	  B is child axis test (thus peer&subtree optimization became possible)
	  Fixed warning (incorrect variable let).


svn path=/trunk/mcs/; revision=42247
2005-03-25 10:56:11 +00:00
Atsushi Eno bf86f5ec7b 2004-03-22 Atsushi Enomoto <[email protected]>
* Expression.cs : EvaluateBoolean() for RTF should check return true
	  for empty elements. Fixed static analysis for RTF.

	* XslTransformTests.cs : added test 1)that examines pattern sanity and
	  2)that examines if empty element RTF is evaluated as true for bool.


--his line, and those below, will be ignored--

M    System.Xml.XPath/ChangeLog
M    System.Xml.XPath/Expression.cs
M    Test/System.Xml.Xsl/ChangeLog
M    Test/System.Xml.Xsl/XslTransformTests.cs
M    Test/System.Xml.Xsl/standalone_tests/Makefile

svn path=/trunk/mcs/; revision=42118
2005-03-22 15:44:41 +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 16b2217356 2004-03-11 Atsushi Enomoto <[email protected]>
* Expression.cs, DefaultContext.cs : more Peer overrides.


svn path=/trunk/mcs/; revision=41702
2005-03-11 14:36:25 +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 e9f471bbab 2004-03-04 Atsushi Enomoto <[email protected]>
* Expression.cs : Significant whitespace nodes must be returned in
	  text() NodeTypeTest.


svn path=/trunk/mcs/; revision=41427
2005-03-04 07:05:22 +00:00
Atsushi Eno 78640dbcdb 2004-02-23 Atsushi Enomoto <[email protected]>
* Expression.cs : xsl:sort case-order was not handled properly.


svn path=/trunk/mcs/; revision=41099
2005-02-23 16:13:11 +00:00
Atsushi Eno b821d60b25 2004-02-18 Atsushi Enomoto <[email protected]>
* Expression.cs : string() function expects "Infinity" and "-Infinity"
	  instead of "INF" for conversion from number. XmlConvert is for XSD,
	  not for XSLT.


svn path=/trunk/mcs/; revision=40845
2005-02-18 08:11:22 +00:00
Atsushi Eno d08da3813d 2004-02-09 Atsushi Enomoto <[email protected]>
* Expression.cs : RelationalExpr was comparing number and node in
	  reverse order. Patch by Kazuki Oikawa. Fixed bug #72343.
	  RelationalExpr should also handle result tree fragment as node-set
	  as well as EqualityExpr. This fixes RTF case wrt #72343.


svn path=/trunk/mcs/; revision=40326
2005-02-09 07:03:41 +00:00
Atsushi Eno 7a88a433f7 2004-02-08 Atsushi Enomoto <[email protected]>
* Expression.cs : tiny code format fix by Andrew Skiba.


svn path=/trunk/mcs/; revision=40295
2005-02-08 11:06:56 +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 4a31df6a00 2004-11-26 Atsushi Enomoto <[email protected]>
* Expression.cs : warning removal. Added Optimize() which is not
	  implemented at all.
	* Tokenizer.cs : warning elimination



svn path=/trunk/mcs/; revision=36597
2004-11-26 02:56:02 +00:00
Atsushi Eno 7e940e8ecf 2004-11-05 Atsushi Enomoto <[email protected]>
* Expression.cs, XPathNavigator.cs : hold raw expression field for
	  get_Expression. It is preparation for expression optimization.

svn path=/trunk/mcs/; revision=35767
2004-11-06 12:55:33 +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 48b6668436 2004-07-21 Atsushi Enomoto <[email protected]>
* XPathExpression.cs, Expression.cs :
	  Added SetContext(IXmlNamespaceResolver).
	* NodeChangedEventArgs.cs : Added missing [MonoTODO].
	* XPathAtomicValue.cs : Halfly implemented.
	* XPathDocument.cs : Added 2.0 members.
	* XPathDocumentNodeChangedAction.cs : updated member names.
	* XPathEditableNavigator.cs : Added missing 2.0 members and MonoTODO.
	* XPathNavigator.cs : Added missing 2.0 members.
	  Fixed some members as virtual->override.

svn path=/trunk/mcs/; revision=31337
2004-07-21 15:00:11 +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 a29d95c9e9 2004-06-03 Atsushi Enomoto <[email protected]>
* Expression.cs : LookupNamespace() only allows already-atomized names.
	* XPathEditableNavigator.cs : removed incorrect set_OuterXml() and
	  set_InnerXml().

svn path=/trunk/mcs/; revision=28791
2004-06-03 21:05:17 +00:00
Atsushi Eno 2ead87db32 2004-05-22 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : Add XPathNavigator input support for ToBoolean()
	  and ToNavigator().
	* Expression.cs : In Equality comparison, evaluate XPathNavigator in
	  the same as well as NodeSet. This fixes bug #59134.

svn path=/trunk/mcs/; revision=28237
2004-05-27 09:10:08 +00:00
Atsushi Eno 7efc4e561b 2004-05-20 Atsushi Enomoto <[email protected]>
* Expression.cs : We should not catch all kind of exception. Just
	  throwing any kind of exception would be preferable.
	  Added support for XPathNavigator values.

svn path=/trunk/mcs/; revision=27726
2004-05-20 08:42:32 +00:00
Atsushi Eno da650ba480 2004-05-13 Atsushi Enomoto <[email protected]>
* DefaultContext.cs : Removed MonoTODO. done.
	* Expression.cs : handle XPathResultType.Navigator in some places and
	  removed MonoTODO. Mark MonoTODO with explicit comments (though they
	  are mostly pointing out possibilities of optimization).
	  Removed extra check that depended on the old bugs.
	* XPathResultType.cs : Fixed .Navigator that had the same value as
	  .String.

svn path=/trunk/mcs/; revision=27224
2004-05-13 05:09:14 +00:00
Atsushi Eno 9182a21d27 2004-02-17 Atsushi Enomoto <[email protected]>
* XPathNavigator.cs : Only child and attribute axes are allowed for
	  Matches().
	* Expression.cs : Added IsPositional property.
	* DefaultContext.cs : Added some overrides.

svn path=/trunk/mcs/; revision=23181
2004-02-17 20:09:12 +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 ca0a570668 2003-12-03 Atsushi Enomoto <[email protected]>
* Expression.cs : XPathSorters.Compare() should compare document
	  position. See last sentence of XSLT 1.0 secion 10.

svn path=/trunk/mcs/; revision=20720
2003-12-03 05:45:54 +00:00
Atsushi Eno feaa393fe3 2003-11-28 Atsushi Enomoto <[email protected]>
* Expression.cs : namespace axis now traversed in reverse order, so it
	  requires sorting.
	* Iterator.cs : UnionIterator.Clone() was incomplete.
	  NamespaceItarator() should be reverse order (special handling
	  because of XPathNavigator specification).

svn path=/trunk/mcs/; revision=20565
2003-11-28 01:13:15 +00:00
Atsushi Eno d0a53d86bb 2003-11-24 Atsushi Enomoto <[email protected]>
* Parser.jay, Expression.cs, Iterator.cs :
	  Added ExprParens and ParensIterator classes which is used to handle
	  precedence of parenthesized expressions.
	  (e.g. consider "(preceding::*)[3]" and "preceding::[3]" )

	* Expression.cs, Iterator.cs :
	  Added RequireSorting property for each Expr and BaseIterator classes.
	  SlashIterator.MoveNext() now considers correct sorting. But
	  considering performance, it separates two logics, sorted and sortless
	  depending on RequireSorting of left iterator and right expression.

	* Iterator.cs :
	  SimpleIterator.ctor() should consider when nav is null.
	  FollowingIterator.MoveNext() and PrecedingIterator.MoveNext() should
	  not return any nodes.
	  AncestorIterator and AncestorOrSelfIterator copy ctr() should clone
	  positions.
	  AncestorIterator.MoveNext() should skip Root if context node is
	  Root itself.
	  FollowingIterator.MoveNext() should not handle children of context
	  itself.
	  PrecedingIterator.MoveNext() should skip its ancestors.
	  AxisIterator.ReverseAxis should be dependent on its containing iter.
	  UnionIterator.MoveNext() should consider comparison of nodes in
	  different document. The behavior is implementation dependent.
	  (see XSLT spec 12.1)

svn path=/trunk/mcs/; revision=20389
2003-11-24 15:18:16 +00:00