|
7.10. Generate HTML OutputIf a user does not have InfoPath and he opens a form data file, that file appears as XML in his browser. The InfoPath SDK provides a down-level tool (XDown) to convert a form file's XML to read-only HTML so others can view InfoPath output. Note: InfoPath forms can only be viewed by users who have InfoPath installed, unless you are using the XDown tool to create an HTML view of the form. 7.10.1. How to do itTo use XDown:
For example, the following command line converts the views from Assets.xsn into XSL that can be used to display asset form data; output files are written to the Down subfolder: XDown /d assets.xsn Down You can then use the XSL files written to the Down folder to transform asset form data files into HTML that can be viewed from a browser. The easiest way to do that is to add a processing instruction to the form data file, as shown in the following XML fragment: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="view_1.xsl"?> <?mso-infoPathSolution solutionVersion="1.0.0.4" productVersion="11.0.5531" PIVersion="1.0.0.0" href="http://wombat1/assets.xsn" ?> <?mso-application prog?> If you make the preceding addition to a form, users who don't have InfoPath can view the form in Internet Explorer, but users who do have InfoPath (such as yourself) will still see it in InfoPath. To make sure your transformation worked, remove the mso-application instruction: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="view_1.xsl"?> <?mso-infoPathSolution solutionVersion="1.0.0.4" productVersion="11.0.5531" PIVersion="1.0.0.0" href="http://wombat1/assets.xsn" ?> <?mso-application prog?> Now the file will open in the browser, rather than InfoPath. 7.10.2. How it worksXDown generates an XSL file for each of the views in a template. You can use any of those XSL files to display the form data, but if you want to be able to switch between views you will have to write some code to use the different XSL files. See Chapter 3 for more information on how to perform transformations. Forms displayed using the XDown-generated XSL files omit buttons and other user-interactive controls. They convert other controls, such as text boxes, into read-only HTML. 7.10.3. What about...
|
|