FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.34k stars 659 forks source link

The xml parser crash when loading a file with a Models tag #362

Open levkevi opened 7 years ago

levkevi commented 7 years ago

When trying to load a file with a Models tag, the parser crash.

Here's an example file with the problematic tag.

models_are_problematic.txt

levkevi commented 7 years ago

It should be fixed in #363

zerox1212 commented 7 years ago

Thanks. Do you know if there is a list of "non-node" XML tags in the spec somewhere?

oroulet commented 7 years ago

What are model tags? does anyone have documentation for that? Maybe this is where we should save xml files used as references? would be great for modeler

levkevi commented 7 years ago

I don't know but I compiled a data model file to a node file using this tool:

https://github.com/OPCFoundation/UA-ModelCompiler

You might find something looking at the code.

oroulet commented 7 years ago

What is a data model file?

On Wed, Nov 16, 2016, 15:16 levkevi notifications@github.com wrote:

I don't know but I compiled a data model file to a node file using this tool:

https://github.com/OPCFoundation/UA-ModelCompiler

You might find something looking at the code.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/FreeOpcUa/python-opcua/issues/362#issuecomment-260957227, or mute the thread https://github.com/notifications/unsubscribe-auth/ACcfzp8jN7rs4i9p0T8fIRvI5OvbNMyBks5q-xAqgaJpZM4KzFIi .

zerox1212 commented 7 years ago

I think it's this: https://github.com/OPCFoundation/UA-ModelCompiler/blob/master/ModelCompiler/UA%20Model%20Design.xsd

Example: https://github.com/OPCFoundation/UA-.NET/blob/master/SampleApplications/Samples/Common/Sample/SampleDesign.xml

levkevi commented 7 years ago

I can confirm, this is the file that @zerox1212 linked.

You usually define your models using those files and then compile it to make the nodeset xml file (the file format the modeler uses)

zerox1212 commented 7 years ago

Looks like OPC Foundation uses this model format to generate nodes and code (classes). Seems like a different approach than python modeler.

oroulet commented 7 years ago

What do you mean? The xsd defines the xml format. Is there another file somewhere?

On Wed, Nov 16, 2016, 23:14 Andrew notifications@github.com wrote:

Looks like OPC Foundation uses this model format to generate nodes and code (classes). Seems like a different approach than python modeler.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/FreeOpcUa/python-opcua/issues/362#issuecomment-261089604, or mute the thread https://github.com/notifications/unsubscribe-auth/ACcfzmNK0wNANH8q-aDaAhzFI62vgmIwks5q-4BSgaJpZM4KzFIi .

bitkeeper commented 7 years ago

Hard to find some information:

@levkevi what do you mean with 'you usually define your models ...' ? By hand or tool ?

Looks like the UAModelDesign is more 'object-oriented' approach of describing the namespace. More easy to parse; object/objectype contain its members as nested childs, instead of nodeid refs to other nodes.

oroulet commented 7 years ago

Does it specify nodeids too? I could not find any , and I am not an expert in xsd...

levkevi commented 7 years ago

@bitkeeper I was told that it was typed by hand.

@oroulet It doesn't specify the nodeid, you have to compile it with their tool (the one linked in their repo) to generate the Node file.