Subject: Empty string attribute value

From: Mikael Pahmp <[email-masked]>
Date: Fri, 11 Feb 2000 12:21:01 +0100

There is a little loophole in the 'attr-list' grammar and the implicit typing rules in RFC 2608.

For an attribute of srting type, there is sometimes the need for sending the empty string. There is however no way of representing it in the 'attr-list' grammar correctly.

Since the 'strval' grammar rule is '1*safe-val', a string value must have at least one character. To send an empty string, it could e.g. be represented as a space character but then it's not an empty string and could potentially be a problem on the client side. The predicate grammar wouldn't have a problem with it since leading and trailing white spaces are stripped before comparing values.

I think the grammar should rather have been 'strval = 0*safeval'. This will allow for the empty string. It will not cause any problems for the implicit typing rules since the other types require at least one character.

This can be corrected when SLPv2 goes to draft standard but my question now is if there are any implementations out there that would have a problem with a an 'attribute' looking like this:
   '(attrname=)'        ; note, no character between the '=' and ')' characters

Note that it's still possible to represent a multi-valued string attribute. E.g.:
   '(attrname=string value,,another string value)'
This attribute has three values. The second one is the empty string.

Probably this was the intention of the author from the beginning but the grammar rules forbids it.

/Mikael

---

From: Erik Guttman <[email-masked]>
Date: Tue, 15 Feb 2000 10:26:58 +0100 (MET)

> For an attribute of srting type, there is sometimes the need for sending the
> empty string. There is however no way of representing it in the 'attr-list'
> grammar correctly.
>

Mikael,

What is this useful for?  It was actually my intention to forbid it :-)

Not that I like forbidding things for their own sake, but the WG thought 
of an empty value as a keyword.  We didn't think that an attribute would
be both a keyword and a attribute-value tuple. 

Erik