2

this is my xslt

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"                    
                xmlns:MyUtils="pda:MyUtils"
                exclude-result-prefixes="MyUtils">
  <xsl:template match="/">
        <Envelope>
          <xsl:variable name="entityData" select="..//ArrayOfEntityRow"/>
          <xsl:variable name="data" select="MyUtils:get_data().GoodData()"/>    
        </Envelope>
  </xsl:template>
</xsl:stylesheet>

and this is the extension class

    class MyExtension
    {
        public MyExtension()
        {
            data = new Data();
        }

        public Data data
        {
            get; set;
        }
    }

    class Data
    {
        public string GoodData()
        {
            return "hello";
        }
    }

I am getting the following error "Extension function parameters or return values which have Clr type 'Data' are not supported." Though I am returning string from GoodData() function. I want to access GoodData() function from xslt..How can I do it?

The extension object added to the XSLT is of type "MyExtension" not "Data"

Bernard Vander Beken
  • 4,848
  • 5
  • 54
  • 76
Saurav
  • 592
  • 4
  • 21
  • Hello @DanielA.White this is not duplicate of the previously asked question. I had gone through that link previously – Saurav Jan 18 '18 at 14:15
  • have you looked into returning one of the types listed on the accepted answer: https://stackoverflow.com/a/3046957/23528? it sounds like theres only a few things you can return and `Data` isnt one of them. – Daniel A. White Jan 18 '18 at 14:17
  • I cannot add the function MyExtension class.. The function must exist in Data class.. Also MyExtension needs to be extension object to xslt – Saurav Jan 18 '18 at 14:19

0 Answers0