[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: include html in xsl

Subject: Re: include html in xsl
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 09 Apr 2006 09:02:50 -0400
xslt include html
At 2006-04-08 12:26 +0530, Mygrp wrote:
havent tried cdata.
im using something like this:

<xsl:copy-of select="document('/home/khel/scoresphp/iscore/html/topnav.html')"/>
can i enclose the above in the cdata section?

The XSLT 1.0 document() function will not accept HTML as an input ... only XML, but it looks from your next post that you've solved that issue.


At 2006-04-09 09:15 +0530, Mygrp wrote:
I tried embedding the html in cdata section, but the result is the
html is html is not interpreted and is displayed as text!!

Yes, because you are just emitting angle brackets, you aren't emitting markup.


This is the use case for disable-output-escaping ... when you have XML wrapping HTML (whether or not the HTML is in a CDATA, however it is in there must be well formed or you wouldn't have XML) you need to have the result serialized as markup, not as text:

If your input were:

  <doc>
   <![CDATA[<html><body><p>Hello</p></body></html>]]>
  </doc>

You would use:

<xsl:value-of select="doc" disable-output-escaping="yes"/>

I hope this helps.

. . . . . . . . . . Ken


-- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 Also for XML/XSLT/XSL-FO training: Birmingham, UK 2006-05-22/25 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread
  • include html in xsl
    • Mygrp - 8 Apr 2006 06:10:46 -0000
      • David Adams - 8 Apr 2006 06:34:30 -0000
        • Mygrp - 8 Apr 2006 06:56:44 -0000
        • Mygrp - 9 Apr 2006 03:45:40 -0000
          • Message not available
          • G. Ken Holman - 9 Apr 2006 13:03:23 -0000 <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.