Help will be appreciated very very much.
What I am doing is retrieving objects and collecting the properties of those objects I am forming an XML String.
The XML Structure looks somewhat like this
<Root>
<Child>
<GrandChild>
<GrandChild>
<GrandChild>
.
.
<Child>
<GrandChild>
<GrandChild>
<GrandChild>
.
.
<Child>
.
.
<Root>
Now the problem comes when there are 1000 <Child> Tags and each child has about 17-25 <GrandChild> Tags.
Forming an XML String of so many Tags Takes a lot of time and also eats Quite a lot of Memory.
This is What I am Doing :
for ( int i=0; i < 2000; i++ )
{
IXMLDOMDocumentPtr domDoc(__uuidof(MSXML:OMDocument));
domDoc.CreateNode(.., &domNode);
domDoc.appendChild(&domNode ,...)
domNode.QueryInterface(...., &domElement);
domElement.setAttribute(..)
domElement.setAttribute(..)
domElement.setAttribute(..)
domElement.setAttribute(..)
CreateGrandChildren(domDoc, domNode);
CComBSTR bstrXMLString;
domDoc.get_xml(&(bstrXMLString.m_str));
}
CreateGrandChildren(IXMLDOMDocumentPtr& domDoc, IXMLDOMNodePtr& domNode)
{
IXMLDOMNode domGChild;
IXMLDOMElement domGCElem;
for ( int i = 0; i < 20; i++)
{
domDoc.CreateNode(..., domGChild);
domNode.InsertBefore(domGChild, .., ..);
domGChild.QueryInterface(.., &domGCElem);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
}
}
Can i speed up things by using some other method.
Please help me in this.
Thanx a lot.
Regards
Sun.
What I am doing is retrieving objects and collecting the properties of those objects I am forming an XML String.
The XML Structure looks somewhat like this
<Root>
<Child>
<GrandChild>
<GrandChild>
<GrandChild>
.
.
<Child>
<GrandChild>
<GrandChild>
<GrandChild>
.
.
<Child>
.
.
<Root>
Now the problem comes when there are 1000 <Child> Tags and each child has about 17-25 <GrandChild> Tags.
Forming an XML String of so many Tags Takes a lot of time and also eats Quite a lot of Memory.
This is What I am Doing :
for ( int i=0; i < 2000; i++ )
{
IXMLDOMDocumentPtr domDoc(__uuidof(MSXML:OMDocument));
domDoc.CreateNode(.., &domNode);
domDoc.appendChild(&domNode ,...)
domNode.QueryInterface(...., &domElement);
domElement.setAttribute(..)
domElement.setAttribute(..)
domElement.setAttribute(..)
domElement.setAttribute(..)
CreateGrandChildren(domDoc, domNode);
CComBSTR bstrXMLString;
domDoc.get_xml(&(bstrXMLString.m_str));
}
CreateGrandChildren(IXMLDOMDocumentPtr& domDoc, IXMLDOMNodePtr& domNode)
{
IXMLDOMNode domGChild;
IXMLDOMElement domGCElem;
for ( int i = 0; i < 20; i++)
{
domDoc.CreateNode(..., domGChild);
domNode.InsertBefore(domGChild, .., ..);
domGChild.QueryInterface(.., &domGCElem);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
domGCElem.setAttribute(..);
}
}
Can i speed up things by using some other method.
Please help me in this.
Thanx a lot.
Regards
Sun.