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++ Core » XML , DOM - Modify the tree
Re: XML , DOM - Modify the tree [message #12135 is a reply to message #12133] Fri, 12 October 2007 11:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
pippo wrote on Fri, 12 October 2007 05:15

hallo, I'm a newbe.
I need read a XML file and modify it.

I've seen the addressBookXML2. this example read a file and ,to rewrite it, re-CREATES ALL structure: starts from a new XmlNode object and fill it with Add().
This because function Node(int) returns a const XmlNode object.

But my XML files is very complex and I need modify only 1 value.

Why the dom-generated-tree is read only????
There's a function to modify it?

...Or copy some integer-block (nodes) to another tree, so I can create a new object and fill with copy... Very Happy





You can use following methods to modify XmlNode:

	XmlNode&       Add()                                      { return node.Add(); }
	void           AddText(const String& txt)                 { Add().CreateText(txt); }
	int            FindTag(const char *tag) const;
	XmlNode&       Add(const char *tag);
	XmlNode&       GetAdd(const char *tag);
	XmlNode&       operator()(const char *tag)                { return GetAdd(tag); }
	void           Remove(const char *tag);


Basically, it is only about using () instead of []...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to read file into Memory
Next Topic: How to convert String to char ?
Goto Forum:
  


Current Time: Tue Apr 29 03:05:20 CEST 2025

Total time taken to generate the page: 0.00987 seconds