[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

output escaping (i just dont get it)

Subject: output escaping (i just dont get it)
From: "McKeever, Marty" <marty.mckeever@xxxxxxxxxxxxxxxxx>
Date: Fri, 26 Oct 2001 09:16:25 -0400
i dont get list
I found the "solution" to my question in this old thread,
http://www.biglist.com/lists/xsl-list/archives/200008/threads.html#00389

but i still dont quite understand what's going on here.  

The scenario:
my template rule is
<h2><xsl:value-of select="$heading"/></h2>
where $heading is an external parameter being passed into the transformer
(xalan).

when heading == "This & That"
the output is <h2>This &amp; That</h2>
	and
when heading == "This &amp; That"
the output is <h2>This &amp;amp; That</h2>

So my real question is, why is the & 'legal' when passed as an external
parameter, when it would obviously be illegal as an internal param, ie:
<xsl:param name="heading">This & That</xsl:param> ??

I would have thought that all 'input' strings would have to be well-formed
for the transformation to take place.  

And why is the & automaticaly converted to &amp; in this situation, but not
others?

Anyway, to get the result that i wanted, i changed the rule as follows:
<h2><xsl:value-of select="$heading" disable-output-escaping="yes"/></h2>
so
when heading == "This &amp; That"
the output is <h2>This &amp; That</h2>

So now i am REQUIRED to use '&amp;' in the param, because '&' throws the
well-formedness error i was expecting all along.

I just dont get WHY...





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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.