on 10-20-2005 9:31 AM
Hello everybody,
I wonder whether it is possible to set/get the value of a value attribute direct under the CONTEXT-node?
How can I access by code, e.g. the value attribute is named "value_attribute_without_parent_node"?
Thanks a lot, Mario
Hi Mario,
You can get the value using
wdContext.currentContextElement().get<Attributename>();
i.e
wdContext.currentContextElement().getValue_attribute_without_parent_node();
and set the value using
wdContext.currentContextElement().set<Attributename>(<value>);
i.e
wdContext.currentContextElement().settValue_attribute_without_parent_node(<your value>);
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
If your context attribute is not under any context node then you can write following code for that:
wdcontext.currentContextElement().set<attribute name>(<value>);
wdcontext.currentContextElement().get<attribute name>();
But, if this attribute is under any context node, then first you need to create object for this context node using following code:
ele = wdcontext.create<node name>();
then bind this element to the node.
wdcontext.node<node name>().addelement(ele);
Then, assign value to the value attribute as:
wdcontext.current<node name>Element().set<attribute name>(<value>);
and get same value using:
wdcontext.current<node name>Element().get<attribute name>();
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
"Context" is the rootnode . If you create simple value attributes then rootnode is the parent for that and you can access through currentContextElement() .
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.