🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #876

Re: Xerces + Mac + unmapped memory exception

#876
From: Jedidja Bourgeois
Date: Tue, 07 Jan 2003 12:28
103 lines
4416 bytes
We're using expat on pc/mac to parse our own XML files that store a variety
of data. Haven't had any issues and we're using the Unicode-enabled build on
both platforms. I can't see any reason not to use it on the mac :)

RK wrote:
> 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: <TKzS9.1921$SQ5.493164@news20.bellglobal.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
References: <389ca595.0301060047.4034bfed@posting.google.com> <%AhS9.1278$Af2.262617@news20.bellglobal.com> <hawkfish-D6AB2B.08053806012003@tribune.sj.sys.us.xo.net> <389ca595.0301070412.70cf3c98@posting.google.com>

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:31:30 PST
From: "Jedidja Bourgeois" <jedidjab79@hotmail.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
References: <389ca595.0301060047.4034bfed@posting.google.com> <%AhS9.1278$Af2.262617@news20.bellglobal.com> <hawkfish-D6AB2B.08053806012003@tribune.sj.sys.us.xo.net> <389ca595.0301070412.70cf3c98@posting.google.com>
Subject: Re: Xerces + Mac +  unmapped memory exception
Lines: 105
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Forwarded: by - (DeleGate/8.1.0)
Message-ID: <TKzS9.1921$SQ5.493164@news20.bellglobal.com>
Date: Tue, 7 Jan 2003 07:28:16 -0500
NNTP-Posting-Host: 64.230.91.212
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1041942579 64.230.91.212 (Tue, 07 Jan 2003 07:29:39 EST)
NNTP-Posting-Date: Tue, 07 Jan 2003 07:29:39 EST
Organization: Bell Sympatico
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail