Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Whitespace in tags

From: John Gordon <gordon@-----.--->
To: NULL
Date: 7/2/2008 9:10:00 PM

In <486bb4f6$0$6607$9b4e6d93@n...> Martin Honnen <mahotrash@y...> writes:

> Which XSLT processor are you using?

I'm using the libxslt package in python.

> Obviously the snippet you posted can be reduced to
> <a href="{xyz}">
> </a>

Yes, I've changed to this shorthand method and it has helped.

> Are you sure the whitespace and the escaping does not result from 
> evaluating xyz and applying HTML href escaping?

I thought it might be an href escaping issue, but then I noticed the
same thing happening when I was setting a variable and then using the
value in a hidden form input element, like so:

<xsl:variable name="actionType">
	<xsl:choose>
		<xsl:when test="something">
			someValue
		</xsl:when>
		<xsl:otherwise>
			someOtherValue
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

...

<form>
	<input type="hidden" name="actionType">
		<xsl:attribute name="value">
			<xsl:value-of select="$actionType" />
		</xsl:attribute>
	</input>
</form>

The value of the form element contained the embedded newline and tabs.
When I changed the hidden form element to use the shorthand {} notation
the problem still persisted; it was only fixed by editing the variable
declaration and removing all the whitespace between the beginning and
ending <xsl:when> and <xsl:otherwise> tags, like so:

<xsl:variable name="actionType">
	<xsl:choose>
		<xsl:when test="something">someValue</xsl:when>
		<xsl:otherwise>someOtherValue</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@p...              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"



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