xsl-list
[Top] [All Lists]

Re: [xsl] When to use conditional constructions?

2014-03-30 11:45:27
Sure, this can be done.

And for if .. then .. else :

( exprResultIf [condition],  exprResultElse [not(condition)] )  [1]

I believe it should be possible to write a tool that takes as input a
given XSLT transformation (and as part of this a given XPath
expression) and converts it to equivalent code, in which any
conditionals are eliminated.

We could also add a good code-formatter that takes the output of the
first tool and converts it to "well-formatted code".

The last tool should be highly configurable, as there are different tastes.


Cheers,
Dimitre

On Sun, Mar 30, 2014 at 9:29 AM, Imsieke, Gerrit, le-tex
<gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de> wrote:


On 30.03.2014 18:11, Dimitre Novatchev wrote:

I believe it is impossible to eliminate "if-expressions" in XPath
because we don't have templates there. It's a pity.


Does this qualify for an if-expression-less syntax?

let $a:=4
return ('result1'[$a=1], 'result2'[false()], 'result3'[4=$a],
'result4'[true()])[1]
⇒ 'result3'


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--