Home » U++ Library support » U++ SQL » XmlNode and text
XmlNode and text [message #37406] |
Sun, 30 September 2012 21:22  |
mubeta
Messages: 77 Registered: October 2006
|
Member |
|
|
It is my misundertand, or there is a bug in the XmlNode object?
Short example:
XmlNode pr;
pr.GetAdd("Project").GetAdd("Application").GetAdd("Init").GetAdd("Is").At(0).CreateText(AsString((int)gIntSlot));
This code will create the text for the node named "Is", but in fact I must create a sub node using .At(0)...
What I don't understand is why the most intuitive way:
XmlNode pr;
pr.GetAdd("Project").GetAdd("Application").GetAdd("Init").GetAdd("Is").CreateText(AsString((int)gIntSlot));
Don't create the text for the correct node in the chain?
|
|
|
Re: XmlNode and text [message #37419 is a reply to message #37406] |
Tue, 02 October 2012 08:06  |
 |
mirek
Messages: 14261 Registered: November 2005
|
Ultimate Member |
|
|
CreateText is "Node altering method". We need that to behave this way because in some cases, you really need to change the node type from TAG to TEXT. And GetAdd really needs to return the node created...
I suggest using "AddText":
pr.GetAdd("Project").GetAdd("Application").GetAdd("Init").GetAdd("Is").AddText(AsString((int)gIntSlot));
[Updated on: Tue, 02 October 2012 08:07] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Jun 18 01:54:38 CEST 2025
Total time taken to generate the page: 0.05753 seconds
|