|
Hello, Denis Checkhlov.
Well, I think XMLite haven't any association with MFC stuff without CString.
I'm sorry that I can't support that for you.
someday I have to convert xmlite for linux, then I will do it and share that.
Thanks for regards.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Found a very good CString replacement.
http://home.earthlink.net/~jmoleary/stdstring.htm.
I think it should works in most C++ compiler, but never personally verify that.
I'm was able replace all CString to CStdString and compile looks fine.
However GetChildAttrValue doesn't seems to work.
May be Kyung-min can help us to take a look.
|
|
|
|
|
|
What do you think about it? And Load and Save for XML files operations?
|
|
|
|
|
Thanks for regard, Wojciech Klessa
you are right! good idea. you can rename it.
Load and GetXML naming is from MSXML.
I did work with msxml. so i used to write that.
(XMLDocument::load stuff and XMLElement::get_xml )
but it's not important.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
I get these errors when attempting to compile.
------ Build started: Project: TestXMLite, Configuration: Debug Win32 ------
Compiling...
StdAfx.cpp
WINVER not defined. Defaulting to 0x0501 (Windows XP and Windows .NET Server)
Compiling...
XMLite.cpp
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(229) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(239) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(584) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(603) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(649) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(673) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(717) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(740) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(770) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(872) : error C2451: conditional expression of type 'std::vector<_Ty>::iterator' is illegal
with
[
_Ty=LPXNode
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(892) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(945) : error C2451: conditional expression of type 'std::vector<_Ty>::iterator' is illegal
with
[
_Ty=LPXAttr
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(1014) : error C2451: conditional expression of type 'std::vector<_Ty>::iterator' is illegal
with
[
_Ty=LPXNode
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(1034) : error C2451: conditional expression of type 'std::vector<_Ty>::iterator' is illegal
with
[
_Ty=LPXAttr
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(1050) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\XMLite.cpp(1060) : warning C4018: '<' : signed/unsigned mismatch
TestXMLiteDlg.cpp
c:\_download\Programming\XML\XMLite_demo\TestXMLiteDlg.cpp(235) : warning C4018: '<' : signed/unsigned mismatch
c:\_download\Programming\XML\XMLite_demo\TestXMLiteDlg.cpp(241) : warning C4018: '<' : signed/unsigned mismatch
TestXMLite.cpp
c:\_download\Programming\XML\XMLite_demo\TestXMLite.cpp(52) : warning C4996: 'CWinApp::Enable3dControls' was declared deprecated
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(4369) : see declaration of 'CWinApp::Enable3dControls'
Generating Code...
Build log was saved at "file://c:\_download\Programming\Xml\XMLite_demo\Debug\BuildLog.htm"
TestXMLite - 4 error(s), 15 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
i haven't been compiled with xmlite on vc7 yet.
but other guys do well on vc7.
check this site
http://www.devage.com/dotNetInstaller/dotNetInstaller.html
he just modify little things for compiling on vc7.
now is your time
good luck!
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Replace error lines
if ( it )
with
if ( it != NULL )
that compiled for me.
|
|
|
|
|
Thanks, that worked perfectly for me.
|
|
|
|
|
Due to the usage of the "std::ostringstream" class, streaming a large list of data, in my case approx. 12000 lines, takes 2 minutes of 100% system load (!). Adding a char (or small buffers) at a time is a very bad idea for such a memory based, dumb class.
Can this be enhanced?
Christian
|
|
|
|
|
Thanks for regards, christian!
first, sorry for late answer
well, I think surely 12000 lines slow with ostringstream.
but although ostringstream is slow at some extreme situation,
it is good for common case.
I think you can replace easily generic string concat module from ostringstream.
when i choose ostringstream, I think it is easy to use, no need to additional source. although I made similar module called 'CMemWriter/CMemReader'.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
_tagXMLEntitys::Ref2Entity() and _tagXMLEntitys::Entity2Ref() need "es.ReleaseBuffer();"
Same with _SetString().
Otherwise it just does what it should. Great.
|
|
|
|
|
Thanks for regards.
that problem was pointed by Sergey Zhiharev before.
and I answer it.
I will update xmlite with fix.
but I hope more additional functions.
someone want to do xml PI (processing Instruction) and pi's encording.
I hope xmlite can do it by me or by other contributors.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
XNode in XMLite can parse one element.
so, xnode.Load( "<a></a><b></b><c></c>" ) , then xnode parse only .
if you want to parse all elements, then write below
( somebody ask to me how to do this )
CString s;
s = _T("<a></a><b></b><c></c>");
XNode a,b,c;
LPTSTR pa = (LPTSTR)(LPCTSTR)s;
LPTSTR pb = a.Load( pa );
LPTSTR pc = b.Load( pb );
LPTSTR pNull = c.Load( pc );
TRACE(_T("%s %s %s"), a.name , b.name, c.name );
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
it also bug (should be parse error notified) and also incorrect XML string specified.
as i remember valid XML string is
<?xml ...>
<nodes>
<node>...</node>
....
</nodes>
----------------------------
never stop coding.
|
|
|
|
|
as you know, < ?xml? > tag called 'PI(processing instruction)' is special purpose thing. it has some information of xml optionally. (xml document version, or encording thingy).
but XMLite doesn't support PI. it's for only simple plain xml text. that's all
and support of multipule plan xml tag is just trick for other's question .
also that's all
Thanks for regard!
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Great work. I am just wondering if it supports unicode. Thanks. -DX
|
|
|
|
|
no. it's baded on MBCS. but I used CString and LPCT stuff.
so, as you know, to support unicode is easy.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
I have downloaded your component today and it looked very promising. But I have a problem. My XML files begin with the following line:
<?xml version="1.0" encoding="UTF-8" ?>
With this line XMLite thinks it is not a valid XML file.
Any idee how this can be fixed.
|
|
|
|
|
i sorry that current xmlite doesn't understand xml PI (Processing Instruction).
just simplely XMLite is maded for plain xml text.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
I've played with that parser for a few days and something strange happens in some cases. Very strange... I used this class to serialize another XML document to be parsed later on the client side. But undoubtly it wasn't correct.
I lost a few hours to understand this issue until I saw the next statement in the GetXML method:
strRes += (opt->reference_value&&opt->entities?opt->entities->Entity2Ref(value):value);
I thought it looks vey strange to be correct After that statement executes the next operation didn't work:
strRes += _T("
|
|
|
|
|
Thanks, Sergey Zhiharev!
I try to get that bug on my test.
but i can't get the bug...
if it checked to me, it will help to fix..
can you show me the way to get the bug? thanks!!
btw, it's right. CString s has more length..
it can be fix with freeextra() simplely .
int len = _tcslen(str) + nEntityCount*10 ; // MAGIC!!!
LPTSTR sbuf = s.GetBufferSetLength( len+1 );
if( sbuf )
Entity2Ref( str, sbuf, len );
s.FreeExtra();
have a good day
and i want to see the bug and i hope to fix!
thanks again
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
fixed new function..
LPTSTR _tcsechr( LPCTSTR psz, int ch, int escape )
{
LPTSTR pch = (LPTSTR)psz;
while( pch && *pch )
{
if( *pch == escape )
pch++;
else
if( *pch == ch )
return (LPTSTR)pch;
pch++;
}
return pch;
}
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
please replace function in xmlite
LPTSTR _tcsskip( LPCTSTR psz )
{
//while( psz && *psz == ' ' && *psz == 13 && *psz == 10 ) psz++;
while( psz && isspace(*psz) ) psz++;
return (LPTSTR)psz;
}
now XMLite can parse correctly below xml.
<tag
="" a="1
" b="2
/">
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Thanks very much for your work!
I used your code in my new project and I very appreciate it. I only make some very small modifications for VS 2003 compatibility (removing some warnings) and I added a short method to load an xml from a file.
If you want you can download this small changes with my project from http://www.devage.com/dotNetInstaller/dotNetInstaller.html.
Thanks
Davide
|
|
|
|