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

Please help me if u can. XSLT functional programming

Subject: Please help me if u can. XSLT functional programming
From: "Marcus Dickerhof" <marcus.dickerhof@xxxxxx>
Date: Tue, 3 Jun 2003 01:07:30 +0200
xslt functional programming
Hello,
I am new to XSLT and the art of functional programming.
As one of my first tasks I want to write a kind of interpreter. My XML input
file will like similar to this:


<EQUATION>
    <ID>X</ID>
    <EXPRESSION>
        <MULT>
            <NUMBER>6</NUMBER>
            <EXPRESSION>
                <PLUS>
                    <NUMBER>3</NUMBER>
                    <NUMBER>4</NUMBER>
                </PLUS>
            </EXPRESSION>
        </MULT>
    </EXPRESSION>
</EQUATION>


This means X=6*(3+4)

I want to write at XSLT-Stylesheet that calculates the result and writes it
to a xml file


<RESULT>
    <ID>X</ID>
    <VALUE>42</VALUE>
</RESULT>

Later I also want to include conditional (if-else etc) expressions.

Now I am used to programming Java etc. I was schocked to notice that it is
not possible to change variables. I am used to recursion in Java but there I
am used to the fact that methods can return values. I guess I have to change
my whole way of thinking.
Well I have heard of the Xalan Extensions etc, which allow assigning new
values to variables. I guess this would be a workaround. But now I have read
in so many postings that this is no nice style, besides its being
proprietary. So can anybody please help me to write a nice recursive
stylesheet that can do this? Any hints? Please.

Thank you very much in advance
Marcus Dickerhof




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.