Hello,
First of all, I am a newbie to XML and I might do something wrong..
I have tried to use XML as config file. Then I faced the following issue:
Assume I have a structure like this:
<?xml version="1.0" encoding="utf-8"?>
<RootNode>
<Node2></Node2>
<Node1>node one text</Node1>
</RootNode>
I wish to have a null string in Node2 (i.e. "").
The wxXML* classes won't find any text node in Node2.
Ideally, I would make a difference between the <Node2/> and <Node2></Node2>, so in the first case I would have no text node in Node2 and in the second case, a text node having "" text inside. But this is not implemented in wxXML* classes.
wxXMLDocument class has the wxXMLDOC_KEEP_WHITESPACE_NODES flag that should not transform the node2 from <Node2></Node2> to <Node2/>. With this flag something annoying happens: some new lines are saved in the document.
This makes difficult to use the wxXML* classes for writing a configuration class, even those mentioned here http://wiki.wxwidgets.org/Development:_Todo_List are buggy because of that. They will create many <node/> entries in the same node in case of "" value of the text node.
What do you think?
How could it be done?
Yours,
Mike
XML strangeness
-
- Filthy Rich wx Solver
- Posts: 211
- Joined: Sat Jan 01, 2005 6:19 pm
-
- Knows some wx things
- Posts: 35
- Joined: Wed Sep 08, 2004 6:22 am
-
- Filthy Rich wx Solver
- Posts: 211
- Joined: Sat Jan 01, 2005 6:19 pm
-
- I live to help wx-kind
- Posts: 173
- Joined: Mon Sep 25, 2006 1:12 pm
-
- Knows some wx things
- Posts: 35
- Joined: Wed Sep 08, 2004 6:22 am
-
- I live to help wx-kind
- Posts: 173
- Joined: Mon Sep 25, 2006 1:12 pm