+2007-12-17 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Iterator.cs : be more strict to detect the end of
+ PredicateIterator. Fixed bug #349111.
+
2007-12-17 Atsushi Enomoto <atsushi@ximian.com>
* Expression.cs : In any comparison expr, treat RTF as equivalent to
public override bool MoveNextCore ()
{
- if (finished)
- return false;
while (_iter.MoveNext ())
{
switch (resType) {
case XPathResultType.Number:
if (_pred.EvaluateNumber (_iter) != _iter.ComparablePosition)
continue;
- finished = true;
break;
case XPathResultType.Any: {
object result = _pred.Evaluate (_iter);
{
if ((double) result != _iter.ComparablePosition)
continue;
- finished = true;
}
else if (!XPathFunctions.ToBoolean (result))
continue;
return true;
}
+ finished = true;
return false;
}
public override XPathNavigator Current { get { return _iter.Current; }}
+2007-12-17 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XslTransformTests.cs : added test for bug #349111.
+
2007-12-17 Atsushi Enomoto <atsushi@ximian.com>
* XslTransformTests.cs : added test for bug #349035.
string expected = "<bar>bar is not empty:'HaHa'</bar><bar>bar is empty</bar>";
Assert.AreEqual (expected, sw.ToString ());
}
+
+ [Test]
+ public void Bug349111 ()
+ {
+ XslTransform xslt = new XslTransform ();
+ xslt.Load (new XmlTextReader (new StringReader (@"
+<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">
+ <xsl:template match=""book"">
+ <xsl:for-each select=""child::node()[position()]"">
+ <yyy>
+ <xsl:value-of select="".""/>
+ </yyy>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>"
+ )));
+ XPathDocument input = new XPathDocument (new StringReader (@"
+<bookstore>
+ <book> <title lang=""eng"">Harry Potter</title> <price>29.99</price> </book>
+</bookstore>"
+ ));
+ StringWriter sw = new StringWriter ();
+ xslt.Transform (input, null, new XmlTextWriter (sw));
+ string expected = "<yyy>Harry Potter</yyy><yyy>29.99</yyy>";
+ Assert.AreEqual (expected, sw.ToString ());
+ }
}
}