RE: p:value-available not as useful as I'd like. . .

Henry,

I'm not familiar with the function p:value-available().
I assume from the example that it's in the 'http://www.w3.org/ns/xproc' namespace.


Regards


Philip Fennell
Consultant

Mark Logic Corporation
www.marklogic.com

E-mail: philip.fennell@marklogic.com
Mobile: +44 (0)7824 830 866 



-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf Of Henry S. Thompson
Sent: 26 November 2009 17:32
To: xproc-dev@w3.org
Cc: Michael Kay
Subject: p:value-available not as useful as I'd like. . .

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The following doesn't work:

  <p:with-option name="foo"
                 select="if (p:value-available('bar') then $bar else xyzzy"/>

because the semantics of if only protect you against _dynamic_ errors
in the branch not taken, and the fact that bar isn't a know (XPath2)
variable is a _static_ error. . .

Wrapping two copies of the whole surrounding step in a p:choose/p:when
seems awfully heavyweight. . .

Any ideas for a workaround (I'm _not_ suggesting a change to the
spec. at this late stage :-)?

ht
- -- 
       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)

iD8DBQFLDrufkjnJixAXWBoRAiWoAJ0fgSYsxn2XcefUW8c2kImDBrvHNwCePvLn
BTX8h6CX0ihAYO0gLOcnvvY=
=Z45V
-----END PGP SIGNATURE-----

Received on Friday, 27 November 2009 10:16:05 UTC