bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unclear behaviour of xml.el


From: David Kuehling
Subject: unclear behaviour of xml.el
Date: 01 Nov 2001 20:50:08 +0100

Hi!

Together with some people I'm creating a German-Japanese dictionary,
using ELisp scripts to translate the XML dictionary sources to jTeX
files. But I currently have a problem with whitespace-handling of xml.el
(the XML parser that luckily came with emacs21): Whitespaces after
closing tags `</tag>' and empty-element tags `<tag/>' are removed:

----file: test.xml--------------------------------------------
<test>
   123 <a/> 456
</test>
--------------------------------------------------------------

(xml-parse-file "test.xml")
===>
((test nil "123 " (a nil "") "456
"))

For our use, this is quite a serious problem. We use to substitute the
tag <a/> by a reference to the current dictionary entry's name, either a
tilde (~) or a shortcut. Removing the whitespace after the tilde is thus
undesireable. Always adding a whitespace after the tilde isn't a
solution, since the tilde might be used in front of a full-stop or a
comma.

In `xml.el' a comment says:

      ;; Clean up the string (no newline characters)
      ;; Not done, since as per XML specifications, the XML processor
      ;; should always pass the whole string to the application.

Does this mean, the current implementation of `xml.el' is not standard
compliant (which would justify a change of that behaviour)?

I would be very pleased for comments on this topic. I don't like the
idea of creating my own version of xml.el.

Bye,
                                                        David Kühling

PS: I'm using emacs-21.1.4 (installed from sources)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]