[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: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Mon, 29 Oct 2001 10:48:56 -0000
converting special characters in xml
this is a classic FAQ

a rule of thumb is to avoid enclosing anything into CDATA as it ceases to be
accessable and used as xml.

i would suggest a bit of preprocessing that will convert the entities into
their numeric equivelents

try using html tidy at www.w3.org.

there are plenty of other methods.

FAQ on entities
http://www.dpawson.co.uk/xsl/sect2/N3573.html


cheers, jim fuller

----- Original Message -----
From: "Ross Kendall" <rkendall@xxxxxxxxx>
To: "XSL-List" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, October 29, 2001 10:45 AM
Subject:  Escaping/converting special characters


> This is not really an XSL question but is closely related, so I hope
someone
> is kind enough to answer.
>
> I have some news feeds that I am transforming to WML.  The feeds come in
in
> a flat text file, I wrote a quick and dirty Perl script to parse these
text
> files and convert them to XML (using XML::Simple), this then allows me to
> easily transform them to WML using XSLT.
>
> 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.
>
> Any help appreciated.
>
> Ross Kendall
> Technical Developer
> Affinity Internet Holdings
> e: rkendall@xxxxxxxxx
> p: +44 (0)20 7670 1155
> w: http://www.aih.co.uk/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.