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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:51:20+00:00 2026-05-11T03:51:20+00:00

I frequently use HTML output in applications, up to now I’ve used some simple

  • 0

I frequently use HTML output in applications, up to now I’ve used some simple routines to build an HTML string. I want to try something different now:

I want to serialize the data to XML, and provide some XSLT templates to generate the HTML for the webbrowser control. I get that to work statically (slowly digging through writing XSL), but I’d need to change some attributes of the XSL document on the fly: filters, paths etc. to follow the current UI selection.

The data is small enough that the XML serialization on change should not be a problem. I’d like to use ‘static’ external XSL files (so that the user can customize the output to a certain extent), but adjust .

My questions:

Is this idea technically sound?
Can I feed a web browser control dynamically with XML and an XSL document? Can I modify selected path elements and attributes in the XSL on the fly (i.e. without generating a new file)? How to do that in a web browser control? (some pointers to get me started would be nice..)

[edit]Thanks folks, it’s working :D[/edit]

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T03:51:20+00:00Added an answer on May 11, 2026 at 3:51 am

    Usually the way to go is to provide parameters to the transform at runtime and writing the transform so that its behavior is controlled by the parameters.

    Usually when I do this, I only pass in one parameter – an XML document – and make the templates query it to determine what they should do. So you’ll see stuff like:

    <xsl:template match='*'>    <xsl:variable name='cfg' select='$config/*[name() = current()]'/>    <xsl:choose>       <xsl:when test='cfg/elementType = 'option''>          <xsl:apply-templates select='.' mode='option'>       <xsl:when test='cfg/elementType = 'optgroup''>          <xsl:apply-templates select='.' mode='optgroup'>       <xsl:when test='cfg/elementType = 'a''>          <xsl:apply-templates select='.' mode='a'> 

    and so on.

    It’s very straightforward to feed a WebBrowser control dynamically with XML/XSLT:

    using (XmlWriter xw = XmlWriter.Create(new StringWriter(output))) {     StringBuilder output = new StringBuilder();     XsltArgumentList args = new XsltArgumentList();     args.AddParam('config', myConfigXml);     myXslt.Transform(myXml, args, xw);     xw.Flush();     myWebBrowser.DocumentText = output.ToString(); } 

    If the UI that the user is updating is in the WebBrowser itself (that is, the HTML page contains HTML UI controls), you should be using dynamic HTML techniques, the same way you would if the page was being displayed in a normal browser. That’s a whole different bag of bananas.

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

Sidebar

Related Questions

No related questions found

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.