RE: [xslt] whitespace around IMG tag



Sorry, I misunderstood your question.

I'm no XSLT guru, but libxslt's behavior seems reasonable, given that
indenting is on. It looks like it keeps an element all on one line if it has
at most one child. If an element has multiple children, it inserts a newline
after the start tag and another before the end tag. Any sort of
pretty-printing of SGML-derived documents (HTML, XML, etc) is as a rule
unsafe. It enhances readability (for humans) by introducing potentially
significant white space. In your shoes, I'd turn indenting off.

Others, more expert than I, may have other thoughts. (That's an invitation.)

> -----Original Message-----
> From: Novický Marek [mailto:novicky@aarongroup.cz]
> Sent: Wednesday, June 04, 2003 11:04 AM
> To: xslt@gnome.org
> Subject: RE: [xslt] whitespace around IMG tag
> 
> 
> I do not complain of IE here. I'm asking whether the 
> behaviour of libXSLT is ok when adding newline between <img> 
> and </div> when indenting output. 
> From my example 
> 
> <div><img /></div>
> 
> is transformed correctly as
> 
> <div><img></div>
> 
> but 
> 
> <div><img /><img /></div>
> 
> is transformed as
> 
> <div>
> <img><img>
> </div>
> 
> see the extra newlines, which I guess is not correct.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]