Re: XML-friendly hexadecimal references in Markup->Insert Entity?
Syd Bauman <[email protected]>
| Newsgroups | gmane.emacs.psgml.user |
|---|---|
| Message-ID | <[email protected]> |
> Has anyone come up with a way to have the Insert Entity menu under > Markup insert the XML compliant hexadecimals (&#x[blah];) instead > of character entities? I'm not 100% sure I understand the question. You want to be able to select Markup > Insert Entity > mdash from the menu and have Emacs insert "—" instead of "&mdash:"? Insert Entity almost never works for me, as I usually have a line-mode only interface and am accessing the menus via tmm. But when I do use an X window, it does work -- I am shown a list of entity names, and if I select one a reference to it is inserted. Reading the code for sgml-entities-menu confirms this behavior. While it shouldn't be too hard to change the behavior to do what you've asked, I wouldn't call the resulting feature "Insert Entity", as "—" is not a reference to the 'mdash' general entity, but rather a reference to the Unicode code-point 8212, which is associated with the character em dash. Actually, that makes no sense at all. What is currently called "Insert Entity" should be called "Insert Entity Reference". What you are asking for (I think) is either a new functionality "Inert Entity", where when you select an entity name from a pop-up, the entity itself (i.e., the replacement text) is inserted; or a new functionality "Insert Char Ref", which presents a list not of entity names, but rather of the Unicode character names, and inserts a numeric character reference to that character. Neither of these would be all that hard to do, I don't think, but developing some mechanism to determine which of the roughly 14,000 characters currently in ISO 10646 / Unicode (as of 3.2) to display is the trick. Am I barking up the right tree? > I am pointing to a DTD (EAD) that does include xml entity sets > (although the .pen file extension looks odd to me now). Me too. I thought it would have been short for "parameter entities", and would be used to declare a bunch of parameter (internal-DTD) entities as opposed to general entities. But I have .pen files on my system that declare general entities with numeric character definitions, too. I'm not sure if this will help, and I've never played with this feature myself, but I think you can ask psgml to display that to which an entity name is mapped (in a .map file) as opposed to the entity itself or the reference itself. See the "Translating between characters and entity references" section of the manual. C-h i m psgml RET m edit RET m tr TAB RET if psgml is in your top-level info directory. (As it should be :-) Hope this helps. ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/