omnet and XML files

532 views
Skip to first unread message

Antonio Virdis

unread,
Apr 23, 2014, 5:49:20 AM4/23/14
to omn...@googlegroups.com
Hi everyone

I'm trying to dinamically read XML files during a simulation. Those files are created by an external program and are refreshed dinamically (during simulation).
I inserted the following line of code within the .ned definition of a module and I'm able to parse the file correctly.

volatile xml input = default(xmldoc("file.xml"));

The problem is that the file is loaded into memory just ones (at the first access), regardless of the volatile keyword. 
Every following access sees the same file, even if it has been changed.

NOTE: I already tried updating the value of the param from the C++ code in various way, but with no result.

Thanks in advance for any help or suggestion

Rudolf Hornig

unread,
Apr 23, 2014, 6:55:38 AM4/23/14
to omn...@googlegroups.com
XML documents are cached by default.

Instead of accessing the file via a parameter I would just define the file name as a parameter and would use the XML methods in envir:



Rudolf

Antonio Virdis

unread,
Apr 23, 2014, 8:21:39 AM4/23/14
to omn...@googlegroups.com
This seems to be exactly what I was looking for! I'll give it a try

Thanks Rudolf
Reply all
Reply to author
Forward
0 new messages