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

Re: Escaping/converting special characters

Subject: Re: Escaping/converting special characters
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Mon, 29 Oct 2001 03:12:18 -0800
perl escape special characters
At 02:45 29-10-2001, Ross Kendall wrote:
On some files I get special characters (eg '£') which cause parse errors
when trying to transform my (not quite valid) XML.  What I need to know is
how can easily convert these special characters to entities or escape them
with CDATA tags in such a manner that I can transform them to valid WML.  Is
it a stupid idea to put all the data in CDATA tags?  Otherwise, how will I
know which characters are going to need escaping.

It sounds like the incoming files are in ISO 8859-1 encoding (Latin-1). If so, then tell your Perl script to output an encoding parameter in the XML declaration, or follow "cutlass"'s suggestion and turn everything above character 127 into a numeric character reference. Either should be pretty easy to do in Perl.


-Chris
--
Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc.
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA

Attachment: pgp00018.pgp
Description: PGP signature

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.