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

Some entities output as entities and others as chars n

Subject: 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
 Some entities output as entities and others as chars n
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','&#146;'),'b','&#147;'),'b','&#148;'),'B.','&#174;'),'b"','&#
153;')
B B B B B 
,'b','&#151;'),'B7','&#183;'),'n :','&#59450;'),'b','&#150;'),'C)','&#233
;')
B B B B B 
,'B>','&#190;'),'C>','&#254;'),'o','&#111;'),'b"','&#149;'),'C"','&#226;')
B B B B B 
,'C<','&#252;'),'C','&#220;'),'b,','&#128;'),'b ','&#134;'),'x','&#120;')
B B B B B 
,'B(','&#168;'),'B'','&#167;'),'b','&#8211;'),'C#','&#227;'),'b','&#8212;
')
B B B B B 
,'D','&#259;'),'B)','&#169;'),'C-','&#237;'),'C(','&#232;'),'C'','&#231;')
B B B B B 
,'C!','&#225;'),'b','&#145;'),'C=','&#253;'),'b!','&#135;'),'B#','&#163;')
B B B B B 
,'b','&#8542;'),'B<','&#188;'),'B=','&#189;'),'B>','&#190;'),'B4','&#180;')
B B B B B 
,'C:','&#250;'),'C1','&#241;'),'C0','&#240;'),'C8','&#248;'),'C3','&#243;')
B B B B B  ,'C*','&#234;'),'C ','&#224;')"/>

If I copy the above into some text to use as test data one sees good
output as a pair of entities like &#146;','&#146; 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,'&#146;','&#146;'),'&#147;','&#147;'),'&#148;','&#148;'),'B.','B
.')
B B B 
,'&#153;','&#153;'),'&#151;','&#151;'),'B7','B7'),'n :','n :'),'&#150;','&#15
0;')
B B B 
,'C)','C)'),'B>','B>'),'C>','C>'),'o','o'),'&#149;','&#149;'),'C"','C"'),'C<'
,'C<'),'C','C')
B B B 
,'&#128;','&#128;'),'&#134;','&#134;'),'x','x'),'B(','B('),'B'','B''),'&#151;
','&#150;')
B B B 
,'C#','C#'),'b','&#151;'),'D','D'),'B)','B)'),'C-','C-'),'C(','C('),'C'',
'C''),'C!','C!')
B B B 
,'&#145;','&#145;'),'C=','C='),'&#135;','&#135;'),'&#146;','&#146;'),'B#','B#
')
B B B 
,'&#147;','&#147;'),'&#148;','&#148;'),'&#149;','&#149;'),'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

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.