HTML Tags in XMT/XSLT

Discussion in 'XML' started by Spence Hackney, Sep 11, 2003.

  1. I am using ASP.NET to get XML data from a database, style it with an
    XSLT, and then display it as HTML to a browser. The content in the
    database, which becomes my XML, has HTML tags embedded in it. When
    putting the data from the database into an XML stream, the ASP.NET
    class automatically escapes all my HTML tags for me so that it will be
    valid XML.

    Here is my problem...after my XSLT transforms the XML into HTML my
    embedded HTML tags are still escaped, thus they are displayed to the
    browser.

    I can think of a couple ways to do this, all too complex and slow to
    be the best way. Can anyone offer a good strategy for this? This
    must be something folks do all the time!
    Spence Hackney, Sep 11, 2003
    #1
    1. Advertising

  2. Spence Hackney

    ted Guest

    I have the same problem and I've yet to come across a good solution (BTW I'm
    using Java, not .NET.)

    What I'm doing now is using Perl to get the XML into the database (not
    parsing the XML, just grabbing it as plain text).


    "Spence Hackney" <> wrote in message
    news:...
    > I am using ASP.NET to get XML data from a database, style it with an
    > XSLT, and then display it as HTML to a browser. The content in the
    > database, which becomes my XML, has HTML tags embedded in it. When
    > putting the data from the database into an XML stream, the ASP.NET
    > class automatically escapes all my HTML tags for me so that it will be
    > valid XML.
    >
    > Here is my problem...after my XSLT transforms the XML into HTML my
    > embedded HTML tags are still escaped, thus they are displayed to the
    > browser.
    >
    > I can think of a couple ways to do this, all too complex and slow to
    > be the best way. Can anyone offer a good strategy for this? This
    > must be something folks do all the time!
    ted, Sep 11, 2003
    #2
    1. Advertising

  3. In article <>,
    Spence Hackney <> wrote:

    % I am using ASP.NET to get XML data from a database, style it with an
    % XSLT, and then display it as HTML to a browser. The content in the
    % database, which becomes my XML, has HTML tags embedded in it. When
    % putting the data from the database into an XML stream, the ASP.NET
    % class automatically escapes all my HTML tags for me so that it will be
    % valid XML.
    %
    % Here is my problem...after my XSLT transforms the XML into HTML my
    % embedded HTML tags are still escaped, thus they are displayed to the
    % browser.

    Assuming you're using xsl:value-of to write out the html data, try

    <xsl:value-of select="whatever" disable-output-escaping="yes"/>
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Sep 11, 2003
    #3
  4. Thanks! This works like a charm!!!

    Spence

    (Patrick TJ McPhee) wrote in message news:<bjq1lh$ju1$>...
    > In article <>,
    > Spence Hackney <> wrote:
    >
    > % I am using ASP.NET to get XML data from a database, style it with an
    > % XSLT, and then display it as HTML to a browser. The content in the
    > % database, which becomes my XML, has HTML tags embedded in it. When
    > % putting the data from the database into an XML stream, the ASP.NET
    > % class automatically escapes all my HTML tags for me so that it will be
    > % valid XML.
    > %
    > % Here is my problem...after my XSLT transforms the XML into HTML my
    > % embedded HTML tags are still escaped, thus they are displayed to the
    > % browser.
    >
    > Assuming you're using xsl:value-of to write out the html data, try
    >
    > <xsl:value-of select="whatever" disable-output-escaping="yes"/>
    Spence Hackney, Sep 12, 2003
    #4
    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. Dean H. Saxe
    Replies:
    0
    Views:
    1,030
    Dean H. Saxe
    Jan 3, 2004
  2. Rob Nicholson
    Replies:
    3
    Views:
    727
    Rob Nicholson
    May 28, 2005
  3. SDM
    Replies:
    2
    Views:
    548
  4. Joe
    Replies:
    2
    Views:
    500
  5. Donald Firesmith

    html tags within meta tags allowed?

    Donald Firesmith, Jan 5, 2005, in forum: XML
    Replies:
    5
    Views:
    894
    Andy Dingley
    Jan 8, 2005
Loading...

Share This Page