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

Re: mystery #3: rendering embedded HTML

Subject: Re: mystery #3: rendering embedded HTML
From: Gary Lawrence Murphy <garym@xxxxxxxxxx>
Date: 14 Apr 2002 13:45:36 -0400
sax multiple root elements detected
>>>>> "D" == David Carlisle <davidc@xxxxxxxxx> writes:

    >> <envelope>&lt;p&gt;My mal-formed HTML
    >> escaped.&lt;br&gt;</envelope>

    D> so you have an xslt processor that doesn't support
    D> dissable-output-encoding.  That's what happens with optional
    D> features.

I've replaced it with one that does, and discovered this is perhaps
not what I wanted anyway.  

The new error says the contents of that <envelope> is invalid:

  org.xml.sax.SAXException: Ill-formed XML document (multiple root
  elements detected)

which is true if value-of is parsing the string.  

This is what I meant earlier when I said that what I really wanted was
an "eval" function to resolve the entities back into the literal
chars: value-of/doe is doing this, but also parses the result, so
it only works if the markup is legal, and if the markup /was/ legal,
I wouldn't have needed to escape it in the first place ;)

I haven't actually tried this on the above 'envelope' example, but
this is the error I get from my posted example file when I d-o-e the
value-of select=//highlight -- value-of will fail because that element
contains valid HTML, but invalid XML.

When d-o-e is not enabled, the contents of that element is a single
text string.  When d-o-e is enabled, value-of is (probably correctly)
returning a node-set built from parsing the de-escaped element
contents.

Does this suggest that "value-of" is an inappropriate way to extract
markup-like strings from an element (because it parses what it reads)
and/or that d-o-e is an inapropriate way to "un-escape" an entity
escaped but otherwise literal string?  

Is 'x-www-form-urlencoding' at the source and display the only way to
do this?

-- 
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.