Subject: RE: [xsl] complex functions on subtrees. From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Thu, 28 Mar 2002 09:55:46 -0000 |
Yes, if the structure is fully marked-up then it should be possible to do what you want in XSLT. It might be a good idea to use a processor that offers stylesheet functions (xsl:function, EXSLT's func:function, or similar). Saxon offers this extension and I think several other processors do as well. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of croce > Sent: 28 March 2002 09:29 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] complex functions on subtrees. > > > 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 > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] complex functions on subtrees, croce | Thread | [no subject], Jay Ron |
RE: RE: [xsl] suppressing default t, Michael Kay | Date | AW: RE: [xsl] windows-like table so, "Braumüller, Hans" |
Month |