HTML Tags in XMT/XSLT

Spence Hackney

Usenet Archive
Joined
Sep 11, 2003
Messages
6
Reaction score
0
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 (3)

Usenet Archive
Joined
Apr 11, 2002
Messages
31
Reaction score
0
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).
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
% 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
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top