Subject: Re: [xsl] Fixing entities From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 1 Apr 2003 11:16:07 +0100 |
> I'm trying to tidy up some xml that contains html entities such as named > &fract12; and number ½ &fract12 isn't an HTML entity is it? (I'll assume this was a typoi for ½) ½ 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) ½ 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. ½ 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 ½ 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Fixing entities, Philip Fitzsimons | Thread | RE: [xsl] Fixing entities, Stuart Brown |
RE: [xsl] performance when using do, Philip Fitzsimons | Date | RE: [xsl] Fixing entities, Philip Fitzsimons |
Month |