String Manipulation in view1.xsl breaks form - InfoPath Dev
in

InfoPath Dev

String Manipulation in view1.xsl breaks form

Last post 01-07-2009 06:14 AM by DummyDumb. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-06-2009 04:29 PM

    String Manipulation in view1.xsl breaks form

    Hi,

    I tried to do some string manipulation (variations of substring) in view1.xsl of an Infopath form which works absolutely fine in Preview mode.

    However when I try to create a new form after template deployment I receive an "Infopath cannot open the form" - error. The error details say: "The form template is trying to access files and settings on your computer. InfoPath cannot grant access to these files and settings because the form template is not fully trusted. For a form to run with full trust, it must be installed or digitally signed with a certificate."

    works:

    <xsl:value-of select="@ows_Person"/>

    does not work:

    <xsl:value-of select="substring(@ows_Person, 5)"/>

    <xsl:value-of select="substring-after(@ows_Person, '#')"/>

     

    However the form is fully trusted and works just fine without string manipulation in the view1.xsl. Is there a way to overcome this error?

     

    Thanks,

    DD

  • 01-06-2009 07:51 PM In reply to

    Re: String Manipulation in view1.xsl breaks form

    InfoPath often doesn't take kindly to having its XSL modified.  What precisely are you trying to do?  Maybe there is a way to do it from within the InfoPath designer.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-06-2009 09:09 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: String Manipulation in view1.xsl breaks form

    Hello,

    Can you look at once the below link as you worked previously,

    http://www.infopathdev.com/forums/p/10156/36127.aspx#36127

    Here is not difference of Full trust form or not fully trusted. Here string functions should be correct. If you copied those lines form word or code file it might hidden some other text. For this you have remove the line and type it again in view1.xsl

  • 01-07-2009 12:10 AM In reply to

    Re: String Manipulation in view1.xsl breaks form

    Hello Jimmy, Shiva,

    Thanks for your replies.

    I am trying to do some string manipulation for the display values of a dropdown list as described here:

    http://www.infopathdev.com/forums/p/10156/36127.aspx#36127

    The Infopath Form is part of a Sharepoint feature packed in a wsp file.

    So the way I tried to manipulate the display values was the following.

    • Saved my Infopath Form as source files
    • edited view1.xsl by replacing the display value as described in the posting mentioned above:
      ****** Code snippet: *******

      <select class="xdComboBox xdBehavior_Select" title="" style="FONT-SIZE: xx-small; WIDTH: 286px" size="1" xd:binding="../my:VLSelection/my:DDLVertriebsleiter" xd:xctname="dropdown" xd:CtrlId="CTRL182" xd:boundProp="value" xd:postbackModel="always" value="" tabIndex="0">
            <xsl:attribute name="value">
             <xsl:value-of select="../my:VLSelection/my:DDLVertriebsleiter"/>
            </xsl:attribute>
            <xsl:choose>
             <xsl:when test="function-available('xdXDocument:GetDOM')">
              <option/>
              <xsl:variable name="val" select="../my:VLSelection/my:DDLVertriebsleiter"/>
              <xsl:if test="not(xdXDocument:GetDOM(&quot;GetVertriebsleiter_wo_Secretaries&quot;)/xml/rs:data/z:row[@ows_Login=$val] or $val='')">
               <option selected="selected">
                <xsl:attribute name="value">
                 <xsl:value-of select="$val"/>
                </xsl:attribute>
                <xsl:value-of select="$val"/>
               </option>
              </xsl:if>
              <xsl:for-each select="xdXDocument:GetDOM(&quot;GetVertriebsleiter_wo_Secretaries&quot;)/xml/rs:data/z:row">
               <option>
                <xsl:attribute name="value">
                 <xsl:value-of select="@ows_Login"/>
                </xsl:attribute>
                <xsl:if test="
      $val=@ows_Login">
                 <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                <xsl:value-of select="substring(@ows_Person, 5)"/>
               </option>
              </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
              <option>
               <xsl:value-of select="../my:VLSelection/my:DDLVertriebsleiter"/>
              </option>
             </xsl:otherwise>
            </xsl:choose>
           </select>
      ****** End Code snippet: *******
    • saved view1.xsl
    • opened manifest.xsf in Design Mode
    • saved manifest.xsf (& checked if the changes are still there) <- checked in Infopath Preview mode - everything works fine up to here
    • published the Infopath Form
    • rebuild my Sharepoint Feature with the updated Infopath Form
    • process of updating / activation... of the feature on the Sharepoint Site

    As soon as I change value-of select to any kind of substring... the form breaks.

    To check if changes are reflected in view1.xsl I tried to change the line in bold to e.g.: <xsl:value-of select="@ows_Login"/> which also worked fine.

    @Jimmy: unfortunately Sharepoint Designer is not an option here, as I have to go through a Sharepoint Feature deployment process without making manual changes at the target system.

    Thanks again,

    DD

  • 01-07-2009 05:27 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: String Manipulation in view1.xsl breaks form

    Hello,

    Before publishing are you trying make any changes in UI (view1.xsl) file? If you are adding the conditional formatting or modifying binding for dropdown then your changes might be lost in view1.xsl.

  • 01-07-2009 06:14 AM In reply to

    Re: String Manipulation in view1.xsl breaks form

    Hello Shiva,

    I do the changes in the following order:

    • edit view1.xsl and save it
    • open manifest.xsf, save it (don't know if this step is necessary), publish it to the resources that I need for installing my feature
    • rebuild my feature, install and activate it 

    If I do change e.g. a font size in this way, changes are retained - I just don't know if certain actions are allowed when doing e.g. string manipulations.

    When I add text within the option tags it seems that WebForms cannot handle that. I also tried to manipulate the display string as secribed here (http://blog.novotronix.com/?tag=/xsl) under "Infopath- Advanced Design" with the result that Feature Activation crashes. Based on the "Update" comment at the bottom, I fear that certain manipulations are not possible with WebForms.

    Or maybe I just doing something completely wrong?

     

    Thanks,

    DD

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.