Microsoft KB Archive/826990

= How to view transformed InfoPath form data in Internet Explorer =

Article ID: 826990

Article Last Modified on 7/28/2006

-

APPLIES TO


 * Microsoft Office InfoPath 2003
 * Microsoft Office InfoPath 2003, Service Pack 1 (SP1)

-





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.



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.
 * 1) Start InfoPath. Design a new, blank form.
 * 2) On the blank form, type Enter your name, and then press ENTER.
 * 3) Select the Controls task pane, and then click the Text Box control.
 * 4) Press ENTER two times.
 * 5) In the Controls task pane, click Check Box. Change the label for the check box control to Add me to your mailing list.
 * 6) On the File menu, click Extract Form Files.

The Browse for Folder dialog box appears.

Select c:\IPTest, and then click OK.
 * 1) Close the IPTest form template.

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

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

The modified XML appears as follows:   <?mso-infoPathSolution solutionVersion=&quot;1.0.0.2&quot; href=&quot;manifest.xsf&quot; productVersion=&quot;11.0.5531&quot; PIVersion=&quot;1.0.0.0&quot;?>

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.  Save your changes to Template.xml. Right-click c:\IPTest\manifest.xsf, and then click Design.

The form template opens in InfoPath in design mode.</li> 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 .</li> Close InfoPath.</li></ol>

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.
 * 1) 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. <div class="references_section">