Re: getting the node position in source xml in a varia
Hi Gurvinder, > I have one more query... you said that i am not passing the result > tree fragment what does it mean... i thought when i select nodes and > pass it as parameter is is passing result tree fragment No - when you select nodes and pass them using the select attribute of xsl:with-param, then you pass those nodes as a *node set*. It's only if you use the *content* of the xsl:with-param that you create a result tree fragment. For example, if you did: <xsl:call-template name="lookup"> <xsl:with-param name="name">test</xsl:with-param> <xsl:with-param name="nodes"> <xsl:copy-of select="/test/Level2" /> </xsl:with-param> </xsl:call-template> With this call, both $name and $nodes are result tree fragments. It doesn't matter too much with $name, because it's a result tree fragment whose root node only has one child - a text node with the value 'test' - although a result tree fragment is a little more unweildy for the processor than a plain string would be. On the other hand, the $nodes parameter is set to a result tree fragment whose root node has a number of Level2 element children. Because that result tree fragment has structure, you usually have to convert it back into a node set (e.g. using msxsl:node-set()) to do anything useful with it. This means that in general you should use the select attribute to set the values of variable-binding elements, such as xsl:variable, xsl:param and xsl:with-param. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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