HTML Tags in XMT/XSLT

S

Spence Hackney

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!
 
T

ted

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).
 
P

Patrick TJ McPhee

% 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"/>
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top