Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to view transformed InfoPath form data in Internet Explorer


View products that this article applies to.

Summary

When you save a form that is based on an InfoPath form template, only the raw XML data for the form is stored in the saved form. If you open the form in an application other than InfoPath, only the raw XML data appears. The XML data is not formatted like the XML data is formatted when the form is opened in InfoPath. If you have to display the formatted XML data (or the XML with the transform applied) in Microsoft Internet Explorer instead of InfoPath, you can modify Template.xml in your form template.

This article describes how to create an InfoPath form template and how to modify Template.xml. You must modify Template.xml in your form template so that the forms that you create with the template can be formatted to display correctly in Internet Explorer.

↑ Back to the top


More information

Design a New Form Template

  1. Create a new folder that is named c:\IPTest.

    You will use this folder to store your form template.
  2. Start InfoPath. Design a new, blank form.
  3. On the blank form, type Enter your name, and then press ENTER.
  4. Select the Controls task pane, and then click the Text Box control.
  5. Press ENTER two times.
  6. In the Controls task pane, click Check Box. Change the label for the check box control to Add me to your mailing list.
  7. On the File menu, click Extract Form Files.

    The Browse for Folder dialog box appears.

    Select c:\IPTest, and then click OK.
  8. Close the IPTest form template.

Modify Template.xml

  1. Open Template.xml from c:\IPTest.

    You can use a text editor or an XML editor.
  2. Locate the processing instructions in Template.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?mso-infoPathSolution solutionVersion="1.0.0.2" href="manifest.xsf" productVersion="11.0.5531" PIVersion="1.0.0.0"?>
    <?mso-application progid="InfoPath.Document"?>
  3. Add an xml-stylesheet processing instruction, and then remove the mso-application processing instruction.

    The modified XML appears as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="C:\IPTest\view1.xsl"?>
    <?mso-infoPathSolution solutionVersion="1.0.0.2" href="manifest.xsf" productVersion="11.0.5531" PIVersion="1.0.0.0"?>
    

    Note Optionally, you can leave the mso-application processing instruction. You can do this if you want to open the form in InfoPath. Also, you cannot remove the mso-infoPathSolution processing instruction from the template. InfoPath cannot create new forms that are based on a template that is missing the mso-infoPathSolution processing instruction.
  4. Save your changes to Template.xml.
  5. Right-click c:\IPTest\manifest.xsf, and then click Design.

    The form template opens in InfoPath in design mode.
  6. On the File menu, click Save As. Click Save if you are prompted to publish or to save the form template. Save the template as c:\IPTest\IPTest.xsn.
  7. Close InfoPath.

Save Two Forms

  1. To fill out a form in InfoPath, double-click c:\IPTest\IPTest.xsn in Microsoft Windows Explorer.
  2. Type a name in the text box, and then click to select the check box control.
  3. On the File menu, click Save As. Save the form as c:\IPTest\Form1.xml.
  4. Repeat step 2 and step 3. Use different input data to create c:\IPTest\Form2.xml.

Display the Formatted Form Data in Internet Explorer

  1. Start Internet Explorer.
  2. In the Address box, type c:\IPTest\Form1.xml, and then click Go.

    The XML data is rendered and then transformed in Internet Explorer by using the View1.xsl style sheet.
  3. Repeat step 2 for c:\IPTest\Form2.xml.

Considerations and Cautions

The steps in this article describe how to save an InfoPath solution and how to create an InfoPath form template with custom modifications on your local computer. In a production environment, you must use caution when you save forms that have custom modifications to your local computer. While the transform can succeed when you run the transform from the local computer, any script or any HTML in the transformed file runs with the administrative credentials of the local computer. Therefore, arbitrary scripts in the file may run without warning and may create potential security issues.

You must also be aware that if you use a transform for your XML data so that you can display InfoPath data in Internet Explorer, some of the form functionality that is present in InfoPath is not present in Internet Explorer. For example, custom scripts and secondary data sources in the solution may not function the same when the form appears in Internet Explorer.

REFERENCES

For additional information about the features and benefits of using InfoPath for your forms, click the following article number to view the article in the Microsoft Knowledge Base:
826991� Install InfoPath to access features and benefits

↑ Back to the top


Keywords: KB826990, kbxml, kbhowto, kbpubtypekc

↑ Back to the top

Article Info
Article ID : 826990
Revision : 11
Created on : 7/28/2006
Published on : 7/28/2006
Exists online : False
Views : 425