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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:03:18+00:00 2026-06-10T00:03:18+00:00

My output from this transformation only includes the text, but I want the HTML

  • 0

My output from this transformation only includes the text, but I want the HTML and text output. What do I need to change to do that?

I’m using VS 2010

current example output:

Jones Martin Kelley Marshall

Note I have this in the xsl too, but it wasn’t showing in my code example:

 xsl:output
    standalone="no"
    method="xml"
    indent="yes"
    omit-xml-declaration="no"
    version="1.0" 

xsl:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">

    <xsl:for-each select="/people">

      <div class="lastnames">
        <ul>
          <li>
            <xsl:value-of select="lastname" disable-output-escaping="yes" />
          </li>
        </ul>
      </div>

    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

C#:

XslCompiledTransform xslt = new XslCompiledTransform();

xslt.Load(xslPath);

using (XmlWriter writer = XmlWriter.Create(outPath + 
                                          fileName + 
                                          "." +
                                            fileExt
                                         , xslt.OutputSettings))
{
    xslt.Transform(fileNode, null, writer);
    writer.Flush();
    writer.Close();
}
  • 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-10T00:03:20+00:00Added an answer on June 10, 2026 at 12:03 am

    This simple transformation:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="people">
      <div class="lastnames">
       <ul>
         <xsl:apply-templates/>
       </ul>
      </div>
     </xsl:template>
    
     <xsl:template match="lastname">
      <li><xsl:apply-templates/></li>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied on this XML document (non has been provided !!!):

    <people>
     <lastname>Jones</lastname>
     <lastname>Martin</lastname>
     <lastname>Kelley</lastname>
     <lastname>Marshall</lastname>
    </people>
    

    produces the wanted, correct result:

    <div class="lastnames">
      <ul>
        <li>Jones</li>
        <li>Martin</li>
        <li>Kelley</li>
        <li>Marshall</li>
      </ul>
    </div>
    

    And it is displayed by the browser as expected:

    • Jones
    • Martin
    • Kelley
    • Marshall
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using following code but cannot return data from MySQL. This is the output:
I have a variable which I get from database I want to output this
I would like to know how I can show the output from this piece
I am trying to debug a segfault, and I have this output from gdb:
This is the xml I got as an output from the WriteXmlString() of Infragistics
How can you get 1 as an output from #2? #1 I ran this
Basically, this question with a difference... Is it possible to capture print output from
How do I execute an output piped from a bash script? I got this
I have different php output in jQuery-based tabs. This output is formed from database
So I call this PHP script from the command line: /usr/bin/php /var/www/bims/index.php projects/output and

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.