[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] output escaping (i just dont get it)
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 & That</h2> and when heading == "This & That" the output is <h2>This &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 & 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 & That" the output is <h2>This & That</h2> So now i am REQUIRED to use '&' 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|