System.Xml.Xsl.Runtime.XmlQueryOutput.XsltCopyOf C# (CSharp) Method

XsltCopyOf() public method

Copy a node by value to output according to Xslt rules: 1. Identity is never preserved 2. If the item is an Rtf, preserve serialization hints when copying. 3. If the item is a Root node, copy the children of the Root
public XsltCopyOf ( XPathNavigator navigator ) : void
navigator System.Xml.XPath.XPathNavigator
return void
        public void XsltCopyOf(XPathNavigator navigator) {
            RtfNavigator navRtf = navigator as RtfNavigator;

            if (navRtf != null) {
                // Copy Rtf
                navRtf.CopyToWriter(this);
            }
            else if (navigator.NodeType == XPathNodeType.Root) {
                // Copy children of root
                if (navigator.MoveToFirstChild()) {
                    do {
                        CopyNode(navigator);
                    }
                    while (navigator.MoveToNext());

                    navigator.MoveToParent();
                }
            }
            else {
                // Copy node
                CopyNode(navigator);
            }
        }