Parse XML File
This sample parses an XML file and inserts new orders into the Northwind database. You can get sample Northwind databases here.
This Linx Solution uses the Xml, Database, File and Utilities plugins.
To run the sample
- Open the ParseXMLFile solution.
- Click on the Settings button.
- On the Settings tab change the values of the Settings to suit your environment (if you need help with the database connection string, have a look at this help topic).
- Open the sample Process you want to run from the Solution Explorer pane on the left.
- Click the Debug or Run buttons to run the Process.
How it works
There are three processes:
Parses the XML file using the XmlReader function and inserts the records into the database.
Writes the imported orders to an XML file using the XmlWriter function to check that the import succeeded.
Deletes the imported orders.
Create your own Solution
- Create a Solution
- Rename your Solution, Project and Process
- Add Settings to the Solution
- Add Plugins
- Build a process for ImportOrders
- Add an XmlReader function
- Debug the ImportOrders process
- Loop through the XmlReader results
- Insert each Order into the database
- Loop through each order's Order Details
- Insert the Order Details into the database
- Debug your final process
- Build a process for ExportImportedOrders
- Add a process
- Add a CustomType
- Add a List to the ExportImportedOrders process
- Read from the database
- Add SQL output to a Custom Type
- Add Custom Types to a List
- Create the XML structure
- Write an XML structure to a file
- Build a process for DeleteImportedOrders
- Add a Process
- Delete from the database
- Build an automated test process: TestDemo
- Call an internal process from within a process
- Read the imported orders
- Compare the Expected Results to the Actual Results
- Add the XmlPeek function
For a detailed description of these steps, go here.