Re: [xsl] XSL 2.0 and .NET and VB

Subject: Re: [xsl] XSL 2.0 and .NET and VB
From: "M. David Peterson" <m.david@xxxxxxxxxxxxx>
Date: Sun, 01 Jul 2007 06:57:44 -0600
On Sun, 01 Jul 2007 06:06:11 -0600, Florent Georges
<darkman_spam@xxxxxxxx> 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

Current Thread