|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






