views:

53

answers:

1

Hi, i'm using XsltArgumentList.AddExtensionObject with sucess. The problem is when i call the functions from the xslt, they only get the arguments i pass. How can i get the context (what node is being processed).

I am using XslTransform.Transform (myXPathDoc, xslArgs, myWriter); to start the transformation..

I heard about SetContext and RegisterCustomFunction but they only seem to work on XPathExpression objects...

Thanks

A: 
Dimitre Novatchev
Dang. How do i pass it as a parameter?I Have<xsl:value-of select="extFn:MyExtensionFunction('A',./code,./date)"/>
Joaozinho das Couves
@Joaozinho-das-Couves: See the updated solution for example. :)
Dimitre Novatchev
well almost, what i actually wanted was not the data node, but the actual xslt context node.In the end what i want is when there is an exception thrown by my function i want to say wich xslt node caused the exception (my function is used like 10 times in a xslt and depending on the parameters it can throw an exception)
Joaozinho das Couves
@Joaozinho-das-Couves: `.` *is* the context node -- not the "data node". This is exactly what you say you wanted.
Dimitre Novatchev