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

complex functions on subtrees.

Subject: complex functions on subtrees.
From: "croce" <croce@xxxxxxxx>
Date: Thu, 28 Mar 2002 10:28:44 +0100
xslt complex functions
Hi,

I'm willing to do some complex transformations/queries on subtrees,
such as examening an expression and retrieving the coefficient
(nominator,denominator) of a variable or retrieving the constant term
(nominator,denominator).
<exp>/
<exp>+
<exp>*
<var>a</var>
<const>3</const>
</exp>
<const>5</const>
</exp>
<const>7</const>
</exp>
or thus the expression (3a+5)/7.  ( coeff(a)=3/7, constant term=5/7 )
It would be a fair assumption that the expressions are linear expressions,
note however that expressions like
5*((3a+5b)/3+a/4) are also possible and queries on them require some
calculations.

Would or would not be XSLT a good tool for that? (I suppose there are
better...)

I'm using XSLT because this is only a part of a bigger transformation.
Is it possible to arrive (within XSLT) to an expression node, p.e. by means
of <xsl:apply-templates select="exp">
and call from within that template a non-xsl function to examen the current
node "." (this node is off course an <exp>subtree)

<xsl:template match="exp">
    <xsl:value-of select="myfuction_getcoeff(.,'a')">
</xsl:template>


 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.