locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
507 stars 136 forks source link

Importing NodeSet XMLs directly instead of generating Rust code from them #224

Open robertsarkozi opened 2 years ago

robertsarkozi commented 2 years ago

Hello,

Is there a way to import NodeSet XMLs directly into an AddressSpace object, instead of using the tools/schema/gen_nodeset.js tools?

I have a file for which it generates incorrect code for Rust version 1.59, and the generated .rs file needs to be corrected in some cases (I had to replace double quotes in description texts manually, because they were breaking up the descriptions...). With the generated .rs file, if it was generated correctly, some kind of "compile & use library" operations could be done, but if there are compilation errors, it cannot be automated: https://github.com/manthanrtilva/runtime_plugin/blob/master/src/main.rs

It would be nice to import the NodeSet XMLs to some XML structure (NodeSet object maybe) and then populate the AddressSpace object with that, similarly to what the OPCUAFoundation has here: https://github.com/OPCFoundation/UA-.NETStandard/issues/546

Opc.Ua.Export.UANodeSet nodeSet = Opc.Ua.Export.UANodeSet.Read(stream);

Thanks

piperoc commented 1 year ago

I second this requirement (I understand is a tall order). Also consider implementing and exporting facility as well. I will be looking into this myself and will post as I learn more (just starting out with Rust...)