Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

New to InfoPath. I'm using the format-date XSLT function in an InfoPath 2010 form. It works fine in InfoPath (2010), but when I go to publish to SharePoint (2010), I get the following error:

The following expression could not be parsed because of a syntax error or because it uses an undefined namespace prefix or unsupported function: concat(., " - ", msxsl:format-date(xdDate:Now(), "yy MMM"), " - ",../my:Subject).

The code just uses the current field, the current date, and built-in Subject property data to create a string that will display in a read-only field. Seems pretty simple to me.

I'm pretty sure the code is fine (verified by Infopath and tests fine), so it's either an unsupported function or an undefined namespace prefix. I find it hard to believe format-date is an unsupported function – it works perfect in InfoPath, and the method seems like the most obvious way to format dates within a string.

So this looks like an undefined namespace issue, but I can't see where/how to define. I Googled a bit and learned to rename the XSN to a CAB file, then extracted, but everything looked defined to my amateur eyes. (Note: I did not specifically add any definitions at this step.)

Any tips please?

share|improve this question
add comment

3 Answers

Just ran into the same thing. It appears that your throwaway line

I find it hard to believe format-date is an unsupported function

is the bitter truth. It will work fine in InfoPath Filler and Designer but dies when you use it in browser mode.

Code or third-party tools seem to be the way to go.

share|improve this answer
add comment

Check if you have the xmlns:msxsl="urn:schemas-microsoft-com:xslt" attribute in your XSL stylesheet declaration. If not, add it.

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt">

or something along those lines.

share|improve this answer
    
Thanks for your response. My XSL stylesheets (generated by InfoPath Designer) both had both of these attributes in them when I opened them up to review. The attributes were included exactly as you've written them, along with other attributes. –  rgmatthes Apr 9 '12 at 15:54
add comment

The context of the error is not quite clear but anyway.

A quote from [1, p.719] to make a conceptual insight into similar issues, probably they are the same if to read XSLT instead of "sort":

  • First, there are two ways to sort data in InfoPath: in the view or in the data. Sorting content in the view simply orders the visual presentation of the data; it does not actually touch the data in the XML. With XSLT driving the presentation layer of InfoPath, you could modify the view (.xsl file) to include an xsl:sort directive...

    Moreover, view-based sorting is not supported in browser-enabled form templates because it requires manual hand editing of the view XSL file. Sorting the form data will work similarly in client and browser-enabled form templates

[1]
Scott Roberts, Hagen Green, Jessica Meats
Designing Forms for SharePoint and InfoPath. Using InfoPath Designer 2010
Addison-Wesley

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.