Menu

#2 Space required before /> in empty xml tags

closed-works-for-me
None
5
2001-02-13
2001-01-22
Brian Ewins
No

Editing XML (xml-mode) with no DTD in psgml-1.2.1 I see this behaviour:

< f o o > < b a r / > C-c /
inserts '</bar>', ie '<foo><bar/></bar>'

< f o o > < b a r SPC / > C-c /
inserts '</foo>', ie '<foo><bar/></foo>'

For the record, the spec says that empty elements match the production:
EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'

In other words that extra space is not required. You get the same behaviour
for empty elements if you have attributes with no space after the last
closing quote. The problem seems to be in the parsing, not just in end-tag:
sgml-show-context displays "#PCDATA in bar in foo in"...(etc) when the point
is after <bar/>.

I'm guessing the problem is in psgml-parse.el's
sgml-parse-attribute-specification...its like something is eating the next
char in an attribute spec, but not restoring the character pushed back
unless its '>'?? I don't understand whats going on in Lennart's code to pin
it down. Anybody?

-Baz

PS funnily enough Mulberry Tech's xsl-mode has a similar problem with /> -
it indents correctly if you put a space before the slash but otherwise gets
it wrong. Hmmm...

Discussion

  • Lennart Staflin

    Lennart Staflin - 2001-02-08
    • assigned_to: nobody --> lenst
     
  • Lennart Staflin

    Lennart Staflin - 2001-02-10
    • status: open --> open-works-for-me
     
  • Lennart Staflin

    Lennart Staflin - 2001-02-10

    I think this is fixed in the latest release (1.2.2)

     
  • Lennart Staflin

    Lennart Staflin - 2001-02-13
    • status: open-works-for-me --> closed-works-for-me
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.