Re: [xsl] getting type information in xslt 2.0

Subject: Re: [xsl] getting type information in xslt 2.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 25 Oct 2006 21:28:37 +0100
> Anyhow, having to parse for nested sequences seems weird.

Blame the WG for specifying xpath2 lists as self flattening:-)

If you don't like the <q/> method (which I've never actually used, I
just made up while sketching out the code in this thread) there is an
alternative method that I do use in xq2xsl where I need to model XQuery
"order by" whose semantics are based on "tuples" ie lists of lists.
There I model things by having a single sequence containing all the data
and then model a list of lists as a list of strings. You apply
string-to-codepoints() to a string and that gives you a list of
integers, which you use as indexes into the sequence of data (actually
you have to offset the indices by 32 to avoid the 0-32 codepoint range
which you can't have in a string.)

>  Also, this approach sacrifices static type checking,

Yes, I think if you need to check types then you can't really avoid the
subject line of this thread any longer: You need to be able to access
the type information:-)


Current Thread