Initial configuration of SmartXML is recommended to be done using the graphical interface. However, for the purpose of simplifying automation of processing, the application can be run without loading the graphical interface.
-
Open a project with the specified name:
.\SmartXML -proj=sample_1
-
Open a project with the specified name and set the Job number:
.\SmartXML -proj=sample_1 -job=2
Note: specifying the Job number is important only if XML for processing is stored in the database table.
More detailed information is available on the jobs-settings page.
If Job is not specified, the project will be opened with Job set to 1 by default.
-
Open a project with the specified name, set the Job number, and automatically start parsing:
.\SmartXML -proj=sample_1 -job=2 -start
Note: specifying the Job number is important only if XML for processing is stored in the database table.
More detailed information is available on the jobs-settings page.
If Job is not specified, the project will be opened with Job set to 1 by default.
The
-start
flag is used exclusively when working with the database and is NOT used when processing individual files. -
Open the project sample_1 and substitute an XML file for processing. Wait for the button press in the interface:
.\SmartXML.exe -proj=sample_1 -file=D:/code/SmartXML/data-samples/sample-1/example_1.xml
-
Run the sample_1 project, substitute XML for processing, specify the folder to write the result (folder should exists), and the target format. Do not display the interface:
.\SmartXML.exe -proj=sample_1 -file=D:/code/SmartXML/data-samples/sample-1/example_1.xml -outfolder=D:\test\output -format=json -noui
Note: the target folder must exist.
JSON and SQL formats are supported.
-
Run the sample_1 project, substitute XML for processing, write the result to the same directory where the original XML is located, specify the target format. Do not display the interface:
.\SmartXML.exe -proj=sample_1 -file=D:/code/SmartXML/data-samples/sample-1/example_1.xml -format=json -noui
JSON and SQL formats are supported.
-
The following tags can be combined with the examples above:
By default, the parser stops when encountering unknown tags. The following command line arguments allow changing this behavior:
.\SmartXML.exe -lu
Log unknown tags. Add them to the interface if it is loaded:
.\SmartXML.exe -su
Skip unknown tags. Do not stop on them and do not add them to the interface (if it is loaded).
Note: These keys may be needed if, during batch processing, XML documents may contain unknown tags, the processing of which is not critical, and there is no reason to stop the processing process, but it is enough to log and/or skip these tags.
If you need assurances that the process will be restarted even in case of a possible error, you can use the following bat file:
@echo off
:Start
D:\code\SmartXML\SmartXML.exe -proj=name -job=1 -start
:: Wait 30 seconds before restarting.
TIMEOUT /T 30
GOTO:Start