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 February 10th, 2009, 04:33 PM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems transforming embedded html tags

I have this XML:
Code:
<document>
  <name>Example Title</name>
  <description>This is an example where the xml node happens to include html tags like <b>THIS</b> and click <a href='yahoo.com'>HERE</a> for more info.</description>
</document>
When I use the XSL:
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
  <body>
  <div>Name:<xsl:value-of select="document/name"/></div>
  <div>Description:<xsl:value-of select="document/description"/></div>
  </body>
</html>
The html tags do not get passed along since they are considered nodes and not text. Is there ANY way to pass along the HTML tags so the resulting page is formatted and includes the links? I know it's not the best XML structure, but it is a result of an export from a tool and I have little ability to modify it.
 
Old February 10th, 2009, 04:53 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use xsl:copy-of instead of xsl:value-of.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML tags issue.. atulshin XSLT 2 October 21st, 2008 03:57 AM
Render HTML tags jacksprophet XSLT 1 December 28th, 2006 07:03 PM
remove html tags lucian Dreamweaver (all versions) 1 November 14th, 2004 03:25 PM
HTML: <FORM> embedded in code valentino HTML Code Clinic 1 July 9th, 2003 10:05 AM
Eliminating HTML TAGs beyondforsaken VB How-To 12 June 12th, 2003 08:00 AM





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