diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2006-04-07 13:16:27 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2006-04-07 13:16:27 +0400 |
commit | f7ec99dca716f29fdc9508b8a56a122fa19b74de (patch) | |
tree | 6774e81f8fd55b6b7902f35c758b00ce699b2fc3 /mcs/class/System.XML/Mono.Xml.Xsl | |
parent | c1da29c50fa0c544565e59573230fd5ce5307971 (diff) |
2006-04-07 Atsushi Enomoto <atsushi@ximian.com>
* XslTransformProcessor.cs : push current node context after iterating
template target node. Added another NodesetMoveNext() which takes
explicit XPathNodeIterator to iterate and filter whitespaces out.
* XslForEach.cs : push current node context after iterating "selected"
node-set.
* XslTransformTests.cs : added CurrentInSelect().
* current-in-select.xml current-in-select.xsl current-in-select.ref :
new files for XslTransformTests.CurrentInSelect().
svn path=/trunk/mcs/; revision=59172
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Xsl')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs | 19 |
2 files changed, 18 insertions, 7 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog index 2cec8f6d357..0cb88128790 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog @@ -1,5 +1,11 @@ 2006-04-07 Atsushi Enomoto <atsushi@ximian.com> + * XslTransformProcessor.cs : push current node context after iterating + template target node. Added another NodesetMoveNext() which takes + explicit XPathNodeIterator to iterate and filter whitespaces out. + +2006-04-07 Atsushi Enomoto <atsushi@ximian.com> + * XslTransformProcessor.cs : in NodesetMoveNext() take XPathContext.PreserveWhitespace() into consideration. diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs index ce7999bc512..4dd77c91607 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs @@ -237,14 +237,14 @@ namespace Mono.Xml.Xsl { Hashtable passedParams = GetParams (withParams); - PushNodeset (nodes); - while (NodesetMoveNext ()) { + while (NodesetMoveNext (nodes)) { + PushNodeset (nodes); XslTemplate t = FindTemplate (CurrentNode, mode); currentTemplateStack.Push (t); t.Evaluate (this, passedParams); currentTemplateStack.Pop (); + PopNodeset (); } - PopNodeset (); if (passedParams != null) paramPassingCache.Push (passedParams); } @@ -442,13 +442,18 @@ namespace Mono.Xml.Xsl { public bool NodesetMoveNext () { - if (!CurrentNodeset.MoveNext ()) + return NodesetMoveNext (CurrentNodeset); + } + + public bool NodesetMoveNext (XPathNodeIterator iter) + { + if (!iter.MoveNext ()) return false; - if (CurrentNodeset.Current.NodeType == XPathNodeType.Whitespace && !XPathContext.PreserveWhitespace (CurrentNodeset.Current)) - return NodesetMoveNext (); + if (iter.Current.NodeType == XPathNodeType.Whitespace && !XPathContext.PreserveWhitespace (iter.Current)) + return NodesetMoveNext (iter); return true; } - + public void PushNodeset (XPathNodeIterator itr) { nodesetStack.Add (itr); |