Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Loading NodeSet.xml from String or DOM
October 16, 2014
13:26, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I have the content of a NodeSet.xml model available in memory as a String and would like to load the model into the addressSpace at runtime. I can’t figure out a way though how to call getAddressSpace().load(URI), or in other words, how to obtain a URI from an in memory String (or DOM) without going through a temporary file.

I’m wondering whether you are considering to overload the NodeManagerTable.load() method with a version accepting a String? (ultimately an overloaded ModelParserBase.parseFile())

Cheers,
Hans-Uwe

October 16, 2014
13:54, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, you are correct, there should be an overload that takes an InputStream, for example. We will add such methods in near future.

October 16, 2014
16:01, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I created an overloaded ModelParseBase#parseFile(InputStream xmlStream) and it seems to work. But I noticed 2 other little things:
1) The SAX inputSource should perhaps be created on an an InputStream (also in the original method) rather than on an InputStreamReader (I got an exception otherwise as described here: http://stackoverflow.com/quest…..-in-prolog )
2) the ModelParser also tries to parse the extensions elements and throws exceptions, because it is missing enums for any elements underneath extensions. The model is still been loaded but it is not nice for the users if they see the stack traces in the console output. Even if the element shall be parsed for some reason, maybe the stack trace could be suppressed (the logger.error message would suffice)

Thanks,
Hans-Uwe

October 17, 2014
12:36, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

1) I added the overloads – and sent you an update by email
2) The extensions (generated by UaModeler) should be completely ignored by the parser and I don’t see any notifications for them. What do you see and what does your extensions element look like?

October 20, 2014
9:27, EEST
Avatar
JamesXiao
New Member
Members
Forum Posts: 1
Member Since:
October 20, 2014
sp_UserOfflineSmall Offline

Hi Both
I’ve a related question but in the other direction:
Is it possible for me to save the current addressSpace to a noteset.xml?

Hopefully there is some API to do so from prosys, if not, any hint about how do fullfill that by myself in a quicker way?

Many thanks in advance

October 20, 2014
9:53, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Unfortunately, there is no means to generate the NodeSet from the address space at the moment. That is on the TODO list, but there is no exact decision on which version it will be available.

Regarding the above issue wit the Extensions causing problems. it has been fixed now internally.

October 24, 2014
16:28, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hello James,

I’m using JAXB generated Java classes (plus manual changes) to serialize the nodes of one or more node managers. I find this more convenient than manipulating XML directly.

Cheers, Hans-Uwe

September 21, 2017
15:01, EEST
Avatar
Ibrahim
Member
Members
Forum Posts: 78
Member Since:
August 20, 2014
sp_UserOfflineSmall Offline

Hi Jouni,
i was looking for a way to generate nodeset.xml from adress space like james with the sdk. Now it’s 3 years ago since this question was asked. Is there now a possibbility to do this?

Ibrahim

September 21, 2017
18:17, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Ibrahim,

Indeed it’s been pending for a long while at low priority. But we are finally working on it and the functionality is coming to a future release. Unfortunately, though, I cannot yet give any more exact information on when and how exactly it will be available.

BR, Jouni

September 26, 2019
11:55, EEST
Avatar
Thomas
New Member
Members
Forum Posts: 1
Member Since:
September 26, 2019
sp_UserOfflineSmall Offline

Any more information about the possibility of generating a nodeset.xml from a populated address space using the latest Java SDK ?

Kind regards,
Thomas.

October 21, 2019
14:54, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Sorry, this question slipped from us. And also, I have to regret that we still haven’t managed to accomplish this and I still don’t have an estimate. But it’s still in mind, and I also hope that we can deliver it in future.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 736

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1