Closed GoogleCodeExporter closed 9 years ago
Original comment by david.kupka@gmail.com
on 8 Oct 2013 at 8:13
Hello,
on current master HEAD (master@505eb702ddbc) I'm unable to reproduce the
problem You are describing. Code similar to Yours is in yinmodel_parse function
since june (according to git blame src/transapi/yinparser.c) and I see the
ns_prefix property of structure model_tree is filled in all elements.
Can you please try Your case with library build from current sources?
In addition, It is unlikely that you code will behave correctly since the
ns_mapping array is structured as {"prefix1", "uri1", "prefix2", "uri2", ...,
"prefixN", "uriN", NULL, NULL}. Assuming You have 2 namespaces, Your
array will look like this {"prefix1", "uri1", "prefix2", "uri2", NULL, NULL}.
Your code will assign prefix "prefix2" to elements with namespace uri = "uri1"
and will crash while trying to assign prefix for namespace uri = "uri2"
(strdup(NULL)).
Best regards,
David Kupka
Original comment by david.kupka@gmail.com
on 8 Oct 2013 at 11:27
Hi David,
I believed that the ns_mapping is something like
"module_name1","uri1","prefix1","module_name2","uri2","prefix2",...
I suppose my callbacks are generated in a different way(a wrong way).
Do you have an tutorial(email/readme, etc) related to multiple(individual)
schema support ?
Thank you,
Catalin
Original comment by catalin.olteanu
on 8 Oct 2013 at 1:51
Hi Catalin,
I'm not sure what is your goal. Do you want to create multiple modules each
with its own datastore and its own schema? Or do you want to create single
module with configuration specified in multiple schema documents?
If you need the first case, you can use this guide
http://libnetconf.googlecode.com/git/doc/doxygen/html/d3/df0/transapi_tutorial.h
tml to create individual modules. Getting state and configuration data can be
then done using filter statement. When applying changes the namespace
determines on which datastore (module) will be the changes applied.
If you have model scattered into more files you should specify the main model
and use functions ncds_add_models_path and ncds_add_model
(http://libnetconf.googlecode.com/git/doc/doxygen/html/db/d67/group__store.html#
ga93c65facb061f1048674343ac94a993b) to specify location of referenced and
included models. Then you simply create single module as in previous case.
Hope this helps. If not please let me know.
Best regards,
David
Original comment by david.kupka@gmail.com
on 8 Oct 2013 at 2:12
I have individual modules.
After your last email, I regenerated the stubs according to your details.
I managed to build the server using two individual databases.
Now everything works as it should.
Thank you!
Catalin
Original comment by catalin.olteanu
on 21 Oct 2013 at 12:30
Original comment by rkre...@cesnet.cz
on 11 Nov 2013 at 7:48
Original issue reported on code.google.com by
catalin.olteanu
on 8 Oct 2013 at 8:00