|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 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 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: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








