Re: [xsl] Generating beautiful HTML Source Code

Subject: Re: [xsl] Generating beautiful HTML Source Code
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx>
Date: Wed, 15 Oct 2003 11:25:28 -0700
Thanks for the tips.  So - don't set indent="yes" but to "no".  Hmmm... I
assumed this property was a feature to enable the whitespace which I
specifically *placed* there as in:

<xsl:template name="example">
     <block>    </block>


Wouldn't this property set "yes" preserve the above?
I would also let everyone know that I found the following note in the MSXML

Note   The Microsoft® XSLT processor will process all of a document's white
space only if the preserveWhiteSpace property has been set to True prior to
loading the document into the DOM. For more information, see How the MSXML
Processor Parses White Space.

I am determined to find a solution!  Wendell, your suggestions were fairly
complicated and I did not understand.  Might you illustrate a simple example
or lead me somewhere on the net that they are doing this?


----- Original Message -----
From: "Wendell Piez" <wapiez@xxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, October 15, 2003 9:30 AM
Subject: Re: [xsl] Generating beautiful HTML Source Code

> 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
> 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
> 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
> >have attempted to add a linebreak with &#10; and/or &#13; 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.      
> 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:

 XSL-List info and archive:

Current Thread