This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re:   vs  



>Hi all,
>
>I am using   in my sheets to insert a whitespace-
>however, in Michael Kay's excellent book, I came
>across &#xA0. They look like they do the same thing,
>but which is a more standard way of inserting an
>  in the resulting HTML?
>
They are exactly the same thing, i.e. the non-breaking space
character.  I get the impression   is used more often, but I
would not lose sleep over it.

>Also, do you think doing the following approach is
>better than the previous ones?
>
><xsl:variable name="space">
><xsl:value-of select=" ' ' " />
></xsl:variable>
>
>Now use $space to insert up to one space character in
>the resulting HTML.
>
I hope you don't mean $space as an alternative to &#160; or &#A0;.  A
space (written ' ' or &#x20; or &#32;) is not the same character as a
non-breaking space (written &#160; or &#A0;).

The other problem is you can't just say $space (or $nbsp) anywhere you
like.  You may end up having to put <xsl:value-of select="$space"/>.

What you can do is put a DOCTYPE declaration at the top of your
stylesheet, and define &nbsp; in it.  Then just write &nbsp; instead
of &#160;.  I'm sure this is in the FAQ somewhere - I'm not going to
write it from the top of my head as I'm bound to ge it wrong.

>I know this is not a very serious issue (meaning my
>implementation does not depend very heavily on the
>resolution of this issue) but any guidance will be
>greatly appreciated.
>
>Thanks,
>Cheers,
>Alan.
>

--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@melvaig.co.uk

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]