1

It is possible to create custom functions using .NET 4.5 XSLT processor ?

All I could do is to create templates and call them by sending parameters.

There is a work-around or something ? or should I simple go to 2.0 ?

Something like this:

<xsl:function name="name">
... my function
</xsl:function>

Thanks!

2
  • do you mean scripts (vb, etc) inside the xslt? or do you mean external functions on objects that you pass in? both are possible Commented Oct 27, 2014 at 19:57
  • Hi Marc, I mean like xslt functions, I wanted to create my own function, now I'm using templates, but I wonder if .NET XSLT would work with these functions. Commented Oct 27, 2014 at 20:00

1 Answer 1

1

xsl:function is a xsl 2.0 feature. The inbuilt .NET xsl processing is not 2.0 (it is W3C XSL Transformations (XSLT) Version 1.0 Recommendation).

You can use script blocks (via XsltSettings.EnableScript), and you can use methods exposed on external objects (via XsltArgumentList.AddExtensionObject). Or you can use a different (2.0) xslt processor; maybe Saxon.

Sign up to request clarification or add additional context in comments.

1 Comment

Nice! I think I will stick with .NET for now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.