W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2009

Re: Detecting unbound options

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Wed, 27 May 2009 13:09:13 +0100
To: Norman Walsh <ndw@nwalsh.com>
Cc: XProc Dev <xproc-dev@w3.org>
Message-ID: <f5bhbz6ycgm.fsf@hildegard.inf.ed.ac.uk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Norman Walsh writes:

> mozer <xmlizer@gmail.com> writes:
>> Are you suggesting that we eventually end up needing a construct to
>> test if a variable is bounded ?
>
> No. After more thought, I'm suggesting that the concept of unbound
> options is a mistake. As a (SIGNIFICANT) convenience to users, and
> consistent with languages like XSLT, I think an option with no binding
> should get a default value.
>
> Since we've decided that variables and parameters must be strings
> in XProc 1.0, I propose the empty string as that default value.
>
> Effectively "" becomes the default default for options.

Gee, I'm still not happy with that idea.  There are lots of cases
where not specifying a value is importantly different from specifying
the empty string.  A quick look at our spec. finds

  p:directory-list: include-filter, exclude-filter
  [serialisation steps]: doctype-public, doctype-system, undeclare-prefixes,
                         media-type
  p:make-absolute-uris: base-uri
  p:namespace-rename: from, to
  p:unescape-markup: namespace, encoding, charset
  p:wrap(-sequence): group-adjacent
  p:xslt: initial-mode, template-name, output-base-uri, version
  p:exec: [lots]
  p:hash: version
  p:uuid: version
  p:xsl-formatter: content-type

as non-required options with no default.

For at least include-filter, base-uri, group-adjacent and
output-base-uri the empty string seems to be either the wrong default
or a legitimate value distinct from [not specified]. . .
- -- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
                         Half-time member of W3C Team
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFKHS1qkjnJixAXWBoRAoFeAJ97dx/CEKZOJZnhhebVz9/G1eHNuACeIUtC
09kgaU4B8P+2/cKMwG8QVOs=
=i8xw
-----END PGP SIGNATURE-----
Received on Wednesday, 27 May 2009 12:09:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 May 2009 12:09:52 GMT