Sample DB to XML

Top  Previous  Next

Current XML definition for XML files that can be imported by Crash Magic. The purpose of this section is to document the XML structures used by the converter. Clients should not alter the XML directly. The XML defines how the data is queried and how the generated XML file is defined. All XML files generated by the Crash Magic Converter will begin with  "<pdroot>" as the root element.






Exmaple start of the XML file


OutputDir - Specifies the output directory for the XML files generated.


Defining XML structure of the the file to be created.





                 <ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ImportData;

Extended Properties="text;HDR=NO;FMT=Delimited"</ConnectionString>




                         <RequiredFile>Import schema.ini</RequiredFile>



































                         <QueryLine>FROM CrashEnvironment#txt</QueryLine>

                         <QueryLine>WHERE IncidentDate BETWEEN '1/1/2012' AND '1/15/2012'</QueryLine>

                         <QueryLine>ORDER BY IncidentID</QueryLine>









Example specification of the primary XML element



TableSpec - Specifies the start of the xml structure that will be created.

Name - Name of the of the table specification

Primary - Boolean value that indicates if this is the primary XML node.

ConnectionString - Defines the connection to the data source.

Login - Login name if required by the data source.

Password - Password for the login if required by the data source.

RequiredFile - Name of and required Utility - Text lines PSRattr for import (In this example a schema.ini file has been added to a Utility -Text line with the name of "Import schema.ini").

BaseName - Starting node of the XML crash record

GroupName - Used to define a group of XML nodes for example a value of Vehicles can be used to define a group of Vehicle children records

ItemName - The name of the XML node that will contain elements from the select statement.

QueryLine - Query to extract records from source. Each field returned from the select statement creates an XML element.

UniqueField - The primary identifier for the record. This field will also be used for name of the XML file that is created.

ChildName - The TableSpec name of XML children that will be included in the XML file.