Article View: comp.sys.mac.programmer.codewarrior
Article #874Re: Xerces + Mac + unmapped memory exception
From: RK
Date: Tue, 07 Jan 2003 12:12
Date: Tue, 07 Jan 2003 12:12
95 lines
3732 bytes
3732 bytes
Here is some of the code I wrote. It's pretty simple.
int ParserMain()
{
.......
doc = parser->parseURI(xmlFile);
.......
if(doc)
{
ParseHeader(doc);
ParseFontTable(doc);
ParsePreferences(doc);
}
.....
parser->release();
XMLPlatformUtils::Terminate();
}
void ParseHeader(DOMDocument *doc)
{
XMLCh tag[] = L"header";
unsigned int nH = 0, len = 0;
DOMNodeList *HList = doc->getElementsByTagName(tag);
if((nH = HList->getLength()) >= 1)
{
for(unsigned int i=0; i<nH; i++)
{
DOMNode *firstChild = HList->item(i);
firstChild = (HList->item(i))->getFirstChild();
while(firstChild!=NULL)
{
bool bHasCNodes = firstChild->hasChildNodes();
if(bHasCNodes==true)
{
DOMNode *tmp = firstChild->getFirstChild();
if(tmp!=NULL)
{
if(strcmp(tempNodeName, "id")==0)
{
XMLString::copyString(stHeader.id,
XMLString::transcode(tmp->getNodeValue()));
}
else if(strcmp(tempNodeName, "title")==0)
{
XMLString::copyString(stHeader.title,
XMLString::transcode(tmp->getNodeValue()));
}
}
}
firstChild = firstChild->getNextSibling();
}//while ends
}//for ends
}//if ends
}
I have a few routines which are doing similar things. And execution of
2nd/3rd such routine gives me an exception.
__________________________________________________________
Also, I want to be very sure about moving to expat, if I have to. Any
comments on expat for Mac are also welcome.
-rk
Richard Wesley <hawkfish@trustedmedianetworks.com> wrote in message news:<hawkfish-D6AB2B.08053806012003@tribune.sj.sys.us.xo.net>...
> In article <%AhS9.1278$Af2.262617@news20.bellglobal.com>,
> "Jedidja Bourgeois" <jedidjab79@hotmail.com> wrote:
>
> > We switched from using Xerces to expat on the pc because expat ran many
> > times faster. It was pretty easy to switch, actually -- the structure of the
> > callbacks from both libraries are pretty similar. Btw, expat runs just fine
> > on the mac in case you're curious :)
>
> Same here. We are using it in a cross-platform product and it works
> just great. Wrap it up in some C++ wrappers and it can pretty much drop
> in for your SAX implementation.
>
> --
>
> - rmgw
>
> http://www.trustedmedianetworks.com/
>
> ----------------------------------------------------------------------------
> Richard Wesley Trusted Media Networks, Inc.
>
> "Grownups have the most uninteresting explanations for things."
> - C. S. Lewis, _The Magician's Nephew_
Technical Details
Message-ID:
<389ca595.0301070412.70cf3c98@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<389ca595.0301060047.4034bfed@posting.google.com> <%AhS9.1278$Af2.262617@news20.bellglobal.com> <hawkfish-D6AB2B.08053806012003@tribune.sj.sys.us.xo.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,d5669dc6e8f7338c X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,d5669dc6e8f7338c X-Google-Attributes: gidf635e,public X-Google-ArrivalTime: 2003-01-07 04:12:52 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: rkchats@yahoo.com (RK) Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac Subject: Re: Xerces + Mac + unmapped memory exception Date: 7 Jan 2003 04:12:52 -0800 Organization: http://groups.google.com/ Lines: 95 Message-ID: <389ca595.0301070412.70cf3c98@posting.google.com> References: <389ca595.0301060047.4034bfed@posting.google.com> <%AhS9.1278$Af2.262617@news20.bellglobal.com> <hawkfish-D6AB2B.08053806012003@tribune.sj.sys.us.xo.net> NNTP-Posting-Host: 203.122.14.34 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1041941572 16586 127.0.0.1 (7 Jan 2003 12:12:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Jan 2003 12:12:52 GMT