This is correct operation. The DOM API assumes you're already talking about the content of the document, not its XML syntactic representation. If you create a text node containing the & character using the DOM calls, it's assumed you really mean the & character, _NOT_ the & introducing a numeric character reference or entity reference. To insert a special character, simply insert the character directly into the text string, in its UTF-16 form. I don't know enough Javascript to tell you how to code that, but it should be possible. To insert an entity reference, you want to use the createEntityReference call rather than the createTextNode call. var t = document.createEntityReference('forall'); This may not work if your DOM doesn't know which DTD you're using and/or hasn't retained a list of which entities are being defined (and thus doesn't know what "forall" represents). >How do I ask my parser to retain Entity Reference? >How do I tell the DOM generator to "expand" entity references? See the docs for your parser. ______________________________________ Joe Kesselman / IBM ResearchReceived on Tuesday, 28 May 2002 14:55:20 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 October 2009 08:24:55 GMT