+2005-08-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Pattern.cs, IdPattern.cs, LocationPathPattern.cs, UnionPattern.cs :
+ added bool EvaluatedNodeType property (used in XslKeyTable).
+
2005-05-05 Atsushi Enomoto <atsushi@ximian.com>
* XPathEditableDocument.cs : sync with updated 2.0 API.
{
ids = arg0.Split (XmlChar.WhitespaceChars);
}
-
+
+ public override XPathNodeType EvaluatedNodeType {
+ get { return XPathNodeType.Element; }
+ }
+
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
XPathNavigator tmp = ((XsltCompiledContext) ctx).GetNavCache (this, node);
return .5;
}
}
+
+ public override XPathNodeType EvaluatedNodeType {
+ get { return nodeTest.EvaluatedNodeType; }
+ }
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
}
public virtual double DefaultPriority { get { return 0.5; }}
-
+
+ public virtual XPathNodeType EvaluatedNodeType {
+ get { return XPathNodeType.All; }
+ }
+
public abstract bool Matches (XPathNavigator node, XsltContext ctx);
}
}
\ No newline at end of file
this.p0 = p0;
this.p1 = p1;
}
+
+ public override XPathNodeType EvaluatedNodeType {
+ get {
+ return p0.EvaluatedNodeType == p1.EvaluatedNodeType ?
+ p0.EvaluatedNodeType : XPathNodeType.All;
+ }
+ }
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
+2005-08-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XslKey.cs : Fixed match pattern in xsl:key to check attribute nodes.
+ To minimize attribute iteration, use Pattern.EvaluatedNodeType.
+ Fixed bug #75709.
+
2005-07-29 Atsushi Enomoto <atsushi@ximian.com>
* XslFunctions.cs : XslTransform recovers from errors on document
nav.MoveToRoot ();
XPathNavigator tmp = doc.Clone ();
+ bool matchesAttributes = false;
+ switch (key.Match.EvaluatedNodeType) {
+ case XPathNodeType.All:
+ case XPathNodeType.Attribute:
+ matchesAttributes = true;
+ break;
+ }
+
do {
if (key.Match.Matches (nav, ctx)) {
tmp.MoveTo (nav);
CollectIndex (nav, tmp);
}
- } while (MoveNavigatorToNext (nav));
+ } while (MoveNavigatorToNext (nav, matchesAttributes));
if (map != null)
foreach (ArrayList list in map.Values)
list.Sort (XPathNavigatorComparer.Instance);
}
- private bool MoveNavigatorToNext (XPathNavigator nav)
+ private bool MoveNavigatorToNext (XPathNavigator nav, bool matchesAttributes)
{
+ if (matchesAttributes) {
+ if (nav.NodeType != XPathNodeType.Attribute &&
+ nav.MoveToFirstAttribute ())
+ return true;
+ else if (nav.NodeType == XPathNodeType.Attribute) {
+ if (nav.MoveToNextAttribute ())
+ return true;
+ nav.MoveToParent ();
+ }
+ }
if (nav.MoveToFirstChild ())
return true;
do {