xslt 2.0 missed the point?

S

shaun roe

mild rant follows

Working now for a couple of years with xslt and now xslt 2.0, does
anyone else get the impression that xslt 2.0 somehow missed the point?
Yes its got a fancy new data model (and thank goodness for the new
grouping functions), but where are the functions which would really have
made it useful without taxing the implementers? e.g trigonometry
functions for SVG; square root /log function to do simple statistics?
hex/ dec conversions which dont need 50 lines of extraneous code?
i.e. practical functions, implementable in a web browser which would not
mean re-writing the whole thing from the ground up, and which would have
done a lot more to popularize its usage.

There's plenty of room here for a XSLT 1.5 standard implemented
retroactively...

ok that was it. I'll get back in my box now.
 
J

Joe Kesselman

shaun said:
but where are the functions which would really have
made it useful without taxing the implementers?

XSLT is a specialized language for XML transformation. It's not a full
general-purpose language, and there are things which it considers out of
scope.

This is pretty trivially fixed, of course -- plug in extension functions
like the EXSLT library. XSLT 2.0 improved the ability to write them in
XSLT itself, and even XSLT 1.0 had the ability to call out to code
written in other languages (details of the API for doing so weren't well
standardized, but the XSLT end of it was). Trig in particular is pretty
easy to do either way; do a series implementation in XSLT or call
existing (eg Java) trig functions externally.

If you really think something should be a standard feature of XSLT
itself, the best way to promote the idea is to implement it and
demonstrate that there's sufficient uptake to make folding it into the
standard worthwhile. I cited EXSLT; some of EXSLT's features *did* make
it into 2.0 because they were clearly valuable to a wide enough slice of
XSLT's user base. Others didn't.

Finally: There are deliberate tradeoffs in languages tuned for specific
tasks. Sometimes the right answer really is to say "That's nice, but I
have to implement my own solution." XSLT's a good thing, but it does not
replace all possible processing of XML and isn't intended to. Sometimes
you need to code an additional processing stage (a postprocessor to
interpret trig functions would be trivial), or you really do need to
code a full processor youself. Nature of the beast. No matter how
complicated XSLT gets, there will *ALWAYS* be something that's better
handled another way.
 
D

Dimitre Novatchev

where are the functions which would really have
made it useful without taxing the implementers? e.g trigonometry
functions for SVG; square root /log function to do simple statistics?
hex/ dec conversions which dont need 50 lines of extraneous code?
i.e. practical functions, implementable in a web browser which would not
mean re-writing the whole thing from the ground up, and which would have
done a lot more to popularize its usage.

You are describing FXSL 2.x -- and it is ready for use.

Of course, to use the FXSL 2.x functions in a browser, one must first have a
browser with XSLT 2.0 support.

FXSL 1.x can be used (and has been used) in browsers.

Besides its main advantages (implementation of higher-order functional
programming in XSLT) FXSL provides the end user with functions(/templates in
XSLT 1.0) for:

- Recursion over a list

- Iteration (N times or conditional)

- Mapping of a list

- Filtering or splitting of a list

- Zipping of two and more lists

- Functional composition (and multi-pass transformation)

- sum/product of computed values (such as sum/product of units, sums of
products, sums of results of transformations of elements of a list,
hexadecimal arithmetic or arithmetic in any other numeric system)

- min(), max(), avg()

- Trigonemetric functions with controlled precision: sin(), cos(), tan(),
cotg(), sec(), cosec().

- Exponentiation and logarithmic functions: exp(), pow() (a^x), logy(X)

- Character-wize processing of strings and bitwize processing of bit
strings

- String processing -- tokenization, replacement, spelling checking,
finding most likely candidates for spelling correction,
concordance

- Random numbers generation -- sequences of random numbers from a given
interval or with pre-specified distribution, random
shuffling of a list, ..., etc.

- Finding prime numbers

- Generation of Fibonacci numbers

- Generation of permutations, combinations, etc. of elements of a set

More advanced features:

- The feans to write and evaluate Higher-Order Functions (HOF). Higher -
Order Functions are such functions that accept other functions as parameters
or return other functions as their result.
 
D

Dimitre Novatchev

Sorry, pressed the wrong keys. Continuing the unfinished post:
where are the functions which would really have
made it useful without taxing the implementers? e.g trigonometry
functions for SVG; square root /log function to do simple statistics?
hex/ dec conversions which dont need 50 lines of extraneous code?
i.e. practical functions, implementable in a web browser which would not
mean re-writing the whole thing from the ground up, and which would have
done a lot more to popularize its usage.

You are describing FXSL 2.x -- and it is ready for use.

Of course, to use the FXSL 2.x functions in a browser, one must first have a
browser with XSLT 2.0 support.

FXSL 1.x can be used (and has been used) in browsers.

Besides its main advantages (implementation of higher-order functional
programming in XSLT) FXSL provides the end user with functions(/templates in
XSLT 1.0) for:

- Recursion over a list

- Iteration (N times or conditional)

- Mapping of a list

- Filtering or splitting of a list

- Zipping of two and more lists

- Functional composition (and multi-pass transformation)

- sum/product of computed values (such as sum/product of units, sums of
products, sums of results of transformations of elements of a list,
hexadecimal arithmetic or arithmetic in any other numeric system)

- min(), max(), avg()

- Trigonemetric functions with controlled precision: sin(), cos(), tan(),
cotg(), sec(), cosec().

- Exponentiation and logarithmic functions: exp(), pow() (a^x), logy(X)

- Character-wize processing of strings and bitwize processing of bit
strings

- String processing -- tokenization, replacement, spelling checking,
finding most likely candidates for spelling correction,
concordance

- Random numbers generation -- sequences of random numbers from a given
interval or with pre-specified distribution, random
shuffling of a list, ..., etc.

- Finding prime numbers

- Generation of Fibonacci numbers

- Generation of permutations, combinations, etc. of elements of a set

More advanced features:

- The means to write and evaluate Higher-Order Functions (HOF). Higher -
Order Functions are such functions that accept other functions as
parameters
or return other functions as their result.

- Provide the means for the implementation and evaluation of
currying/partial-application

More about FXSL can be found on its home page:

http://fxsl.sf.net

and I'd recommend the last ExtremeMarkup Languages conference paper at:

http://www.idealliance.org/papers/e...o-pdf/2006/Novatchev01/EML2006Novatchev01.pdf


Cheers,
Dimitre Novatchev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,865
Latest member
AveryHamme

Latest Threads

Top