Re: Types for Option Values

Alessandro Vernet wrote:
> On 5/23/07, Jeni Tennison <jeni@jenitennison.com> wrote:
>>    <p:option name="element-name" type="xs:QName" value="my:foo" />
> 
> We can either:
> 
> 1) Pass the namespaces in scope to the step, along with other
> information we have talked about.
> 2) Exclude QName from the list of simple types that can be used.
> 
> But I wouldn't throw away the whole typing functionality just because
> there is an issue with QName.

QName isn't the only type that I'm worried about (it's just the most 
obvious). Take dates and times: are these passed as *actual* dates and 
times, or are they passed as strings which the receiving 
pipeline/component has to parse? If someone were to have an option that 
was typed as a xs:dateTime, and then had a <p:when> that tested it, 
would '2007-05-23T11:00:00Z' be equal to '2007-05-23T12:00:00+01:00' or 
not? I think we will find it a lot of work to fully specify the way that 
the type system of XML Schema and XPath 2.0 interacts with the type 
system of XPath 1.0 which we are using everywhere else. I don't want to 
do that work in v1.

If we do allow options to be typed in v1, then given we are using XPath 
1.0 we should stick with the simple types available in XPath 1.0: the 
type attribute could be xs:string, xs:double or xs:boolean. We would 
have to have some wording that stated the values were interpreted 
according to the XSD rules rather than as XPath literals, but that 
shouldn't be too hard. This would give us a clear upgrade path for a 
future version where we might use XPath 2.0.

We definitely need to pass namespaces in to the step (though we have 
other problems with that and pipelines which I intend to write about in 
a separate thread). But that's pretty independent of typing, since we 
need them anyway to provide enough information to the step to allow them 
to interpret values that don't readily fall into the XML Schema type 
system, such as XPath expressions and XSLT patterns. Given that steps 
are going to have to do some natural language documentation of how those 
values get interpreted, I don't see why they can't do natural language 
documentation of how QName values are interpreted as well.

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Wednesday, 23 May 2007 10:59:17 UTC