Merge pull request #960 from ermshiperete/ShowHelp
[mono.git] / mcs / class / System.XML / Mono.Xml.Xsl.Operations / XslCopyOf.cs
index 665598c6533fba27faac0f62e1c498773f3a448d..042412136ba417d76f638a9861dfcf7244e8fac5 100644 (file)
@@ -137,18 +137,16 @@ namespace Mono.Xml.Xsl.Operations {
 
                        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));
                        }
-
                }
        }
 }