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

generating human-readable HTML

Subject: generating human-readable HTML
From: Kevin Rodgers <kevin.rodgers@xxxxxxx>
Date: Tue, 1 Mar 2005 16:33:47 -0700
readable html
I know this is a softball for the experienced XSLT'ers, but I haven't
found the answer in the archives or the FAQ.  Basically I want to
preserve new lines that are present in my HTML literal result elements.
For example, here's an excerpt from my stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xhtml"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

<xsl:template match="report">
  <xsl:variable name="title" select="concat(header, ' ', issue)"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><xsl:value-of select="concat($title, ' Report')"/></title>
</head>
<body>
...
</body>
</html>
</xsl:template>

which generates the following (the ellipsis above contains an
xsl:apply-templates instruction and the ellipsis below is the resulting
table, which is fairly long and what I really want to be readable):

<html xmlns="http://www.w3.org/1999/xhtml"><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <title>INDUSTRY STANDARDS 20050301 Report</title></head><body>...</body></html>

I've tried adding a xml:space="preserve" attribute to the
xsl:stylesheet, xsl:template, and html elements, but to no avail: I
always get one long line of output.  Is this one of those things one is
just not supposed to do?

-- 
Kevin Rodgers

Current Thread

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.