Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » XmlNode and text
XmlNode and text [message #37406] Sun, 30 September 2012 21:22 Go to next message
mubeta is currently offline  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 Go to previous message
mirek is currently offline  mirek
Messages: 13975
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

Previous Topic: How do I load sqlite3 .sql with triggers on it?
Next Topic: Automatic Upgrade MySQL schema
Goto Forum:
  


Current Time: Sat Apr 20 06:02:15 CEST 2024

Total time taken to generate the page: 0.04413 seconds