Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:26:43+00:00 2026-05-13T17:26:43+00:00

I am new to XSLT Transformation world. I’m using XSLT to create an HTML

  • 0

I am new to XSLT Transformation world. I’m using XSLT to create an HTML file. How can I get the output as string, so that I can save it to an HTML file?

Performing the transformation using below line:

objXtrans.Transform(objDoc, objArgLists, objXmlTxtWriter);

How can I convert objXmlTxtWriter to get the complete string generated via the Transform() method which can be saved as HTML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:26:44+00:00Added an answer on May 13, 2026 at 5:26 pm

    If you want the transformation result to be a HTML file then transform to a file (stream), there is no need to first assemble a string in memory to write that complete string to a file.

    Unfortunately you have not really told us which API you use, you mention XmlTextWriter in your subject line so I assume it is the .NET framework you use. Since .NET 2.0 the preferred XSLT processor is System.Xml.Xsl.XslCompiledTransform, if you look at its Transform method then it has several overloads transforming to a Stream so you could simply use code as follows:

    XslCompiledTransform proc = new XslCompiledTransform();
    proc.Load("sheet.xsl");
    using (FileStream stream = File.OpenWrite("result.html"))
    {
      proc.Transform(someInput, someArgumentList, stream);
    }
    

    You have a lot of options for the first argument, it can simply be a string with an input file name or URI, it can be an XmlReader, it can be an object implementing IXPathNavigable (such as an XmlDocument or XPathDocument).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to post-process the documentation XML file as a post-build XSLT transformation (using
I'm frustratingly new to xslt and have a question that I just can't seem
I'm taking HTML file and one XSLT file as input and generating HTML output
I'm new at XSLT. I want to create a hyperlink using XSLT. Should look
I'm kind of new to XSLT, and I've gotten basic transformation done. Next I
i'm new to xslt pls provide the xslt that compare two node based on
I am new to xslt and trying to create one XSLT , I am
i am pretty new to XSLT / XML and HTML. I have a XML
Can any one help in transforming my xml though XSLT. I am new to
I am writing an application that converts an ajax xml response into html using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.