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

Re: parsing XML string that consists of special charac

Subject: Re: parsing XML string that consists of special character
From: RSuiter@xxxxxxxxx
Date: Tue, 20 Mar 2001 09:53:03 -0600
parse xml string
Olga,

>I have XML string that can consist of characters like <,>,&

If your strings contain < or &, then they aren't xml, because these
characters are reserved for special use in xml (namely as the beginning of
a tag and the beginning of an entity name, respectively).  Therefore, you
will have to preprocess your strings before you can parse it using xml or
xslt.
There are three options:
   "escape" all the < and & characters by replacing them with &lt; and
   &amp; respectively (note, the semi-colons are part of the replacements).
   enclose the fields you pull from the database in so-called CDATA tags,
   which are <!CDATA[ at the beginning and ]]> at the end.  This will work
   except for the unusual case where your data contains ]]> anywhere.
   disable-output-escaping (very rarely necessary, and usually a sign of
   insufficient understanding of the original problem).

This is a widely discussed problem, both on this list and elsewhere.

Rick Suiter





 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.