Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2008, 09:18 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display as HTML

Hi i have created a DOM object using java. In this i have a description element created which actually has HTML tags.
I have used the following line
Code:
desc.appendChild(xmlDoc.createTextNode("<p><strong>this is a test</strong></p><p>Second line</p>"));
When I use XSL and try to display the content using
Code:
<xsl:value-of select="desc" disable-output-escaping="yes" />
it displays as textual data i.e. if i view the source all the '<' and '>' are converted to '&lt;' and '&gt'. I actually dont want this. I want to remain as entered so that when displayed it displays the content as rich text, in this case bold and in seperate lines.

could anyone suggest how this can be done.

Thanks a lot in advance

 
Old March 6th, 2008, 09:27 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Best approach is to create a more sensible document in the first place: having markup within a text node, rather than having a nested structure of element nodes, is not a good way to represent your data.

If you really must do it that way, then serializing using disable-output-escaping should work, provided that it's supported in the environment where you are using it. It doesn't work everywhere.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
display out of order html elements? chobo XSLT 2 April 1st, 2008 02:28 AM
How to display an html file inside Iframe --need u vishnu108mishra BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 November 16th, 2007 04:52 AM
Display field containing data in HTML format hui2602 Reporting Services 0 April 27th, 2006 04:35 AM
Html Table Display with images Jorge HTML Code Clinic 8 April 13th, 2005 12:21 AM
Display html on another computer Lionel_Neo General .NET 2 October 13th, 2004 02:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.