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 8665095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:23:59+00:00 2026-06-12T17:23:59+00:00

I am creating an xslt and xml file dynamically to show my questionnaire &

  • 0

I am creating an xslt and xml file dynamically to show my questionnaire & save my question options (for dropdown). Now I want to use stream instead of writing on actual file. So this is how I am doing it:

XmlReader xslt_reader;
XmlReader xml_reader;

PageLoad(){
  Fn_CreateXSL();
  Fn_CreateXML();
  LoadQuestionnaire();
}

Fn_CreateXSL(){
   xslt_stream = new MemoryStream();

   XmlTextWriter objXSLTWriter = new XmlTextWriter(xslt_stream, Encoding.UTF8);

   objXSLTWriter.Formatting = Formatting.Indented;
   objXSLTWriter.WriteStartDocument();
    ..........
   objXSLTWriter.WriteEndDocument();
   xslt_stream.Seek(0, SeekOrigin.Begin);
   xslt_reader = XmlReader.Create(xslt_stream);
}

Fn_CreateXML(){
   xmlt_stream = new MemoryStream();

   XmlTextWriter objXMLTWriter = new XmlTextWriter(xmlt_stream, Encoding.UTF8);

   objXMLTWriter.Formatting = Formatting.Indented;
   objXMLTWriter.WriteStartDocument();
    ..........
   objXMLTWriter.WriteEndDocument();
   xmlt_stream.Seek(0, SeekOrigin.Begin);
   xmlt_reader = XmlReader.Create(xmlt_stream);
}

LoadQuestionnaire(){
  XslCompiledTransform var_xsl_trans = new XslCompiledTransform();

  // also tried var_xsl_trans.Load(xslt_reader, null, new XmlUrlResolver());
  var_xsl_trans.Load(xslt_reader); // XSLT Compile Error occurs

  StringWriter sw = new StringWriter();

  var_xsl_trans.Transform(xml_reader, null, sw);
}

But I am getting “XSLT Compile Error when I’m trying to load it. Any idea?

  • 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-06-12T17:24:00+00:00Added an answer on June 12, 2026 at 5:24 pm

    As @kevin mentioned in the comment, the following fixed my issue, but I am not quite sure why it worked though (have some idea, but not sure)

    Add objXMLTWriter.Flush() before the xmlt_stream.Seek(0,
    SeekOrigin.Begin);

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

Sidebar

Related Questions

I am creating a table from xml using xslt, and I want every other
I have a DataTable that I'm creating an XML file from using .WriteXML(..), although
I am trying to use XSLT to transform a XML in to flat text.
I am creating a html page with xslt to format my xml into a
At the moment, I'm creating an XML file in Java and displaying it in
Good Afternoon Developers, Just a quick question (I hope!) I am creating an XSLT
I am stuck in firstly creating a simple xslt. stylesheet to use for transforming
I'm creating some xslt's using Umbraco 4.5.2 and I want to add de set:distinct
I have a bunch of ancillary XML and XSLT files that I want to
I'm creating a Excel xml workbook via xslt. One of the date fields is

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.