|
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
|
|
|
|
|
you did great job, too.
i also feel thanksful to you for showing the way to vs 2003. davide.
your contribution must be help me or other.
thanks.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Only say that It's a great class, I've been looking around for a XML parser and I can say this is the best and easiest parser I found. Great job...........
|
|
|
|
|
it's my pleasure.
thanks for using. i also think XMLite is easy to use. only that is the reason why i make it. thx.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
adding support for encoding and/or dtd's? Seem like being some of the very basics of XML.
int x1=4, y1=8; x1^=y1^=x1^=y1; // whats the content of x and y now?
|
|
|
|
|
thanks for regards.
yes, you can say that again.
I think wonderful if XMLite can support DTD and XML Schema and XSL translation or more. yeah.
and what you said might be real basic functions of xml parser.
I hope XMLite can do that with my or someone's efforts.
thanks !
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Hi Kyung-min,
I’m using your parser in my code, is really a good and simple parser, but a have a problem when I try to get a value or an attribute that has a back slash.
For example:
<file path="c:\\mypath\\file1.exe">Example
When I get the attribute it come like "c:mypathfile1.exe"
There is a way to read the back slash
Thanks,
Bulha
Bulha
|
|
|
|
|
thanks for using.
back slash is escape character in xmlite on default.
but that's my fault.
( on my previous project, default escape character is needed.
so i added it but it bad on your general case )
so. I decided to edit my XMLite code.
get updated XMLite source code plz.
now i add property 'escape_value'.
default is no escape character in XML value string.
if still you can use escape character as '\\', pi.escape_value = '\\'.
have a good day!
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Thanks Cho,Kyung-min
have a nice day!
Bulha
|
|
|
|
|
I have written recursive function and at any moment in destructor(_tagXMLNode::~_tagXMLNode()) there is a error: writing to the inaccessible area of memory.
What to do?
Jaccccc@hotmail.com
|
|
|
|