Create an XSLT File
In this example, we are using the following XML file as an example.
<?xml version="1.0" standalone="yes"?>
<Rows>
<Row Id="1" Name="DataMining Ltd" />
<Row Id="2" Name="Nelson Inc" />
<Row Id="3" Name="Internetware Ltd" />
</Rows>
To transform this data into a format that can be used by the Sage 50 Import Customers Task, you would use an XSLT transformer which is a simple text file containing instructions on how to convert the XML
All the XSLT processing instructions start with the prefix 'xsl' followed by an instruction e.g. <xsl:value-of select="@Variable" />
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<Company>
<Customers>
<xsl:for-each select="Rows/Row">
<Customer>
<AccountReference>
<xsl:value-of select= "@Id"/>
</AccountReference>
<CompanyName>
<xsl:value-of select= "@Name"/>
</CompanyName>
</Customer>
</xsl:for-each>
</Customers>
</Company>
</xsl:template>
</xsl:stylesheet>
Output from XSL transform
<?xml version= "1.0" standalone= "yes"?>
<Company>
<Customers>
<Customer>
<AccountReference>1</AccountReference>
<CompanyName>DataMining Ltd</CompanyName>
</Customer>
<Customer>
<AccountReference>2</AccountReference>
<CompanyName>Nelson Inc</CompanyName>
</Customer>
<Customer>
<AccountReference>3</AccountReference>
<CompanyName>Internetware Ltd</CompanyName>
</Customer>
</Customers>
</Company>