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

RE: Preserve HTML formatting when apply-templates in

Subject: RE: Preserve HTML formatting when apply-templates in variabl
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Aug 2004 08:17:34 -0700
disable output escaping apply templates
David:
Wow!  This works:
    <xsl:copy-of select="$ui_review"/>

Problem solved (and lesson learned).

Question:
Can you think of a sensible use of "disable-output-escaping"?  Wow, thinking
about all the uses I've made of it and now thinking that they all
should/could become copy-of(s).  Hmmmm... thanks for the re-alignment David.

Karl

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Friday, August 06, 2004 7:33 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Preserve HTML formatting when apply-templates in
variabl



  The reason I did not include the last template is because I was testing
the
  result of the template match "review" by writing out my variable like
this:

<hr/>
  <xsl:value-of select="$ui_review" disable-output-escaping="yes"/>
<hr/>

bad idea:

Using value-of always produces the _string_value_ and as its a string it
never produces any markup in the result, XSLT coerces element nodes to a
string by forgetting the elements and just taking the character data.

You want copy-of not value-of

secondly it's always a bad idea to use disable-output-escaping. Unless
you are in very special circumstances (such as not producing XML at all)
Then it's almost always a sign of an error in the design somewhere.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.