Subject: RE: [xsl] Can XSLT remember the occurrence From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx> Date: Sun, 4 Jan 2004 17:28:56 +0100 |
> -----Original Message----- > From: suresh reddy > <snip /> > > Can I write an XSL so that the output is the following > .. > > <html> > <body> > e power x power base i > </body> > </html> > In this case, the following templates should do the trick: <xsl:template match="/"> <html> <xsl:apply-templates select="math/msup" /> </html> </xsl:template> <xsl:template match="msup"> <body> <xsl:apply-templates select="mrow/msub/mi[1]" /> </body> </xsl:template> <xsl:template match="mrow/msub/mi"> <xsl:value-of select="ancestor::msup/mi" /> <xsl:text> power </xsl:text> <xsl:value-of select="." /> <xsl:text> power base </xsl:text> <xsl:value-of select="following-sibling::mi[1]" /> </xsl:template> > Can anyone please help me... the solution should be > more generalized .... the above is just a simple > instance I have chosen.. the expression can be very > complex and every variable should be expressed with > respect to the ground variable. > I think you will find the 'ancestor::msup/mi' XPath expression particularly helpful. The above example only works for this specific case, so I definitely hope there is at least some other way to distinguish between the types of operation (i.e. power). Hope this helps! (If not, don't hesitate to re-post) Cheers, Andreas XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Can XSLT remember the occurre, suresh reddy | Thread | RE: [xsl] weird character B , how t, Paul Tomsic |
Re: [xsl] weird character B , how t, J.Pietschmann | Date | RE: [xsl] XSLT/Java does not identi, Michael Kay |
Month |