.NET access to InfoPath functions (FormatString) - InfoPath Dev
in

InfoPath Dev

.NET access to InfoPath functions (FormatString)

Last post 01-25-2007 06:17 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-25-2007 02:42 AM

    .NET access to InfoPath functions (FormatString)

    Hi,

    I posted this to the General group, maybe this forum is a better match. Also this post has more info.

    I am using InfoPath 2003 to create a read-only view (really a report, not a form). I then extract the view (.xsl) file from the .xsn file and use it outside InfoPath to create an HTML display from an XML data file. The latter part is done with .NET's parser, XslTranform. My problem is that some formatting functionality available is InfoPath, specifically the formatString function, is not available outside it. See e.g. XSL snippet on bottom.

    This functionality ("xdFormatting")is apparently defined in the name space xmlns:xdFormatting="http://schemas.microsoft.com/office/infopath/2003/xslt/formatting". My question is if there is some InfoPath extenstions library then I need to get and use to have access to this functionality? Other suggestions? Does this problem go away in InfoPath 2007? (since they have "browser-compatible" templates that can be displayed in IE w/o InfoPath client)?

    Another direction (and diversion): I saw in http://www.topxml.com/XmlDocument/re-50587_Using-ms-string-compare-and-the-rest-MS-extension-functions-in-XPath-only-context.aspx that there is a new parser XslCompiledTransform which is supposed to be faster then XslTransform and also implements MSXML extension functions, such as ms:format-date. But it is only avaialble in .NET 2.0, we are still on 1.1 (plan to move later this year). Also I am not sure if this will solve the problem: are InfoPath XPath extension functions, such as xdFormatting:formatString, internally translated to MSXML extension functions, such as ms:format-date?

    Thanks!

    -- Shaul

    -----------------------------

    This XSL snippet uses "xdFormatting:formatString", if available, to present a date/time value in some format. If the function is not available it presents the date/time as is (as in the XML):

    <xsl:choose>
    <xsl:when test="function-available('xdFormatting:formatString')">
    <xsl:value-of select="xdFormatting:formatString("1961-09-18T03:00:00","datetime","locale:1033;dateFormat:dddd, MMMM dd, yyyy;timeFormat:hh:mm:ss tt;")"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select=""1961-09-18T03:00:00""/>
    </xsl:otherwise>
    /xsl:choose>
  • 01-25-2007 06:17 PM In reply to

    Re: .NET access to InfoPath functions (FormatString)

    Hi Shaul,
    Lots of good ideas above. I don't think that the InfoPath object model will let you access the format stuff and so far as I know, there is no extensions library. I'm guessing that the Form Server will support this, but I haven't checked and beware: it doesn't support a lot of things. Good luck!
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.