[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fixing entities
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|