|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Can XSLT remember the occurrence
> -----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
|
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
|

Cart








