Dataset to XSL Transform not displaying HTML--only XML

  • Thread starter Anthony Harkness-Gripe
  • Start date
A

Anthony Harkness-Gripe

This is a very simple XSLT, and I'm doing it ways that I've had work
before, but it's not displaying HTML. Is there a flaw in my logic?

C#:
-------------------------------------------------------------------
// context is current HttpContext
System.Xml.XmlTextWriter xmlw = new
XmlTextWriter(context.Response.Output);

// See XML below for CustomDataSet
XmlDataDocument xmlData = new XmlDataDocument(customDataSet);

XslTransform xslt = new XslTransform();

// Location of file is correct
xslt.Load(@"http://localhost/lender/Testimonial.xslt");

xslt.Transform(xmlData,null,xmlw);
------------------------------------------------------------------


XML (from customDataSet):
------------------------------------------------------------------
<TestimonialData xmlns="http://tempuri.org/TestimonialData.xsd">
<testimonial>
<testimonialid>4</testimonialid>
<siteid>2</siteid>
<body>Hello there</body>
<person>Joe Blow</person>
</testimonial>
</TestimonialData>
------------------------------------------------------------------

Testimonial.xslt
------------------------------------------------------------------
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/TestimonialData">
<xsl:for-each select="testimonial">
<table>
<tr>
<td>
<xsl:value-of select="body" />
<xsl:value-of select="person" />
</td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-------------------------------------------------------------------

Actual Output on HTML page (from ASPX):
42Hello thereJoe Blow



It looks like it's not transforming the data at all, just outputting
the XML. Any ideas at all?

Thanks in advance

Anthony
 
Joined
Jul 8, 2008
Messages
1
Reaction score
0
Did you ever find the answer? I get the same result and I've been on this problem for days!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top