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

Re: Junit-type Framework for XSLT 2 Functions and Tem

Subject: Re: Junit-type Framework for XSLT 2 Functions and Templates?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 18 May 2005 21:42:09 +1000
junit functions
On 5/18/05, David Carlisle <davidc@xxxxxxxxx> wrote:
>
> Dave, That  page doesn't claim that instancegenerator generates an
> infinite sequence of all instances, does it really do that?
>
> >    but I couldn't get it to work.
> >
> >    Instead, as a poor mans alternative.
> >
> >    1. From whatever source, use trang to go into rng.
> >    2. I have a stylesheet which then seeks all unique elements
> >     (and attributes), and can generate an xml file.
> >    It doesn't do the 'all instances' (which instance generator is
supposed
> >    to do), but it may provide a start Dimitre.
> >
> That sounds like a very finite list to me.
>
> To get the infinite sequence Dimitre asked for, of all schema valid
> documents ordered by length, note that any schema valid document is a
> finite string of unicode characters, and as the set of finite strings
> over a finite alphabet is countable, we can enumerate them in order.
> just list the natural numbers 1, 2, 3... in  base 1114112 (hex 10FFFF + 1),
> using unicode characters as the digits.
>
> That gives you the countably infinite sequence of finite unicode
> strings, then pass each string through a schema validator of your choice
> and discard it if it is not a well formed and schema valid instance of
> the schema in question. The resulting sequence is the requested result.
>
> I'm sure that Dimitre will be happy with the purity of the algorithm and
> not quibble unduely about its computational complexity or the expected
> time that it takes to generate any items in the sequence.


Sorry, I was absolutely stumped by your message and I understood what
you're saying only now.

I am accustomed to the lazy evaluation style of Haskell, where passing
parameters of infinite length is something natural,

like:

     take 5 [1,2 ..]

takes the first 5 elements of the infinite list of natural numbers.

It is most natural to take a finite number of elements (in our case
instances of a particular schema), from an infinite list generated by
another function.


Cheers,
Dimitre Novatchev.

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.