Subject: [xsl] Some entities output as entities and others as chars not looking good in the html.. why? From: Alex Muir <alex.g.muir@xxxxxxxxx> Date: Tue, 13 Dec 2011 18:02:52 +0000 |
Hi, I've got some currently inefficient code that is to convert some characters to entites for html output like so. Will move this into a analyze string function with a lookup later, but the problem other than speed is that some of the characters are not being replaced as entities. ...replace(replace(replace(replace(replace(replace(replace(replace( B B B B B $arg,'b','’'),'b','“'),'b','”'),'B.','®'),'b"','&# 153;') B B B B B ,'b','—'),'B7','·'),'n :',''),'b','–'),'C)','é ;') B B B B B ,'B>','¾'),'C>','þ'),'o','o'),'b"','•'),'C"','â') B B B B B ,'C<','ü'),'C','Ü'),'b,','€'),'b ','†'),'x','x') B B B B B ,'B(','¨'),'B'','§'),'b','–'),'C#','ã'),'b','— ') B B B B B ,'D','ă'),'B)','©'),'C-','í'),'C(','è'),'C'','ç') B B B B B ,'C!','á'),'b','‘'),'C=','ý'),'b!','‡'),'B#','£') B B B B B ,'b','⅞'),'B<','¼'),'B=','½'),'B>','¾'),'B4','´') B B B B B ,'C:','ú'),'C1','ñ'),'C0','ð'),'C8','ø'),'C3','ó') B B B B B ,'C*','ê'),'C ','à')"/> If I copy the above into some text to use as test data one sees good output as a pair of entities like ’','’ and undesired output which looks bad in the html as 'n :','n :' a pair of characters with the entity converted to a char. select="$arg,'’','’'),'“','“'),'”','”'),'B.','B .') B B B ,'™','™'),'—','—'),'B7','B7'),'n :','n :'),'–',' 0;') B B B ,'C)','C)'),'B>','B>'),'C>','C>'),'o','o'),'•','•'),'C"','C"'),'C<' ,'C<'),'C','C') B B B ,'€','€'),'†','†'),'x','x'),'B(','B('),'B'','B''),'— ','–') B B B ,'C#','C#'),'b','—'),'D','D'),'B)','B)'),'C-','C-'),'C(','C('),'C'', 'C''),'C!','C!') B B B ,'‘','‘'),'C=','C='),'‡','‡'),'’','’'),'B#','B# ') B B B ,'“','“'),'”','”'),'•','•'),'b','b'),'B<',' B<') B B B ,'B=','B='),'B>','B>'),'B4','B4')" So why is this happening? Btw if anyone can come teach some software engineering courses next term at the university of gambia it would be welcome. I've injured my ankle and won't be able to lecture so there is a gap that needs filling. It's fairly easy to work remotely here on contracts as long as you bring about 3 laptop batteries with you. Thanks -- Alex Muir Instructor | Program Organizer - University Technology Student Work Experience Building University of the Gambia http://sites.utg.edu.gm/alex/ Low budget software development benefiting development in the Gambia, West Africa Experience of a lifetime, come to Gambia and Join UTSWEB - http://sites.utg.edu.gm/utsweb/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL-FO meetup @ XML Pragu, Tony Graham | Thread | Re: [xsl] Some entities output as e, David Carlisle |
[xsl] RE: Count previous-siblings w, Lou Argyres | Date | Re: [xsl] Performance improvement f, Manfred Staudinger |
Month |