[DTD] default attribute not inserted

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jfix

[DTD] default attribute not inserted

Post by jfix »

Hi, first post, search didn't yield anything.

I have a DTD which defines an attribute "Type" which can have two different values, one of them being the default value (see code snippet).

Code: Select all

<!ATTLIST Intervention
Type (FailureTime|CensoredTime) "CensoredTime"
>
I would have expected [1] that when I insert the Intervention element that the Type attribute is automatically inserted as well, and has the value "CensoredTime". Am I wrong?

If this is not possbile using a DTD, could this be solved by using Relax NG?

Thanks,
Jakob.

[1] http://www.w3.org/TR/2000/REC-xml-20001006#attdecls

PS: Oh, we bought two licenses today. Thanks for a great product!
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jakob,

No, the editor should not insert that attribute automatically. Actually this is exactly the point with default attributes, if they are not specified the document is equivalent with a document that specifies them with the default value. Oxygen will offer the attribute in the content completion list and will list the values when you enter the attribute value. See more information about default attributes at
http://www.w3.org/TR/2000/REC-xml-20001006#dt-default
If a default value is declared, when an XML processor encounters an omitted attribute, it is to behave as though the attribute were present with the declared default value.
Best Regards,
George
Post Reply