Re: Detecting unbound options

"Henry S. Thompson" <ht@inf.ed.ac.uk> writes:
> 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.

I agree that that's a distinction we would lose. I agree that that's
not ideal. I'm open to suggestions for a better alternative.

> 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.

I don't think all of those are problematic. Options that aren't
strings (undeclare-prefixes) or are QNames (initial-mode, template-name)
or that don't have a meaningful empty-string value (doctype-public,
media-type) are all ok.

But you're right that it would be a problem for some (base-uri, from,
to, ...)

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

<p:try>
  <p:group>
    <p:directory-list>
      <p:with-option name="path" select="$path">
        <p:empty/>
      </p:with-option>
      <p:with-option name="include-filter" select="$include-filter">
        <p:empty/>
      </p:with-option>
      <p:with-option name="exclude-filter" select="$exclude-filter">
        <p:empty/>
      </p:with-option>
    </p:directory-list>
  </p:group>
  <p:catch>
    <p:try>
      <p:group>
        <p:directory-list>
          <p:with-option name="path" select="$path">
            <p:empty/>
          </p:with-option>
          <p:with-option name="exclude-filter" select="$exclude-filter">
            <p:empty/>
          </p:with-option>
        </p:directory-list>
      </p:group>
      <p:catch>
	<p:try>
	  <p:group>
	    <p:directory-list>
	      <p:with-option name="path" select="$path">
		<p:empty/>
	      </p:with-option>
	      <p:with-option name="include-filter" select="$include-filter">
		<p:empty/>
	      </p:with-option>
	    </p:directory-list>
	  </p:group>
	  <p:catch>
	    <p:directory-list>
	      <p:with-option name="path" select="$path">
		<p:empty/>
	      </p:with-option>
	    </p:directory-list>
	  </p:catch>
	</p:try>
      </p:catch>
    </p:try>
  </p:catch>
</p:try>

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | A hen is only an egg's way of making
http://nwalsh.com/            | another egg.--Samuel Butler (II)

Received on Wednesday, 27 May 2009 12:28:14 UTC