xsl-list
[Top] [All Lists]

generating human-readable HTML

2005-03-01 16:33:47
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>