Loading ...
Sorry, an error occurred while loading the content.

nxml offer completion on invalid attribute

Expand Messages
  • Xavier Cazin
    Hi, Here is probably an illustration of the issue mentioned in the TODO Should completion pay attention to characters after point? If so, how? After having
    Message 1 of 1 , Jan 15, 2004
    • 0 Attachment
      Hi,

      Here is probably an illustration of the issue mentioned in the TODO
      "Should completion pay attention to characters after point? If so, how?"

      After having stumbled several times on the following behaviour, my
      answer to the first question is yes. I've unfortunately no answer to
      the second one.

      Let a test schema be :

      start = element test {
      attribute foo { text }
      |
      attribute bar { text }
      |
      element subtest { text }
      |
      text
      }

      Documents recognised by this schema consist of one <test> element
      containing either a foo attribute, or a bar attribute, or a subtest
      element, or a text node.

      Let's edit the following text with nxml,

      <test foo="foovalue" -|-

      As expected, pressing C-Return doesn't mention bar as a possible
      child attribute for test; ditto with this configuration:

      <test bar="barvalue" -|-

      This feature of hiding invalid attributes before we even think of
      adding them is of course very useful.

      Now, if I edit this :

      <test -|-><subtest/></test>

      or this :

      <test -|->Shouldn't I be the only one?</test>

      I'd expect that nxml would hide both foo and bar so that I'm not
      tempted to add them. Instead, it offers them for completion, only to
      promptly underline whatever choice is made.

      Xavier.
    Your message has been successfully submitted and would be delivered to recipients shortly.