Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > HTML Tags in XMT/XSLT

Reply
Thread Tools

HTML Tags in XMT/XSLT

 
 
Spence Hackney
Guest
Posts: n/a
 
      09-11-2003
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!
 
Reply With Quote
 
 
 
 
ted
Guest
Posts: n/a
 
      09-11-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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!



 
Reply With Quote
 
 
 
 
Patrick TJ McPhee
Guest
Posts: n/a
 
      09-11-2003
In article <(E-Mail Removed) >,
Spence Hackney <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Spence Hackney
Guest
Posts: n/a
 
      09-12-2003
Thanks! This works like a charm!!!

Spence

(E-Mail Removed) (Patrick TJ McPhee) wrote in message news:<bjq1lh$ju1$(E-Mail Removed)>...
> In article <(E-Mail Removed) >,
> Spence Hackney <(E-Mail Removed)> 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"/>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
html tags within meta tags allowed? Donald Firesmith XML 5 01-08-2005 11:29 PM
JSP newbie - use include, custom tags, standard tags - or what? Mike Java 3 01-09-2004 09:30 AM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM
Custom Tags within Custom Tags. Ranganath Java 2 10-21-2003 06:14 AM



Advertisments