xsl-list
[Top] [All Lists]

RE: Collapsing run-on tag chains not working in saxon or xa lan

2004-11-02 10:50:20
Pieter,

At 11:45 AM 11/2/2004, you wrote:
There is a utility called msxsl.exe that can be used to strip or preserve
whitespace (it's not a new tool, and works as a wrapper for MSXML 3 and 4):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxml/html/
msxsl.asp

Check for the -xw option:

"White Space Stripping (-xw Option)
The -xw option instructs MSXSL to strip non-significant white space from the
input XML document during the load phase (preserveWhitespace set to False).
Enabling this option can lower memory usage and improve transformation
performance while, in most cases, creating equivalent output."

Thanks for posting the reminder: it's nice to be able to run MSXSL and get proper results.

Do you know of any way of disabling the option when just opening XML natively in IE, with an xml-stylesheet PI?

Personally, in some cases, I don't see a problem in stripping the white
space; in fact, in the HTML world, stripping white space can even optimize
the way browsers renders a given page. Extra whitespace between elements
(and carriage returns) can introduce differences at the pixel render
position level.

It's the "in some cases" that bites. It's really terrible to see HTML come out like

<p>Here's my <b>extra</b><i>special</i> HTML page</p>

... because the space that was there (between the elements rendered as b and i) happens to be treated like a case where we wouldn't see a problem.

 That's why we prefer to use long one-liners without
whitespace and CRs - ugly, but necessary.

Whitespace control in the stylesheet, as Mike just reminded us, is an entirely different thing. Providing you use <xsl:text> and <xsl:output> properly, you can use all the whitespace you like, in the stylesheet, without getting any extra space in the output.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
======================================================================



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