Merge pull request #960 from ermshiperete/ShowHelp
[mono.git] / mcs / class / System.XML / Mono.Xml.Xsl.Operations / XslCopyOf.cs
index 34473656ef76030028cbbfa21dccc30413832743..042412136ba417d76f638a9861dfcf7244e8fac5 100644 (file)
@@ -42,6 +42,11 @@ namespace Mono.Xml.Xsl.Operations {
                public XslCopyOf (Compiler c) : base (c) {}
                protected override void Compile (Compiler c)
                {
+                       if (c.Debugger != null)
+                               c.Debugger.DebugCompile (c.Input);
+
+                       c.CheckExtraAttributes ("copy-of", "select");
+
                        c.AssertAttribute ("select");
                        select = c.CompileExpression (c.GetAttribute ("select"));
                }
@@ -127,20 +132,21 @@ namespace Mono.Xml.Xsl.Operations {
        
                public override void Evaluate (XslTransformProcessor p)
                {
+                       if (p.Debugger != null)
+                               p.Debugger.DebugExecute (p, this.DebugInput);
+
                        object o = p.Evaluate (select);
                        XPathNodeIterator itr = o as XPathNodeIterator;
-                       if (itr == null) {
-                               XPathNavigator nav = o as XPathNavigator; // RTF
-                               if (nav != null)
-                                       itr = nav.SelectChildren (XPathNodeType.All);
-                       }
                        if (itr != null) {
                                while (itr.MoveNext ())
                                        CopyNode (p, itr.Current);
                        } else {
-                               p.Out.WriteString (XPathFunctions.ToString (o));
+                               XPathNavigator nav = o as XPathNavigator; // RTF
+                               if (nav != null)
+                                       CopyNode (p, nav);
+                               else
+                                       p.Out.WriteString (XPathFunctions.ToString (o));
                        }
-
                }
        }
 }