Dataset to XSL Transform not displaying HTML--only XML

Discussion in 'ASP .Net' started by Anthony Harkness-Gripe, Aug 14, 2003.

  1. 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
     
    Anthony Harkness-Gripe, Aug 14, 2003
    #1
    1. Advertising

  2. Anthony Harkness-Gripe

    itnrant

    Joined:
    Jul 8, 2008
    Messages:
    1
    Did you ever find the answer? I get the same result and I've been on this problem for days!
     
    itnrant, Jul 8, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KathyB
    Replies:
    0
    Views:
    1,029
    KathyB
    Jun 25, 2003
  2. Barry Anderberg
    Replies:
    2
    Views:
    595
    Chris Barber
    Apr 8, 2004
  3. Johannes Koch
    Replies:
    0
    Views:
    851
    Johannes Koch
    Jul 2, 2003
  4. Marrow
    Replies:
    0
    Views:
    4,147
    Marrow
    Jul 2, 2003
  5. Barry Anderberg
    Replies:
    1
    Views:
    1,243
    Chris Barber
    Apr 8, 2004
Loading...

Share This Page