- From: Immanuel Normann <normann@dfki.de>
- Date: Fri, 24 May 2002 06:36:47 -0400 (EDT)
- To: www-dom@w3.org
hello, the question how to handle special characters within createTextNode() seems to be sufficiently discussed in this thread. Nevertheless, I didn't understand the solutions of the problem. Therefore I want to state the problem again as simple as possible. Consider the following sample code and focus on 'createTextNode': <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script type="text/javascript"> function showForall() { var t = document.createTextNode('∀'); document.body.appendChild(t); } </script> </head> <body onload='showForall()'> </body> </html> What I want to see after load is the respective 'forall' Symbol. But what I actually get is '∀' as a (8 character long) text. Also so document.createTextNode('∀') doesn't yield the 'forall' Symbol. And document.createEntityReference('∀') is an javaScript error: "Object cannot be created in this context" I didn't understand the following hints: >>I'm German, so I use a lot of special characters like ä in my >>pages. Are all these characters single nodes in the DOM? >This depends on whether you've asked your parser to retain Entity Reference >nodes or not. How do I ask my parser to retain Entity Reference? >If you've told the DOM generator (parser or other code) to "expand" the >entity references, then the Text node would appear... How do I tell the DOM generator to "expand" entity references? Perhaps I should mention some additional information for an appropriate answer: 1) I am not an DOM-expert. So an answer with simple sample code would help me much. 2) I am using Mozilla (more precisley: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510) Thanks for any help! Immanuel
Received on Tuesday, 28 May 2002 14:33:45 UTC