Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL and Whitespace

From: "Marrow" <marrow@---------.--.-->
To: NULL
Date: 11/1/2004 10:54:00 AM
Hi,

> Hi,
>
> Setting the output method to 'text' may solves the ampersand and the
superfluous wittespaces, but the 'a' element and it's attribute will not be
outputted. (http://www.w3.org/TR/xslt.html#section-Text-Output-Method)
> I don't think it makes sense to output 'text' if you're actually dealing
with 'html'. Moreover you'd have to have to strinyfy all element and
attributes throughout the stylesheet, a really bad idea if you ask me.
> If this 'hack' really is the only way around it, don't you agree that this
is a shortcomming in the XSLT1.0 Recommendation?

I did not mention the output method at all! - merely pointed to the correct
and safe way of outputting text nodes using the <xsl:text> instruction.
This is no hack whatsoever, and there is not shortcomming in the W3 rec
regarding this issue.  It is known by all seasoned XSLT programmers that the
first step towards taking firm control of whitespace (in whatever output
mode) is to avoid using implicit text node output and opt for using explicit
text node output using the <xsl:text> instruction.  The <xsl:text>
instruction is there for a reason - one of which being so that explicit
output text nodes can be differentiated from whitespace text nodes in the
stylesheet that are merely there to 'prettify' the stylesheet for
readability (which might otherwise be assumed by the XSLT transformation as
text nodes for output).

I can only suggest you re-read my original posting again ;)  If you read it
carefully you will notice there is no mention of the output mode and gives
clear example code on using the <xsl:text> instruction.

Cheers
Marrow

"Joris Gillis" <roac@p...> wrote in message
news:opsgr3mvnfyf9v9r@n......
> > The reason you are seeing whitespace in the attribute output is because
you
> > are using implied output text.  As soon as you use implied output text -
> > that implied output text will also include any whitespace (inc. tabs,
CRs
> > etc.).
> >
> > You can overcome this by using explicit output text (and it's best to
get
> > into the habit of using explicit output text), e.g.
> > The ampersands are being correctly recognised and are being URL encoded
> > according to the HTML/XHTML specs.
>
> Hi,
>
> Setting the output method to 'text' may solves the ampersand and the
superfluous wittespaces, but the 'a' element and it's attribute will not be
outputted. (http://www.w3.org/TR/xslt.html#section-Text-Output-Method)
> I don't think it makes sense to output 'text' if you're actually dealing
with 'html'. Moreover you'd have to have to strinyfy all element and
attributes throughout the stylesheet, a really bad idea if you ask me.
> If this 'hack' really is the only way around it, don't you agree that this
is a shortcomming in the XSLT1.0 Recommendation?
>
> regards,
> -- 
> Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
> Ceterum censeo XML omnibus esse utendum




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent