473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HTML Tags in XMT/XSLT

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!
Jul 20 '05 #1
3 5952
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).
"Spence Hackney" <ws******@yahoo.com> wrote in message
news:25**************************@posting.google.c om...
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!

Jul 20 '05 #2
In article <25**************************@posting.google.com >,
Spence Hackney <ws******@yahoo.com> 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
pt**@interlog.com
Jul 20 '05 #3
Thanks! This works like a charm!!!

Spence

pt**@interlog.com (Patrick TJ McPhee) wrote in message news:<bj**********@news.eusc.inter.net>...
In article <25**************************@posting.google.com >,
Spence Hackney <ws******@yahoo.com> 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"/>

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Leif K-Brooks | last post by:
I'm writing a site with mod_python which will have, among other things, forums. I want to allow users to use some HTML (<em>, <strong>, <p>, etc.) on the forums, but I don't want to allow bad...
2
by: Joe | last post by:
How would you preserve tags from an XML element in XSLT output.. Example: XML document has an ELEMENT "SECTION" allowing contained HTML This element might have an element such as <A...
2
by: Chris | last post by:
Im hoping someone can help me understand why this works? Requirement: Navigate DOM through javascript to perform DHTML actions. Issue: GIANT html document, up to 4MB in size, thousands and...
6
by: Mike P | last post by:
I am quite new to XML and XSLT, and I know you can apply XSLT to XML to display data in an XML file according to the XSLT file, but is it possible to apply an XSLT file to page/s of HTML, so that...
4
by: sysxperts | last post by:
Hi, I have a mail server that generates archives in a directory for every message sent or received and each archive has an associated XML file with <sender>, <receiver>, <subject> and other...
9
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP...
3
by: Rusty | last post by:
Hi, our intranet web site needs to add this feature. I've got the components but just need the last step to get it going. Here's the setup. 1) a user clicks on a link which calls a web service...
21
by: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post by:
It is common knowledge that XHTML is better HTML and you can serve XHTML content as HTML. However, the second statement is incorrect, for various reasons; it is enough to say that the HTML...
4
by: mark4asp | last post by:
I have an element, report which contains tags which have been transformed. E.g. <pis &lt;p&gt <myXml> <report>This text has html tags in it.&lt;p&gt which but <has been changed to &lt;&gt</report>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.