XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Doug DomenySubject: Problem with whitespace with built-in processor
Author: Doug Domeny
Date: 31 Aug 2004 10:24 AM
The built-in processor, I believe, has a defect in how it handles whitespace
when indenting. That is, when the output tag has indent="yes":

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

If a tag is emitted following a text node, the tag should not be indented,
but it is. The built-in processor is smart enough to NOT indent AFTER a
tag that is followed by a text node. For example, the following is output

<xlf:source>Enter the
<xlf:g id="id582F690" ctype="link">body</xlf:g> text of your XHTML document here
</xlf:source>

It should be:

<xlf:source>Enter the <xlf:g id="id582F690" ctype="link">body</xlf:g> text of your XHTML document here</xlf:source>

This will properly preserve the whitespace around text nodes without adding
extra spaces and line breaks.

I primarily use the MSXML 4.0 processor that does not have this problem.

Posttop
Alberto MassariSubject: Problem with whitespace with built-in processor
Author: Alberto Massari
Date: 06 Sep 2004 05:54 PM
Hi Doug,
first of all, I'm sorry it took us so long to answer your post.

Unfortunately the specs for <xsl:output method="xml" indent="yes">
are not mandatory about its implementation, as they are full of "may",
"should" instead of using "must".
Quoting from the specs: "If the indent attribute has the value yes,
then the xml output method may output whitespace [...]
The xml output method should use an algorithm to output additional
whitespace [...]
NOTE: It is usually not safe to use indent="yes" with document types
that include element types with mixed content"

I agree with you that the suggested behavior of the "indent" alghoritm
is what you are expecting (no addition whitespace after the "Enter the"
words); but MSXML is the only processor generating this output, while
all the others (XalanJ, Saxon and even the newer MSXML .NET one) have
choosen to add the whitespace in that position.

So, in this case, also given the fact that MSXML is no more supported
by Microsoft, we choose to align with the behavior of the rest of
the XSLT processors available on the market.

Hope this answer is satisfactory,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.