XML Nodeset Compiler
--------------------
When writing an application, it is more comfortable to create information models using some GUI tools. Most tools can export data according the OPC UA Nodeset XML schema. open62541 contains a python based nodeset compiler that can transform these information model definitions into a working server.
Note that the nodeset compiler you can find in the *tools/nodeset_compiler* subfolder is *not* an XML transformation tool but a compiler. That means that it will create an internal representation when parsing the XML files and attempt to understand and verify the correctness of this representation in order to generate C Code.
Getting started
...............
We take the following information model snippet as the starting point of the following tutorial. A more detailed tutorial on how to create your own information model and NodeSet2.xml can be found in this blog post: https://opcua.rocks/custom-information-models/
.. code-block:: xml
http://yourorganisation.org/example_nodeset/
i=1
i=7
i=12
i=37
i=40
i=45
i=46
i=47
i=296
providesInputTo
i=33
inputProcidedBy
FieldDevice
i=58
ns=1;i=6001
ns=1;i=6002
ManufacturerName
i=63
i=78
ns=1;i=1001
ModelName
i=63
i=78
ns=1;i=1001
Pump
ns=1;i=6003
ns=1;i=6004
ns=1;i=1001
ns=1;i=7001
ns=1;i=7002
isOn
i=63
i=78
ns=1;i=1002
MotorRPM
i=63
i=78
ns=1;i=1002
startPump
i=78
ns=1;i=6005
ns=1;i=1002
OutputArguments
i=78
ns=1;i=7001
i=68
i=297
started
i=1
-1
stopPump
i=78
ns=1;i=6006
ns=1;i=1002
OutputArguments
i=78
ns=1;i=7002
i=68
i=297
stopped
i=1
-1
Take the previous snippet and save it to a file ``myNS.xml``. To compile this nodeset into the corresponding C code, which can then be used by the open62541 stack, the nodeset compiler needs some arguments when you call it. The output of the help command gives you the following info:
.. code-block:: bash
$ python ./nodeset_compiler.py -h
usage: nodeset_compiler.py [-h] [-e ] [-x ]
[--generate-ns0] [--internal-headers]
[-b ] [-i ]
[-t ]
[-v]
positional arguments:
The path/basename for the