Transform Result Doc as XDocument

Discussion in 'Database, XML and Reporting' started by DN Admin, Apr 27, 2012.

  1. DN Admin

    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Location:
    Joliet, IL U.S.A.

    <pre class="prettyprint XPathDocument xpathDoc = new XPathDocument(sourcePath);
    XPathDocument xpathTransform = new XPathDocument(XmlReader.Create(assembly.GetManifestResourceStream("Namespace.Stylesheet.xsl")));
    XslCompiledTransform trans = new XslCompiledTransform();
    trans.Load(xpathTransform);
    trans.Transform(xpathDoc, writer);</pre>
    How do you output an XDocument from a transform?
    The above code sends the output to an XmlTextWriter. But, I need the output as an XDocument or, at least, an XmlDocument.

    View the full article
     
    #1

Share This Page