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

Re: Printing out variables with escaped text.

Subject: Re: Printing out variables with escaped text.
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Apr 2000 20:52:42 -0700
xsl print out variable
At 00/04/13 15:22 +1200, Warren Hedley wrote:
I'm having a problem printing out variables that contain text
declared with disable-output-escaping="yes" (and yes, I'm doing
dodgy stuff, trying to create start and end tags where I
shouldn't, before anyone tells me I shouldn't be doing this.)

Consider the following stylesheet - it surprised me that this
didn't work.

According to 16.4, "It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree. " ... and it doesn't say that this particular error reporting is optional, thus, the processor should have not allowed the text node with the attribute to be used in the variable assignment and reported an error.


To do what you ask with a variable, use the following:

  <xsl:variable name="bob">
    <xsl:text>&lt;fake_element_no_escaping&gt;
    </xsl:text>
  </xsl:variable>
  <xsl:value-of select="$bob" disable-output-escaping="yes"/>

I hope this helps.

.................. Ken

--
G. Ken Holman                    mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
Practical Transformation Using XSLT and XPath      ISBN 1-894049-04-7
Next instructor-led training:    2000-05-02,2000-05-11/12,2000-05-15,
-                                    2000-06-12,2000-06-13,2001-01-27


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.