XSL file gives error while converting a InfoPath XML - InfoPath Dev
in

InfoPath Dev

XSL file gives error while converting a InfoPath XML

Last post 12-18-2012 06:46 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-18-2012 06:33 AM

    XSL file gives error while converting a InfoPath XML

    Hi all,

    I have an InfoPath 2007 (client mode) solution in place. The template is split into multiple views - Sales, Compliance, etc. If I attempt to convert the XML of a live document using the Sales.xsl , the error message is as follows:

    Error in XPath expression Unknown function - Name and number of arguments do not match any function signature in the static context - 'http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument:get-Role'

    The section in the XSL which leads to this error message is:

    <xsl:when test="xdXDocument:get-Role() = &quot;Sales&quot; or xdXDocument:get-Role() = &quot;Legal&quot; or xdXDocument:get-Role() = &quot;Sales COO&quot; or xdXDocument:get-Role() = &quot;Financial Crime&quot;">DISPLAY: none</xsl:when>
    

    I did the above using Altova XML SPY. Similar error while using VS.NET XML menu option for doing a XSLT transformation. I have not yet attempted to do this programmatically. It is obvious to me that the XSLT is unabel to resolve the references to the custom functions. I just want to hear from the experts whether it is possible at all to use the views to do a conversion of the document XML as opposed to writing a XSLT from scratch?

    My objective - produce a light weight read-only view of the InfoPath document without having to open up the client app and render the output to match the views within Infopath.

    thanks,

    Saurabh

  • 12-18-2012 06:46 AM In reply to

    Re: XSL file gives error while converting a InfoPath XML

    InfoPath's view XSLs use custom XPath functions, and it seems that both of the XSL transform utilities that you are using are erroring out when they get to one of the custom functions (in particular, the one causing the error is xDocument:get-Role(). I don't know about Altova, but .NET does allow defining custom XPath functions for XSLTs:

    http://msdn.microsoft.com/en-us/library/tf741884.aspx

     I think you'd need to create definitions for most of InfoPath's custom functions (or at least create placeholders for them that do nothing) in order to get your approach to work.  We have already implemented most of these functions in the upcoming 4.3 version of our qRules product and have added a command that allows rendering a form's views into an HTML file.  If you're interested, you could use that command to generate an HTML file and then save it out somewhere any time a form is submitted.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.