Calling an XSLT function in C#

Topics: General, XSLT
Jul 26, 2011 at 3:41 PM
Edited Jul 26, 2011 at 3:46 PM

Is it possible to call a composite xslt function in an external C# function?

 

I ask because I'm making a function that strips styling off of html, based on this: http://docs.composite.net/C1/XSLT/XSLTFAQ.aspx?q=How+can+I+modify+the+HTML+from+the+Visual+Content+editor%3f

I need it to be called on start-up (thus in C#) and have the style-stripped content permanently replace content of certain pages.

Thanks,

Naibla

Coordinator
Jul 26, 2011 at 5:13 PM
naibla wrote:

Is it possible to call a composite xslt function in an external C# function?


Below is an example how to call XSLT named Composite.Feeds.TwitterReader with one input parameter Username:

	IFunction func = FunctionFacade.GetFunction("Composite.Feeds.TwitterReader");
		NameValueCollection parameterValues = new NameValueCollection();
		parameterValues.Add("Username", "CompositeC1");
		XElement output = FunctionFacade.Execute<XElement>(func, parameterValues);

Jul 27, 2011 at 3:55 PM

Thank you for the fast response!

I have it working now.