Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-03-22 10:39:29 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-03-22 10:39:29 +0300
commitce6759fea0f857fe160606d6784e624c40a4428c (patch)
tree31380db1c3ae3dc0f5d0bf44e409c302dd88198d /mcs/class/System.XML/Mono.Xml.XPath
parent30edd43bb79e9717acb2691c2c4b83edf5e34612 (diff)
2004-03-22 Atsushi Enomoto <atsushi@ximian.com>
* Compiler.cs : Now it holds XPath parser and XSLT pattern parser. * XslKey.cs : Use XSLT pattern parser for match. UsePattern is now "Use" (it is not a pattern). Reimplemented Evaluate() to make full use of index table. Added Matches() to handle shorter match evaluation. For const value for key (e.g. key patterns), it could avoid Evaluate(). * XsltCompiledContext.cs : Added MatchesKey() that just delegates to new KeyIndexTable.Matches(). * XslFunctions.cs : Added PatternMatches() that just delegates to new XsltCompiledContext.MatchesKey(). * Pattern.cs : Pattern.Compile() now uses XSLT pattern parser instead of XPath parser. * KeyPattern.cs : Matches() now just delegates to XsltKey.MatchesKey(). svn path=/trunk/mcs/; revision=42066
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.XPath')
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/ChangeLog6
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/KeyPattern.cs6
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/Pattern.cs2
3 files changed, 8 insertions, 6 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
index d0d8a26695d..3e77a1e5472 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
@@ -1,5 +1,11 @@
2004-03-22 Atsushi Enomoto <atsushi@ximian.com>
+ * Pattern.cs : Pattern.Compile() now uses XSLT pattern parser instead
+ of XPath parser.
+ * KeyPattern.cs : Matches() now just delegates to XsltKey.MatchesKey().
+
+2004-03-22 Atsushi Enomoto <atsushi@ximian.com>
+
* DTMXPathDocumentBuilder.cs,
DTMXPathDocumentWriter.cs,
DTMXPathNavigator.cs,
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/KeyPattern.cs b/mcs/class/System.XML/Mono.Xml.XPath/KeyPattern.cs
index f7c2b128c6f..338b64391f3 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/KeyPattern.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/KeyPattern.cs
@@ -51,11 +51,7 @@ namespace Mono.Xml.XPath
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
- XPathNodeIterator iter = key.EvaluateNodeSet (new SelfIterator (node, ctx));
- while (iter.MoveNext ())
- if (iter.Current.IsSamePosition (node))
- return true;
- return false;
+ return key.PatternMatches (node, ctx);
}
public override double DefaultPriority { get { return 0.5; } }
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/Pattern.cs b/mcs/class/System.XML/Mono.Xml.XPath/Pattern.cs
index d4d84ec8cc3..b258e4f3612 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/Pattern.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/Pattern.cs
@@ -43,7 +43,7 @@ namespace Mono.Xml.XPath
{
internal static Pattern Compile (string s, Compiler comp)
{
- return Compile (comp.parser.Compile (s));
+ return Compile (comp.patternParser.Compile (s));
}
internal static Pattern Compile (Expression e)