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

Re: Space at start of result.

Subject: Re: Space at start of result.
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Tue, 20 Jun 2000 18:59:20 +0100
blank lines beginning xsl result
Bruce,

>I am writing a servlet that processes an XML file, and returns HTML to the
>browser (Started with sample SaxonServlet).
>
>However, the servlet is inserting a blank line at the start of the result
[snip]

I don't think that there's anything that says that HTML cannot have a blank
line at the start, and IE5 at least does seem to display the HTML fine with
one.  The best solution would probably be to have your users upgrade their
version of IE, but I guess that may not be feasible.

As far as why is concerned, SAXON puts a blank line at the beginning of its
output when it does not output an XML Declaration.  It doesn't output an
XML Declaration if the output method if HTML.  The output method is HTML if
it is either set by the 'method' attribute on xsl:output or if the document
element of the output is an 'html' element.

As far as a workaround is concerned, if you want to get rid of the blank
line you can make it output an XML Declaration by setting the output method
to 'xml' using the 'method' attribute of the xsl:output element, thusly:

  <xsl:output method="xml" />

As long as the extension for the output file is .html, the file will still
be interpreted as HTML by IE5, though I'm not sure for Netscape and
obviously the earlier versions of IE might react even worse to an XML
declaration than they do to a blank line!

The other thing would be to ask Mike Kay to change SAXON so that it doesn't
output the blank line, I guess.

Sorry not to be of more help,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.