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 14:16:33 +0100
To: Norman Walsh <ndw@nwalsh.com>
Cc: XProc Dev <xproc-dev@w3.org>
Message-ID: <f5bd49uy9ce.fsf@hildegard.inf.ed.ac.uk>
Hash: SHA1

Norman Walsh writes:

> Yuck! But can we really live with this...

For sure not.

The most straightforward approach would be to add p:bound? as an XPath
extension function.

This would map strings to booleans, and presumably work yield *True*
for any inscope bound variable, parameter or option,
i.e. p:boundp?('xyzzy') is True iff $xyzzy is not an error.

A lighter-weight alternative would be to define p:unbound as a
_variable_ in the static context for XPath evaluation specified to
have a value distinct from any explicitly specified value that
unspecified optional options would receive, so you could test for
$opt=$p:unbound   This would only work with options, but would be
simpler to implement.

Would either of these send us back to Last Call?  Ask me next
week. . .

- -- 
       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]
Version: GnuPG v1.2.6 (GNU/Linux)

Received on Wednesday, 27 May 2009 13:17:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:05 UTC