[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: getting type information in xslt 2.0

Subject: Re: getting type information in xslt 2.0
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Wed, 25 Oct 2006 11:51:59 -0700
Re:  getting type information in xslt 2.0
I understand the examples and the idea.

Anyhow, having to parse for nested sequences seems weird. Also, this
approach sacrifices static type checking, as every function now has
just one argument -- of type item*.



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On 10/25/06, David Carlisle <davidc@xxxxxxxxx> wrote:

> the examples you provided will not run in the case of a function that > has 2 or more arguments that must be sequences.


yes you need to be able to model sequences of sequences to do that. I started to do that (see: <xsl:variable name="q" as="element()"><f:q/></xsl:variable> which then isn't used, but I realised it was midnight and I ought to stop playing and go to bed so posted what I had:-) Note that that is a locally generated element (so with a distinct identity) rather than the global variable with empty elements used elsewhere.

If you model sequences of sequences by using XML element nesting then
you lose type information, another way is to model
[1,2,[3,4,5],[6,7,8]]
as something like
(<q'/>,1,2,<q''/>,3,4,5,<q''/>,<q'''/>,6,7,8,<q'''/>,<q'/>)

where q' q'' and q''' are three distinct element nodes with name q (each
appearing twice in the sequence, denoting the start and end of a
subsequence.

Given such a structure, with a bit of effort you can handle nested
sequences, as you look at the next item, if it's not the special quote
marker then you use the item, if it is a q then you grab the sequence up
to the next (only) other item that is "is" equal to that item.

David

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.