469,299 Members | 2,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

xslt 2.0 missed the point?

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.
Jan 28 '07 #1
3 2994
shaun roe wrote:
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.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jan 28 '07 #2
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.

"shaun roe" <sh*******@wanadoo.frwrote in message
news:sh*****************************@news.wanadoo. fr...
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.

Jan 28 '07 #3
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/ex...ovatchev01.pdf
Cheers,
Dimitre Novatchev

"shaun roe" <sh*******@wanadoo.frwrote in message
news:sh*****************************@news.wanadoo. fr...
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.


Jan 28 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Rhino | last post: by
3 posts views Thread by Jack Fox | last post: by
3 posts views Thread by thomas.porschberg | last post: by
2 posts views Thread by Adam dR. | last post: by
8 posts views Thread by Hercules Dev. | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.