Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2008, 08:03 AM
Ron G Ron G is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default

How to use XSLT with XML that contains HTML source.?


I am writing a forum and using XSLT to print messages from it. Every message may contain XHTML tags.

Assume that every message is a valid XHTML in itself (every tag is properly closed, etc...). How do I output this embedded XHTML via the XSLT? The inner HTML tags get chopped by the transformation, and I only get the text itself.

Currently my XSLT looks something like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<table border="1">

<tr>
<td><strong>Title</strong></td>
<td><strong>Message</strong></td>
</tr>

<xsl:for-each select="message_list_2/message">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="body"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
Mike, I know how to link XML documents to XSLT. The problem is the XML contains elements that I want to keep in the translation, but they are lost. If a certain <body> element in the example contains "<b>foo</b>", I want to print this entire string, not just "foo".

Besides, I'm using a server-side XSLT engine, not that it matters in this case.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web design how-to and open source software...? toddsiegrist Software Design & Algorithms 0 05-07-2008 07:46 AM
Sprint, Clearwire to announce $12 bln JV: source (Reuters) Tech News Tech News 0 05-06-2008 10:08 PM
ASP, ASP.NET, JavaScript, XSLT, Converting dates in number format 5/10/2008 vixengraphix JavaScript 0 05-06-2008 05:04 PM
Besides PHP being free and open source, is it better then asp.Net or Coldfusion? bri0987 Cold Fusion 1 05-06-2008 05:00 PM
Using PHP to get a page's source/Emulate a browser? BicMan11 PHP 1 05-06-2008 12:59 PM

Your Ad Here

All times are GMT. The time now is 10:27 PM.