|
|
Comments and Discussions
|
|
 |

|
I am also getting lot of errors in vs2005.
Can somebody mail me the code which can compile succesfully in vS2005.
Thanks
Mayank
|
|
|
|

|
We had problems with VisualStudio 2008 compilation, which we solved by defining #define _HAS_ITERATOR_DEBUGGING 0 and #define _SECURE_SCL 0.
With VS2010, although with these definitions, we have the compilation error C2440: 'static_cast': cannot convert from 'XML_Node *' to 'XML_Node: nodes_iterator'
Someone can help us?
Francesco
|
|
|
|

|
Very nice work, thought about redoing it in c#?
cheers,
Donsw
My Recent Article : Ajax Calendar Control
|
|
|
|

|
The XML ParamIO class of 2002-3, whilst very nice, breaks on Visual Studio 2008, because it relies on an assumption that STL iterators are implemented as pointers. That was true in Visual C++ 6 (though it wasn't guaranteed to be true); it's no longer true in VS2008.
If you're starting a project from scratch, you might want to look at the Boost Serialization library (www.boost.org).
However, if you need to get this class working for back-compatibility, I've published an updated version (XMLParamIO2) at http://pobox.com/~rudolf/code[^] .
This works fine on VS2008 (at least, the ParamIO::readFile, ParamIO::read, ParamIO::write, and ParamIO::writeFile functions work, which is all I was using) and is back-compatible with the old file structures.
Details of the significant changes are in ParamIO.h.
The class now also supports the MFC CString class by default (though there's a #define that you can remove if you want to get rid of this support).
|
|
|
|

|
It's the best XML read/write program I found so far, thanks to Arnaud...but if Arnaud or anyone else is kind enough to add an additional feature to read/write element with attribute then it will become perfect! Can anyone please help?
|
|
|
|

|
hi,
This peace of code is really great.But i could'nt understand some area.Could some one help me out.
I was going through the code (XMLParser) and had some doubt..... could some one plz explain me this part of the code...
bool XmlParser::hasNullTag ()
{
// get end of first tag
char * buffer = _buffer + _firstTagEnd - 1;
// if null tag marker
if ( *buffer == '/' && *(buffer+1) == '>' )
return true;
else
return false;
}
actually, we close a tag like this right??
<color></color>
how does he find whether its empty tag or not???? I'm confused!!!
thanks & regards,
Vinod.
|
|
|
|
|

|
this is really a great work. Using your code I finished my master thesis. Now in my professional field, I have been still using your code. It has been working so well!
Great! Thank you.
|
|
|
|

|
Hello,
I would like to put this line () as first line in all xml file that i´m writing with this Code or library.
Is it possible to do that? if yes can anybody tell how can i do that ?
Thank in advance.
Regards.
Armando
|
|
|
|

|
I download the demo project and source code.
I can't understand how to run the application parameter.
can anyone explain it???
Thanks,
Nithin
|
|
|
|

|
I get so many errors compiling, if anyone can send me an updated version that works to lodoss118@gmail.com thanks.
|
|
|
|

|
Hi,
Can anyone give me some helps to write XML node with attribute?
For example:
?
Thanks,
Samo
|
|
|
|

|
Hi,
I don't know if anybody still cares about ParamIO. I'm about to convert all our projects to VisualStudio2005.
ParamIO doesn't compile. I get tons of compiler errors like this:
xml_node.h(170) : error C2440: 'static_cast' : cannot convert from 'XML_Node *' to 'XML_Node::nodes_iterator'
No constructor could take the source type, or constructor overload resolution was ambiguous
Unluckily the programmer who wrote this particular project has left the company. I'm wondering if anybody probably has converted ParamIO successfully to VS2005 and could share his sources with me thus saving me a lot of work.
Thanks a lot
Rita
|
|
|
|

|
Hi,
Thanks for the code. I have found that error by accident. Sample of testing code below:
ParamIO outXml;
outXml.write("VIEWER:PARAM1", "abc");
outXml.write("VIEW:PARAM2", 1); // By accident typed VIEW instead of VIEWER
outXml.writeFile("filename.xml"); // Finally write the file to disk
The result will be:
<VIEW>
< PARAM1>abc</PARAM1>
< PARAM2>1</PARAM2>
</VIEW>
Second "write" call finds VIEWER node instead of VIEW node. After that it changes node name from VIEWER to VIEW and adds new parameter.
Best regards,
Gintas
|
|
|
|

|
I am getting the following error on first compile of the test project:
'static cast' : cannot convert from 'const XML_Node *' to 'XML_Node::nodes_const_iterator'
on the following two lines:
// First we need to find the final node
XML_Node::nodes_const_iterator res, end, begin;
begin = static_cast<XML_Node::nodes_const_iterator>(&_node);
end = static_cast<XML_Node::nodes_const_iterator>(&(_node) + 1);
It appears that _node is a private variable of type XML_Node in the XML_Param_Notify class. XML_Node::nodes_const_iterator is just a typedef defined as:
typedef std::vector<XML_Node>::const_iterator nodes_const_iterator;
So it looks like this code is trying to cast the address of _node into an iterator of type nodes_const_iterator. An iterator is just a pointer to an address right? It seems like this should be doable, and I'm guessing that since no one else has posted this problem yet it has something to do with what I'm doing on my end. Any ideas?
|
|
|
|

|
Perhaps this has been talked a lot but I can not stop my self from writing this.
One of the reasons of XML is connecting platforms, apps through text encoded messages, to achieve this you need compliance. Implementing a fully (95%-98%) compliant XML parser is really hard. Usually an average Dev can get to 80% pretty quickly and the experienced can get to %90. The rest is all egde cases and getting them right requires extensive testing suites to ensure compat between different platforms. I know this by experience. There are quite a few xml parser implementations out there. Users are usually best served when the xml parser implementations are recognized by the W3C Recommendations. Other implementations can not go any further than academic studies as the cost of them making interop with the rest of the world sky rockets as dev's are trying to achieve %95 compat.
|
|
|
|

|
I'm having problems reading an xml file that looks like this, <PARAMS> <TEXT>Hello world</TEXT> <COLOR> <RED>50</RED> <GREEN>128</GREEN> <BLUE>255</BLUE> </COLOR> <COLOR> <RED>60</RED> <GREEN>188</GREEN> <BLUE>252</BLUE> </COLOR> </PARAMS> That is, if I have two or more color nodes, how would I read it using this program? It reads only the first one. Is it possible to read such kind of files using this application??? TIA http://www.TechiesAbode.com/
|
|
|
|

|
In XML_Node.h I had to add:
#include <sstream>
|
|
|
|

|
I am having trouble with reading in white spaces with this code. I can write strings that contain white spaces, but when I try to read them in, it only returns the first word. I'm assuming I'm not the only one out there with this problem, anyone have a fix?
Thanks!
|
|
|
|

|
Long time ago i made some big modification to ParamIO to support success of reading, Path and multiple nodes.
Something like this can be used:
if(!Cfg.read("/MyApp/Layout/Layer[2]/Type", type,""))
{
}
This also should work with write.
Maybe Arnud will put my code here in a separate archive.
Arnud please let me know if you are wiling to upload my code.
|
|
|
|

|
I tried adding the files XmlMode,XmlParser,XmlStream,ParamIO,Xml_Notify,XmlUtil both headers, and cpp files to a new Win32 console project with MFC support. I've got this linker errors any ideas?
xmltest error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in LIBCMTD.lib(delete2.obj)
xmltest error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmtd.lib(newaop.obj)
...
|
|
|
|

|
Great codes! But in my usage, I have a problem,i.e. my program will call writeFile several times, so my data will be overwritten. For writeFile use the std::ofstream to write file, so existing file will be overwritten. I want to know: Is there any better way to avoid these?
Songge Info
|
|
|
|

|
HI,
how can i modified this source to make possible to write the key and the value from a database ? for reading,i should be load all keys and values in my database.
Thanks for your Reply.
best regards,
Dominique
|
|
|
|

|
Thanks for that Great Work!
David Hubbard wrote a great parser and you made it more usable. I need to write my own Config Writer, because I need some more functionality ( multiple entries of the same name, nesting of Setting into each other...), but the Functionality you added with the Handling for Nodes an Elements makes that quite easy.
Why did you add that CString support in such a nice "pure" STL Tool?
|
|
|
|

|
how can i write 2 differents objekts in the same file, like this example.
ParamIO outXml , Xmlout;
outXml.write("PARAMS:COLOR:GREEN", _green);
outXml.write("PARAMS:COLOR:BLUE", _blue);
Xmlout.write("PARAMS:FONT:NAME", _fontName);
Xmlout.write("PARAMS:FONT:SIZE", _fontSize);
outXml.writeFile("filename.xml"); // Finally write the file to disk
Xmlout.writeFile("filename.xml");
i want to have _green, _blue ,_fontName, _fontSize in the filename.xml.
any idee ?
best regards,
Dominique
|
|
|
|

|
Hi All,
ParamIO does not currently compile under UNICODE. Has anyone made any (local) changes that they would be willing to share to make ParamIO UNICODE compliant?
Arnaud, I see below that you were going to have a look at what it would take to implement UNICODE compatibility. Have you had a chance to look into it at all?
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|

|
Hi,
I am new to .NET and XML. I task is to read the xml, find a particular element, find the existance of particular attribute and if found then the attribute value should be updated with another value. I have to use vb.net using SAX parsers.
I could able to read the XML file using SAXXMLReader class but could not able to change the attribute value.
Can any help me sending the info regarding it.
I hope my problem is clear.
Thanks in advance.
Regards,
Sateesh.
|
|
|
|

|
I'm using this:
std::string _text = "test";
ParamIO outXml;
outXml.write("PARAMS:TEXT", _text);
outXml.writeFile("Save.xml");
and getting this:
Compiling...
SquadServ.cpp
D:\Tauri\SquadServ\SquadServ.cpp(83) : warning C4003: not enough actual parameters for macro 'write'
D:\Tauri\SquadServ\SquadServ.cpp(83) : error C2039: 'send' : is not a member of 'ParamIO'
d:\tauri\squadserv\paramio.h(30) : see declaration of 'ParamIO'
D:\Tauri\SquadServ\SquadServ.cpp(83) : error C2059: syntax error : ','
Error executing cl.exe.
what should I do ?
|
|
|
|

|
Just what I needed, thanks!
~Nitron.
ññòòïðïðB A start
|
|
|
|

|
Hi,
I have read whole discussion about this library, but I cannot solve my problem. I wrote to all .cpp files the stdafx.h and set to static library. But during compilation, it returns 252 errors. The first & the most important(I think) is in ParamIO.cpp: ParamIO is not a class or a namespace name. All other errors are depending on this one. I don't know what to do...
|
|
|
|

|
The primary reason being that there is an assumption in the code that vector::iterator and its chums are implemented as pointers to T. As far as I know this has previously been the case with VC++ but the C++ standard does not guarantee this.
Ben
|
|
|
|

|
thanks for the great XML tools, they are very easy to use. I would like to have a table represented in XML but this implementation of the parser doesn't handle multiple entries of the same name, for example: <HOST> <NAME>cod</NAME> <DNSNAME>cod.somecorp.com</DNSNAME> <NIC> <MAC>0040f4612820</MAC> <IP>192.168.172.54</IP> <IP>192.168.173.54</IP> </NIC> </HOST> <HOST> <NAME>drum</NAME> <DNSNAME>drum.somecorp.com</DNSNAME> <NIC> <IP>192.168.172.47</IP> </NIC> </HOST> in this example the <HOST> and <IP> tags both have multiple entries. the XMLDialog displays the host cod for both entries, and only 1 IP address, it would be nice to be able to address these in the read/write methods like: "HOST[0]:NIC:IP[1]","192.168.173.54" --Ben Burnett
|
|
|
|

|
Hello Arnaud, thank you your article to read and write parameters in XML. I test the code to read strings, integer and double values from my xml files. Everything is working well. Is there any possibility to read/write integer or double arrays? Best regards Dieter Welter Dieter Welter
|
|
|
|

|
Hi all,
I updated the code of ParamIO.
I added support for CString, and a method to erase an element of a node.
Arnaud
|
|
|
|

|
I just want to remove a XML tag. For example the <COLOR></COLOR> tag. I tried to write an empty string, but this doesn't work. The append and update operations work fine, but I need to remove a parameter.
|
|
|
|

|
Hello,
i´m looking for a simple to use XML-Class and find ParamIO, it looks very nice. But i have some problems with it.
Linker errors occur, when i try to compile my project with static linked MFC and i couldn´t use precompiled header files.
Another thing is that i have memory leaks, when i close the app.
|
|
|
|

|
I have cast problem that doesn't occured in vc6 and I would like to know if there is a "fast" solution to solve the problem.
the error is concerning
'static_cast' : cannot convert from 'const XML_Node *' to 'XML_Node::nodes_const_iterator' in XML_Param_Notify
I tried to dupplicate function to enable temp var to define _node * to suppress cast problem but all const makes me modify a lot of code... it's a shame.
Thanks for any help.
VinZ
|
|
|
|

|
I get these errors at compile time, do you know how it could be resolved???
ParamIO.obj : error LNK2001: unresolved external symbol "public: bool __thiscall XmlStream::parse(char const *,long)" (?parse@XmlStream@@QAE_NPBDJ@Z)
ParamIO.obj : error LNK2001: unresolved external symbol "public: void __thiscall XmlStream::setSubscriber(class XmlNotify &)" (?setSubscriber@XmlStream@@QAEXAAVXmlNotify@@@Z)
ParamIO.obj : error LNK2001: unresolved external symbol "public: void __thiscall XML_Param_Notify::clear(void)" (?clear@XML_Param_Notify@@QAEXXZ)
ParamIO.obj : error LNK2001: unresolved external symbol "public: void __thiscall XML_Param_Notify::print(class std::basic_ostream > &)const " (?print@XML_Param_Notify@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@
@std@@@Z)
ParamIO.obj : error LNK2001: unresolved external symbol "public: bool __thiscall XML_Param_Notify::compare(class ParamIO const &,class std::vector,class std::allocator >,class std::all
ocator,class std::allocator > > > &)const " (?compare@XML_Param_Notify@@QBE_NABVParamIO@@AAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic
_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
ParamIO.obj : error LNK2001: unresolved external symbol "public: bool __thiscall XML_Param_Notify::extractSubTree(class std::vector,class std::allocator >,class std::allocator,class std::allocator > > > &,class ParamIO &)const " (?extractSubTree@XML_Param_Notify@@QBE_NAAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_str
ing@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AAVParamIO@@@Z)
|
|
|
|

|
This class is really nice! It is by far the easiest-to-use XML class I've seen, and I really like that it supports writing XML too! Is there any support in ParamIO for writing and reading XML attributes as well as elements? For example, I want to write/read this: <profile version="1"> instead of: <profile> <version>1</version> </profile> Do you have any plans to support XML attributes? Thanks!
|
|
|
|

|
If I were to use paramIO as a lib in another application, Is there any way to read duplicate XML tags with inXml.read("PARAMS:TEXT",....); or is there another method that can be used to read duplicate tags in this program? For Example, <PARAMS> <TEXT>Hello World</TEXT> <TEXT>Goodbye World</TEXT> </PARAMS> Any help would be much appreciated....thanks!
|
|
|
|

|
Hi all,
I was wondering if paramIO can be used as a lib for another C++ code that I want to utilize the functionality of paramIO. Any suggestions are appriciated.
-ww
|
|
|
|

|
I have a file:
apple
orange
how can I get names?
I hope a method as : vector get("pp:name")
and How can I write this file?
|
|
|
|

|
Your project is very useful. Do you have test it in multithreading? When I use it in 10 thread, it throw a exception. Can you test it in multithreading? Thank you!!
|
|
|
|

|
It would be a nice feature to have the ability to read the XML configuration file via the web or an intranet. This way several instances of an application could share a common configuration. I could see this as a plus for corporations, etc. where they would want to configure their application a specific way for all 20,000 users, and would only have to update a single config file (which could reside on their intranet web-server or someplace on the real 'net).
The method could look something like this:
ParamIO::readFile(const char *URL)
--
Loren Brewer
|
|
|
|

|
First off, I was able to successfully build this version in .NET (there were a few compiler warnings, but no errors). Great job!
Also, while trying to figure out if there was any support to write comments to the XML file (I know that Arnaud recently added the ability to read XML files when comments already exist in the file) I tried the following which ended up crashing the demo application:
xml.write("<!-- TEST -->", std::string("Hello"));
It would be handy to have a "writeComment(std::string)" method or even just a general "writeText(std::string)" method, or both.
Then we could do things like:
xml.writeComment(std::string("This is my comment"));
// which would write: "<!-- This is my comment -->"
// in the XML file at the current location
and/or
xml.writeText(std::string("<-- This is a comment -->"));
// which would do the same as the above.
// This general version could also be used to put other
// XML lines in as well (schema stuff, whatever) which I
// think someone else has already expressed interest in
// using if it existed in this class.
What do you say Arnaud?
--
Loren Brewer
|
|
|
|

|
Hi all,
Has anyone have a source code for XML Editor writen in C# ?
It should be a very simple one.
1.Checks syntax
2.Validate against schema.
Thanks in advance
Doron
vdoron@netvision.net.il
|
|
|
|
|

|
Take a look at that:
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.cpp(184) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.cpp(207) : warning C4018: '<' : signed/unsigned mismatch
XML_Dialog.cpp
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Dialog.cpp(180) : warning C4018: '<' : signed/unsigned mismatch
ParamIO_DemoDlg.cpp
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(152) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO.h(44) : see reference to function template instantiation 'bool XML_Param_Notify::addElement(std::vector<_Ty,_Ax> &,std::string &)' being compiled
with
[
_Ty=std::string,
_Ax=std::allocator,std::allocator>,false>>::key_type>
]
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO_DemoDlg.cpp(174) : see reference to function template instantiation 'bool ParamIO::write(const char *,std::string)' being compiled
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(155) : error C2440: 'type cast' : cannot convert from 'XML_Node::nodes_const_iterator' to 'XML_Node *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(156) : error C2679: binary '==' : no operator found which takes a right-hand operand of type 'XML_Node::nodes_const_iterator' (or there is no acceptable conversion)
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(173) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(152) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO.h(44) : see reference to function template instantiation 'bool XML_Param_Notify::addElement(std::vector<_Ty,_Ax> &,int &)' being compiled
with
[
_Ty=std::string,
_Ax=std::allocator,std::allocator>,false>>::key_type>
]
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO_DemoDlg.cpp(176) : see reference to function template instantiation 'bool ParamIO::write(const char *,int)' being compiled
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(155) : error C2440: 'type cast' : cannot convert from 'XML_Node::nodes_const_iterator' to 'XML_Node *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(156) : error C2679: binary '==' : no operator found which takes a right-hand operand of type 'XML_Node::nodes_const_iterator' (or there is no acceptable conversion)
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(173) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(152) : warning C4018: '<' : signed/unsigned mismatch
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO.h(44) : see reference to function template instantiation 'bool XML_Param_Notify::addElement(std::vector<_Ty,_Ax> &,double &)' being compiled
with
[
_Ty=std::string,
_Ax=std::allocator,std::allocator>,false>>::key_type>
]
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO_DemoDlg.cpp(181) : see reference to function template instantiation 'bool ParamIO::write(const char *,double)' being compiled
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(155) : error C2440: 'type cast' : cannot convert from 'XML_Node::nodes_const_iterator' to 'XML_Node *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(156) : error C2679: binary '==' : no operator found which takes a right-hand operand of type 'XML_Node::nodes_const_iterator' (or there is no acceptable conversion)
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\XML_Node.h(173) : warning C4018: '<' : signed/unsigned mismatch
ParamIO_Demo.cpp
d:\Downloads\prog\ParamIO_demo\ParamIO_Demo\ParamIO_Demo.cpp(45) : warning C4996: 'CWinApp::Enable3dControls' was declared deprecated
e:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxwin.h(4372) : see declaration of 'CWinApp::Enable3dControls'
Any suggestions?
|
|
|
|

|
Nice code!
I tried to use your code, but I cannot compile it under Visual Studio.NET
It gives me this error:
d:\My Documents\Visual Studio Projects\ParamIO_Demo\XML_Node.h(155): error C2440: 'type cast' : cannot convert from 'XML_Node::nodes_const_iterator' to 'XML_Node *'
It is in line 155. Anyone has any idea? Any help appreciated!
Thanks!
|
|
|
|

|
Has someone got this code to work using VC++ 5? Maybe this is a stupid question, but
1. I can't compile the demo project and
2. I created another project where I have to use these functions, I included all the necessary cpp and h files in the project and included ParamIO.h in my main file. But I can't compile. The compiler always tells me that the class XML_Node has no constructor, and when I double click the exception, I'm sent to a file Vector.h
Any help? Could it be possible to pre-build a .lib file with the (compiled) functions in it, o I still could use this class in my program?
Thanks, Ikke
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article provides an easy way to load and save the parameters of an application in XML format.
| Type | Article |
| Licence | |
| First Posted | 30 Apr 2001 |
| Views | 471,203 |
| Bookmarked | 133 times |
|
|