Now we should transform the received XML file to HTML. We can do that using the “Transform XML” action which is located in the “HarePoint Activities – Development” activities category.
Select the “XML Data” variable as the first parameter of this action.
The second parameter should include an XSLT request which transforms XML data into HTML. In our example this request looks like this:
<xsl:value-of select="//gesmes:name"/>: <xsl:value-of select="//cubes:Cube/@time" />
The third parameter is the variable in which the HTML code will be saved. When this action is configured it looks like this:
Finally, we can save the HTML code into the file. To do that, we should use the “Create document from Text” action which is located in “HarePoint activities – Document Library” activities category.
The first parameter is our variable which contains HTML data.
The second parameter is location of the file which should be created. It should also contain a filename. For example:
Set the “overwrite” option in the third parameter to overwrite the existing file each time the workflow is started.
The workflow is ready. It looks like this:
Save and Publish the Workflow:
Test the Workflow. Open the web-site where the workflow was published; point to the page “All site content” and click “Site workflows”. Locate your workflow and click on it. Click the “Start” button to execute the workflow. Look at the list called “My completed workflows” and make sure that your workflow has the status “Completed” and that the time of the workflow Start and End is real. Now you can point to Shared Documents and open the file Rates.HTML which was created by the workflow. Verify that the data is displayed properly.
We created a workflow which gets data from a XML file and generates a HTML page, but you can also create a simple web-part which displays the data on the web-part`s page.
You can also watch the whole process of creating such a workflow in this Video Demo.