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

Re: Fixing entities

Subject: Re: Fixing entities
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 1 Apr 2003 11:16:07 +0100
xml frac12
> I'm trying to tidy up some xml that contains html entities such as named
> &fract12; and number &#189;

&fract12 isn't an HTML entity is it? (I'll assume this was a typoi for &frac12;)
&#189; isn't an entity reference at all, it's a character reference
and treated by an XML parser rather differently from an entity.


> I wish to map them to <character code="fract12" /> and <character code="189"
> (I will then use a utf mapping file to map them to utf codes)

&#189; will be reported by the parser in the same way as if you had just
typed character 189 at the keyboard. So you would need to use xslt
substring functions to locate this character and output the
element. this is possible but string handling in xslt is fairly basic,
and if i understand your comment correctly, what you finally want, is
what you are starting with, the unicode character with that number.

&frac12; will be a syntax error unless your document specifies a DTD
that defines this entity. If it is defined then it presumably has teh
HTML definition which is  &#189; so again this will be reported to teh
XSLT system just as if you had typed the 1/2 character at a keyboard,
XSLT will not see the entity reference at all.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.