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

RE: Re[2]: How do you un-escape in HTML

Subject: RE: Re[2]: How do you un-escape in HTML
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Fri, 12 Dec 2003 22:30:39 +0100
xml percentage
> -----Original Message-----
> From: Arthur Maloney

<snip />
> I've traced this back to MSXML4 both sp1 & sp2.
>
> Should it behave like this, or is this a bug of some kind?
>
> In my code: fld is a field in an adodb recordset from an SQL
> Server 2000 Database
>             eltColumn is a document element MSXML2.IXMLDOMElement
>

<snip />
>
> This is converted to  valid xml content
>      strColValue= "allowed on &apos;background-position&apos;"
>
> Which I think is correct XML.
>

Yes it is, but not to feed into a DOM, which does its own escaping when it
meets the ampersand.

> When I look at whats inside using text method.
>
>      ? eltColumn.text
>      allowed on &apos;background-position&apos;
>

Yes, because the text-method would un-escape again.

> This agrees with my input.
>
>
> However when I use the xml method it is double escaped?.
>
>      ?eltcolumn.xml
>      <percentage>allowed on
> &amp;apos;background-position&amp;apos;</percentage>
>

And here you get the 'raw' xml data of the node, exactly as you entered it.

(Besides that: the original VB snippet you sent also has a quite dangerous
form of double escaping going on. If you really need to implement your own
routines for this, it would be advisable to escape the ampersands first,
then the others...)

Cheers,

Andreas


 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.