Accesing C# Code from XSL file
Posted: Tue May 22, 2018 10:09 am
Hi everybody, again askin questions, and my question now it's a bit complicates althought also very useful to work in this way, in my company they mix the Xslt code with C# Code so they uses CLITYPE in the namespace of the XSL file in order to access the objects in .Net Libraries so the can use the lib for getting the data from DB or XML files with Linq to Xml and the the xsl file for showing or formatting.
so for accessing to the library they do three steps:
1) stablish an special namespace declaration --> xmlns:client="clitype:Empresa1.Datos.Clients.Client?asm=LibEmpresa"
2) declare te methods to be accessed as static --> public static decimal GetData(int ClientId) { ...} (inside client class)
3) access the methods from inside the XSL file --> <xsl:value-of select="client:GetData(num) />
And it works well in Visual Studio but I can check it with Oxygen, and I wanti to know if is there any way of getting this working in Oxygen for testing all the functionality, because VS doesn't debug XLS.
I currently work with the Oxygen Xml Editor release 11.2 and Saxon PE 9.2 and it recognizes my code but later in the third point client:GetData it doesn't access the method and yields an error message telling that it doesn't find such method.
Best Regards
so for accessing to the library they do three steps:
1) stablish an special namespace declaration --> xmlns:client="clitype:Empresa1.Datos.Clients.Client?asm=LibEmpresa"
2) declare te methods to be accessed as static --> public static decimal GetData(int ClientId) { ...} (inside client class)
3) access the methods from inside the XSL file --> <xsl:value-of select="client:GetData(num) />
And it works well in Visual Studio but I can check it with Oxygen, and I wanti to know if is there any way of getting this working in Oxygen for testing all the functionality, because VS doesn't debug XLS.
I currently work with the Oxygen Xml Editor release 11.2 and Saxon PE 9.2 and it recognizes my code but later in the third point client:GetData it doesn't access the method and yields an error message telling that it doesn't find such method.
Best Regards