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

mystery #3: rendering embedded HTML

Subject: mystery #3: rendering embedded HTML
From: Gary Lawrence Murphy <garym@xxxxxxxxxx>
Date: 13 Apr 2002 01:54:36 -0400
embedding html in textarea
The last mystery for me for one day ;) -- this one I've heard can be
done with msxml extensions, but I'd prefer a portable solution:

Can I restore HTML that has been encoded as CDATA escaped PCDATA?

Here's a scenario: Users enter free-hand (often broken) HTML into a
webform textarea edit box. Their text is wrapped in an XML envelope,
their HTML enclosed by <![CDATA[ ]]> to escape all the <>& chars and
so the broken markup will parse.  This envelope XML document is
stored, transported, retrieved and unpacked so the original
user-entered HTML can be displayed on a weblog.  This is more or less
the inverse of "disable-output-escaping": I don't want to pass literal
chars, I need to resolve entities _back_ to their literal chars.

In pure Java (JDOM/Jaxen/XPath), I can xpath the text node and print
its contents to the servlet output stream; the result will be the
HTML I expect to see and renders correctly in the browser.

In XSL, the <>& chars remain escaped; the html appears as its codes.

Is there a portable way to 'eval' a value-of string to undo the effect
of CDATA escaping?  Is this the best way to embed HTML into an XML
document?

-- 
Gary Lawrence Murphy <garym@xxxxxxxxxxx> TeleDynamics Communications Inc
Business Innovations Through Open Source Systems: http://www.teledyn.com
"Computers are useless.  They can only give you answers."(Pablo Picasso)


 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.