[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Karl,
In other words, you are interested in taking responsibility for the serialization of HTML results yourself, not letting your built-in serializer make whatever its designers considered to be very attractive....
There are many ways to approach this. One simple one is to use
<?xsl:output indent="no"/>
plus careful use of the xsl:strip-space and xsl:preserve-space top-level elements, to make sure no unwanted whitespace gets into your result, and then run a second pass over your (X)HTML to insert whitespace only where you want it -- this pass can create either XHTML or HTML 4.0.
Whitespace can be tricky since unwanted whitespace can come from any of:
a. the source document (if you didn't strip it, it's in your XPath tree and may be getting copied)
b. the stylesheet (if you're not careful and don't understand how whitespace in the stylesheet works)
c. the serializer (if you have indent="yes", the serializer is allowed to do this)
Getting nicely formatted output requires managing all three.
At 10:56 AM 10/15/2003, you wrote:
Are you using MSXML? It has an ... "issue" ... with whitespace-only text nodes. :->
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Re: [xsl] Generating beautiful HTML Source Code
Subject: Re: [xsl] Generating beautiful HTML Source Code From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 15 Oct 2003 12:30:16 -0400 |
Karl,
In other words, you are interested in taking responsibility for the serialization of HTML results yourself, not letting your built-in serializer make whatever its designers considered to be very attractive....
There are many ways to approach this. One simple one is to use
<?xsl:output indent="no"/>
plus careful use of the xsl:strip-space and xsl:preserve-space top-level elements, to make sure no unwanted whitespace gets into your result, and then run a second pass over your (X)HTML to insert whitespace only where you want it -- this pass can create either XHTML or HTML 4.0.
Whitespace can be tricky since unwanted whitespace can come from any of:
a. the source document (if you didn't strip it, it's in your XPath tree and may be getting copied)
b. the stylesheet (if you're not careful and don't understand how whitespace in the stylesheet works)
c. the serializer (if you have indent="yes", the serializer is allowed to do this)
Getting nicely formatted output requires managing all three.
At 10:56 AM 10/15/2003, you wrote:
Currently, my HTML source code is a random "SPLAT" of code.... and where I have attempted to add a linebreak with and/or it is usually unsuccseful, as well, it seems my preserve-space elements are ignored. I only seem to be able to get a line break when I do:
<xsl:text>
<xsl:text>
Are you using MSXML? It has an ... "issue" ... with whitespace-only text nodes. :->
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Generating beautiful HTML, M. David Peterson | Thread | Re: [xsl] Generating beautiful HTML, Karl J. Stubsjoen |
Re: [xsl] XML Rendering, Wendell Piez | Date | Re: [xsl] Utilizing dual processors, klaus e. werner |
Month |