On Sun, 01 Jul 2007 06:06:11 -0600, Florent Georges
<darkman_spam(_at_)yahoo(_dot_)fr> wrote:
The other point to use xsl:text is to not have non intended
whitespace in the output when you "indent" the stylesheet and have a
"well-indented" stylesheet where a string is surrounded by spaces and
newlines. The human eye is used to strip white spaces in XML, so you
not always see them:
Excellent point! I ran into this just the other day[1] building out a
solution[2] for testing the redirects for a newly installed instance of
MovableType in which included content from an old install of MovableType,
changing the URI's of the old content to a new URI scheme. The problem
was with the .htaccess file for doing the redirect. By using just
"RedirectPermanent <xsl:value-of select="$old-uri"/> <xsl:value-of
select="$new-uri"/>" it would output the white-space preceding the
"RedirectPermanent" in the tranformation file, something I avoided by
using concat() to build the string out manually. Of course, with a
.htaccess file the white-space is ignored, so this was really more from a
personal aesthetics standpoint, but the point of taking control over the
text output using xsl:text or some other manner such as concat() is an
important lesson to both learn and understand the importance of.
[1] http://www.oreillynet.com/xml/blog/2007/06/lessig_20_v2_now_live.html
[2]
http://extf.googlecode.com/svn/trunk/WebApp/transform/controller/test/movable-type-conversion.xsl
--
/M:D
M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 |
http://dev.aol.com/blog/3155
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--