You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Mikel Astiz <ma...@ikasle.ehu.es> on 2006/04/28 13:16:22 UTC

Inserted carriage characters

Hi,

I have noticed that, during a transformation, some carriage return characters are insterted in the output XML tree. I my XML documents, the following two lines represent different data:

    xxxx<yyy/>
    xxxx <yyy/>

The whitespace that sepparates the text string and the element is important, and should neither be lost nor inserted. However, depending on the length of the line, Xalan inserts a carriage return after xxxx, and both lines can end up being exactly the same.

Is there any way to disable this feature?

Apologies if this problem doesn't concern to Xalan, but other XSLT processors don't show the same behaviour.

Mikel



Re: Inserted carriage characters

Posted by David Bertoni <db...@apache.org>.
Mikel Astiz wrote:
> Hi,
>  
> I have noticed that, during a transformation, some carriage return 
> characters are insterted in the output XML tree. I my XML documents, the 
> following two lines represent different data:
>  
>     xxxx<yyy/>
>     xxxx <yyy/>
>  
> The whitespace that sepparates the text string and the element is 
> important, and should neither be lost nor inserted. However, depending 
> on the length of the line, Xalan inserts a carriage return after xxxx, 
> and both lines can end up being exactly the same.
>  
> Is there any way to disable this feature?
>  

Please post a minimal stylesheet and input document that reproduces the 
problem you're seeing.  This might be a bug, or it might be a "feature," 
but without more information, it's impossible to say which.

Dave

Re: Inserted carriage characters

Posted by Mikel Astiz <ma...@ikasle.ehu.es>.
Yes, you are right. The responsible for the mentioned changes was not Xalan 
but Xerces (with "pretty print"), which is also being used. It was my fault 
to misunderstand the result of the test cases.

Thanks for your answer, David.

Mikel


----- Original Message ----- 
From: <da...@us.ibm.com>
To: <xa...@xml.apache.org>
Sent: Friday, April 28, 2006 4:30 PM
Subject: Re: Inserted carriage characters


> >However, depending on the length of the line, Xalan inserts a carriage
> return after xxxx, and both lines can end up being exactly the same.
> >Is there any way to disable this feature?
>
> To start with, you should have this in your stylesheet:
> <xsl:output indent="no"/>
> but the extra whitespace (of indent="yes") should only occur between tags
> where there would be no text other than whitespace.
> I don't think Xalan does anything "depending on the length of the line",
> so you might want to look at the output in various viewers to see what's
> really there.
> .................David Marston 


Re: Inserted carriage characters

Posted by da...@us.ibm.com.
>However, depending on the length of the line, Xalan inserts a carriage 
return after xxxx, and both lines can end up being exactly the same.
 >Is there any way to disable this feature?

To start with, you should have this in your stylesheet:
<xsl:output indent="no"/>
but the extra whitespace (of indent="yes") should only occur between tags 
where there would be no text other than whitespace.
I don't think Xalan does anything "depending on the length of the line", 
so you might want to look at the output in various viewers to see what's 
really there.
.................David Marston