On 10/11/2010 11:03, srinivasan(_dot_)p(_at_)textech(_dot_)in wrote:
Thanks Pankaj, its working fine now.
<xsl:variable name="filename"><xsl:value-of
select="book/title/text()[1]"/></xsl:variable>
--Pankaj
That's not a good solution, however. It's dependent on properties of
your input that might not always hold, and that weren't specified in
your description of the problem - notably, that all the text of the
title other than the indexterm is in a single text node that is an
immediate child of the title element. Pankaj has seen one example of
your input data, and leapt to the conclusion that all other examples
will be the same. You've run it on a single test case (I imagine), and
concluded that it's correct because it works on that test case.
Learn to use template rules: they are the right way to tackle this kind
of problem. In fact, they are the right way to tackle nearly every XSLT
problem.
Michael Kay
Saxonica
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--