|
Hello,
I would like to know the memory constraint of this parser on mobile platform (planning to use for WM).
The avg size of the XML file to be fed to the parser would be 50KB.
Any suggestions or inputs would be highly appreciated.
Thnkz,
Zoom
|
|
|
|
|
You might be better off with CMarkup, we found this much quicker to load in a large XML file as it only points to elements, attributes in the file rather than copying them. So uses little additional memory to the size of the file itself.
www.firstobject.com/xmleasy.htm
|
|
|
|
|
Just wondered why XMLite impliments the CDATA in the way it does, (a child of a child) is this a normal implementation.
I have the XML line
"<Parameter><![CDATA[Window 1]]></Parameter>"
and in order to get the value of the Parameter, I have to do the following:
pAttributeChild = GetChild("Parameter");
strValue = pAttributeChild->GetChildValue("#CDATA");
I thought I would be able to do:
strValue = pAttributeChild->GetChildValue("Parameter");
as I do for all values that are not encapsulated in the CDATA.
Thanks
Ian
|
|
|
|
|
Yes. I made that node name with "#CDATA".
you can see that function on LoadCDATA.
LPTSTR xml = (LPTSTR)pszXml;
xml += sizeof(szXMLCDATAOpen)-1;
LPXNode node = new XNode;
node->parent = this;
node->doc = doc;
node->type = XNODE_CDATA;
node->name = _T("#CDATA");
_SetString( xml, end, &node->value, FALSE );
par->childs.push_back( node );
If you want, then modify that code for your purpose. and if I have some mistake or miss-standard. then just modify and share that. thanks.
but i wonder, if 'Parameter' node have CDATA and value text like below:
"<Parameter>Value of Parameter<![CDATA[Window 1]]></Parameter>"
then which one (Value of Parameter and CDATA stuff) can be selected for Parameter's value?
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
We have chosen to stick with your current implementation for now.
Thanks
Ian
|
|
|
|
|
Anybody has this working on Visual Studio 2005?
|
|
|
|
|
XNodes::iterator _tagXMLNode::GetChildIterator( LPXNode node )<br />
{<br />
XNodes::iterator it = childs.begin();<br />
for( ; it != childs.end() ; ++(it) )<br />
{<br />
if( *it == node )<br />
return it;<br />
}<br />
return NULL; <br />
}<br />
|
|
|
|
|
you can find that fix in other's reply.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Good work. Yet I realize that this isn't a standard-compliant code. XMLite.cpp at line 330 throws me an error: 'i' undeclared identified. You have the following code:
for( int i = 0 ; i < childs.size(); i ++)
{
...
}
childs.clear();
for( i = 0 ; i < attrs.size(); i ++)
{
...
}
While compiling it with VC8 it throws me 7 errors and 17 warnings.
Regards.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
You can download this http://download.svetla.org/download/XMLite.ZIP for your project. I´m using it for unicode too. I recommend substitute ->name for ->GetName().
Regards.
Jaroslav Nusl
www.svetla.org
|
|
|
|
|
My project is based and compiled with Unicode (VC2005). When I compile this excellent code I get some errors because of that (for example the use of strchr). Can someone know where to get a Unicode version.
Thanks,
Yossi.
|
|
|
|
|
Hi Yossi
I reached that it works for me with Unicode, VC2005.
I had to recreate a project as Unicode, and make some corrections...
Most important change types are listed:
* '<' -> _T('<'), " ?>" -> _T(" ?>"), etc in all similar cases
* sizeof(szXMLCDATAOpen) -> sizeof(szXMLCDATAOpen)/sizeof(TCHAR), and similar
* memcpy( pss, psz, len); ->
#ifdef _UNICODE
memcpy( pss, psz, 2*len);
#else
memcpy( pss, psz, len);
#endif
* if( strchr( pszchs, *psz ) ) return (LPTSTR)psz; ->
#ifdef _UNICODE
if( wcschr( pszchs, *psz ) ) return (LPTSTR)psz;
#else
if( strchr( pszchs, *psz ) ) return (LPTSTR)psz;
#endif
* std::ostringstream os; ->
#ifdef _UNICODE
std::wostringstream os;
#else
std::ostringstream os;
#endif
There are also many changes to address warnings.
If you like, I could send to you my version, or put it in some public place, please instruct.
AlexandreN
|
|
|
|
|
If you would care to share your Unicode version that'd be great ! Judging by the number of errors I get it sounds quite a big task, especially with regard to std::string which appears to be 'char' based regardless of whether you are compiling UNICODE or not (or have I missed something) ???
TTFN,
Jon
|
|
|
|
|
I would gladly share, if somebody explained me the best practice how to share.
Alexandre
|
|
|
|
|
Hi Alexandre,
I'm not sure best way to share. If you get stuck I can temporarily host them on my website so othres can download them, at least until a better solution is found.
TTFN,
Jon
PS : I tried to reply to your email address but it bounced ....
|
|
|
|
|
Jon,
I am looking for Unicode version of XMLlite. Hi can you post Unicode version of XMLLite ?
|
|
|
|
|
Love xmlite so far but ran into a problem today trying to parse the document.xml file found in the .docx zip file (Word2007 document file). In the .xml file, there are 12 tags with the name "w:p". After parsing, xmlite shows only one w:p tag. I am using the xmlite download from Creative Commons.
I am a complete novice at xml and xmlite, so I may be committing some obviously stupid mistake. However, everything I have parsed prior to this file has acted as expected and thus I don't know why this doesn't act the same. Any ideas?
I have attached the document.xml file below.
thanks for any help you might provide.
<w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns ="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"><w:body><w:p w:rsidr="001671DB" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:pstyle w:val="Heading1"><w:r><w:t>Heading 1<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:r><w:t>Heading 1 normal text<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:rpr><w:b><w:r w:rsidrpr="00265A14"><w:rpr><w:b><w:t>Bold Text<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:rpr><w:i><w:r w:rsidrpr="00265A14"><w:rpr><w:i><w:t>Italics Text<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:rpr><w:b><w:i><w:r w:rsidrpr="00265A14"><w:rpr><w:b><w:i><w:t>Bold Italics Text<w:p w:rsidr="00A424D9" w:rsidrpr="00A424D9" w:rsidrdefault="00A424D9" w:rsidp="00265A14"><w:r><w:t xml:space="preserve">This is a long run of normal text to show how multiple lines are treated in a single run of really long <w:r w:rsidr="009228BE"><w:t xml:space="preserve">skinny tall short fat light <w:r><w:t>long text.<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:pstyle w:val="Heading2"><w:r><w:t>Heading2<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:r><w:t>Heading2 normal text<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:ppr><w:pstyle w:val="Heading3"><w:r><w:t>Heading 3<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:r><w:t>Heading 3 normal text<w:p w:rsidr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:p w:rsidr="00265A14" w:rsidrpr="00265A14" w:rsidrdefault="00265A14" w:rsidp="00265A14"><w:sectpr w:rsidr="00265A14" w:rsidrpr="00265A14" w:rsidsect="001671DB"><w:pgsz w:w="12240" w:h="15840"><w:pgmar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"><w:cols w:space="720"><w:docgrid w:linepitch="360">
|
|
|
|
|
http://www.cogniview.com/creative-commons-info.php[^]
Creative Commons Information Acrobat Plugin (CCInfo), cogniview project uses XMLite. thanks for using. and He updates XMLite for VS2005.
and. His project is opensource.
Thank you.
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
This is just what i was looking for! Its a great little library and now it compiles cleanly in VS2005!
Would it be possible to update the article with the latest sourcecode from Creative Commons?
Ive given you a 5!
|
|
|
|
|
very usefull!!!!
Best regards
Klaus
|
|
|
|
|
hi
I would need your help
I working on a application in C++ using visual studio 2005 and the mfc
I figured out that the program I want to right would work pretty well with a xml file, I've used it breifly in flash for somthing similar so I know it meet my needs
my problem is I don't know how to do it in c++
I tried this program but I get theis errors
c:\documents and settings\jsr\desktop\xmlite.cpp(1424) : error C2664: 'std::_Vector_iterator<_Ty,_Alloc>::_Vector_iterator(const std::_Vector_iterator<_Ty,_Alloc> &)' : cannot convert parameter 1 from 'int' to 'const std::_Vector_iterator<_Ty,_Alloc> &'
1> with
1> [
1> _Ty=LPXNode ,
1> _Alloc=std::allocator<lpxnode>
1> ]
1> Reason: cannot convert from 'int' to 'const std::_Vector_iterator<_Ty,_Alloc>'
1> with
1> [
1> _Ty=LPXNode ,
1> _Alloc=std::allocator<lpxnode>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\documents and settings\jsr\desktop\xmlite.cpp(1470) : error C2451: conditional expression of type 'std::_Vector_iterator<_Ty,_Alloc>' is illegal
1> with
1> [
1> _Ty=LPXNode ,
1> _Alloc=std::allocator<lpxnode>
1> ]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>c:\documents and settings\jsr\desktop\xmlite.cpp(1490) : warning C4018: '<' : signed/unsigned mismatch
I just need a simple class to write and read the content of an xml file
can you explain me or indicate me a class that does it simply, I don't need performance or speed.
I liked this program a lot because it seems to give an application of what your class with the buttons
can you help me out please
|
|
|
|
|
Have a look on the topic bellow "It doesn't compiles with MS VC++ 2005"
|
|
|
|
|
Is there anyway I can add an attribute for one of the node? I see you have CreateAttr but how to use it for one of the node I want?
For example, I have:
<SUB>
<ID>
<NAME>Joe</NAME>
</ID>
<ID>
<NAME>Owen</NAME>
</ID>
</SUB>
And I want to add an attribute to the second ID to become as follow:
<SUB>
<ID>
<NAME>Joe</NAME>
</ID>
<ID Identity = "first">
<NAME>Owen</NAME>
</ID>
</SUB>
Thanks in advance!
|
|
|
|
|
you can use AppendAttr. (CreateAttr is just return created XAttr)
if you want to create right now, and append someday.
then you can seperate operation of AppendAttr.
LPXAttr pAttr = AnyNode.CreateAttr("identity", "first");
...
WantNode.AppendAttr(pAttr);
BUT, DONT reuse pAttr like below.
WantNode2.AppendAttr(pAttr);
then XMLite's destructor lost work. (dangling pointer problem will be occur on Close() )
void CTestXMLiteDlg::OnButton14()
{
// TODO: Add your control notification handler code here
CString sXML = "\
<SUB>\
<ID>\
<NAME>Joe</NAME>\
</ID>\
<ID>\
<NAME>Owen</NAME>\
</ID>\
</SUB>\
";
XNode node;
if( node.Load( sXML ) )
{
AfxMessageBox( node.GetXML() );
LPXNode found = NULL;
found = node.Find( _T("ID") );
if( found )
{
XNodes IDs = found->parent->GetChilds("ID");
IDs[1]->AppendAttr("identity", "first");
AfxMessageBox( node.GetXML() );
}
}
}
Thank you all. No one know oneself all. My idea from you, book, all others. already we are shared brains.
|
|
|
|
|
Thank you very much, Kyung-Min. You have been very helpful and XMLite is really a good one, can be used for many purposes. Thanks a lot!
|
|
|
|