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"));
}
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));
}
-
}
}
}