Export to XML

Export To XML function is used to generate XML files from XML template.

To perform this function, we need to type formula in formula bar i.e. =ExportToXML.SK() as shown in Fig.

ExportToXML() function accepts the following arguments:

· Template: Provide the path of XML template. (Use Relative path of XML template)

· result_path: Provide the path for the output file that will be generated. If no path is provided, then output file will be generated on the Temporary (TEMP) path within SheetKraft Folder.

· StaticKeysRange: Array or range of static tag names. Static tags are the fields that are fixed and have one-to-one mapping with the values that are provided in Excel. These tags should match exactly with the tag names provided in the XML template file.

· StaticValuesRange: Array or range of values corresponding to the static tag names.

· Range1: Range corresponding to the first repeat tag. (Provide the column data for the fields that will be repeated.)

· Report1: Provide the order/sequence of data that will be exported to xml. The data is provided within the Report.SK() function. After Report1 field, data for second set of repeat tags are provided in Range2, Report2 and so on. Providing all the details of arguments in the ExportToXml() function, will generate the XML file.

Sample XML Format

Before selecting the option for ExporttoXml, the data in the XML template should be made

familiar with the required/relevant Tags in Function arguments.

· Provide Function Arguments As per XML Template.

· XML Namespaces are used for providing uniquely named elements and attributes in an XML document. It is a mechanism to avoid name conflicts by differentiating elements or attributes.

It is essential to include a namespace definition for SheetKraft schema

xmlns:sk="http://www.sheetkraft.com/xml-transform"

And this should be placed at the root.

· Mention StaticKeysRange, StaticValuesRange, Range1, Report1 present in XML Template along with all other arguments as shown in fig.

· Click on the Run Book button to run Workbook. Output file will generated at the folder where we provide path to export XML file or output file will be generated on the Temporary (TEMP)path within SheetKraft Folder.