Subject: RE: [xsl] Collapsing run-on tag chains not working in saxon or xa lan From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx> Date: Tue, 2 Nov 2004 10:45:28 -0600 |
Hi all, 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." 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. That's why we prefer to use long one-liners without whitespace and CRs - ugly, but necessary. Cheers, <prs/> -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Tuesday, November 02, 2004 7:08 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] Collapsing run-on tag chains not working in saxon or xalan The processor API is outside the control of the XSLT specification. If Microsoft want to define a method called transform() whose semantics are 1. parse the XML and build a DOM tree 2. strip spaces from the DOM tree 3. convert the DOM tree to an XPath OM tree 4. run an XSLT transformation on the XPath OM tree then (regrettably) there is nothing you or I can do to stop them. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Colin Paul Adams [mailto:colin@xxxxxxxxxxxxxxxxxx] > Sent: 02 November 2004 10:12 > To: Michael Kay > Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] Collapsing run-on tag chains not working in saxon > or xalan > > >>>>> "Michael" == Michael Kay <mike@xxxxxxxxxxxx> writes: > > >> XSLT 1.0 is 100% clear on this. > >> > >> Microsoft are in violation of the standard. > > Michael> Sorry, but that's not 100% clear. > > It is to me. > > Michael> in any particular way. There is specific mention in the > Michael> XSLT 1.0 spec of the possibility of starting from a DOM, > Michael> and the question of whether or not the DOM retains > Michael> whitespace that was in the original XML source (if there > Michael> was an original XML source) is completely outside the > Michael> scope of the XSLT spec. > > But if there WAS an original XML source, then you have NOT started > with a DOM. > Starting with a DOM means building your DOM with calls like > createDocument and createNode (if I remember the names correctly). > > English cannot bear the interpretation that starting with B means > starting with A and then creating B from it. > -- > Colin Paul Adams > Preston Lancashire
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Intro, Thomas Vanparys | Thread | Re: [xsl] Collapsing run-on tag cha, David Carlisle |
[xsl] Intro, Thomas Vanparys | Date | [xsl] compare out of context?, Thomas Vanparys |
Month |