← Prev in month ← Prev in thread

[] or ? for optional

From
James Clark <>
Date
2001-07-10T02:55:10+00:00
ID
Thread
[] or ? for optional
--On 10 July 2001 09:38 +0900 Murata Makoto <> wrote:

> James Clark wrote:
>
>> > - Isn't the type attribute optional for <value>?
>>
>> Yes.  There's a "?" following the attribute value that is intended to
>> indicate this. Is there some way I should fix the notation to make this
>> clearer?
>
> Sorry, I looked over the "?".
>
> I prefer "[" and "]" probably in a big font.

That would be more visually obvious, but I wonder how familiar the use of 
[] for optionality would be to our potential audience. Let's do a little 
poll.

If you read this, please send a message to the list saying whether you are 
familiar with the use of [] for optionality and would guess that the square 
brackets in

<value [type="NCName"]>string</value>

indicate that the attribute is optional.

Alternatively we could try to make it harder to miss the ? by adding 
parentheses

<value (type="NCName")?>string</value>

James
← Prev in month ← Prev in thread