You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Stefan Naewe <s....@eu.theimagingsource.com> on 2001/03/15 13:01:24 UTC

[Fwd: RE: NEWBIE: Trying to use MemBufInputSource in parse member functionof DOMParser]


-------- Original Message --------
From: Williams Roger <RW...@OLDMUTUAL.com>
Subject: RE: NEWBIE: Trying to use MemBufInputSource in parse member
functionof  DOMParser
To: "'s.naewe@eu.theimagingsource.com'" <s....@eu.theimagingsource.com>


Thanks. Yes, 123456789 is what I wanted. I saw what my problem was. I used
sizeof instead of strlen when constructing the MemBufInputSource.

MemBufInputSource memBufIS ((const XMLByte*)gXMLInMemBuf
					, strlen(gXMLInMemBuf)
					, gMemBufId
					, false
					);

Only funny thing is that it works on Windows, but I get an exception when I
run it on solaris 2.7 . The exception is caught where I try to make the
MemBufInputSource class.

When catching an XMLException, I want to use the getMessage() member
function to get the error message. But this function returns XMLCh* 

How does one convert a XMLCh* to char* ?

from
Roger


-----Original Message-----
From: Stefan Naewe [mailto:s.naewe@eu.theimagingsource.com]
Sent: 15 March 2001 1:50 PM
To: xerces-c-dev@xml.apache.org
Subject: Re: NEWBIE: Trying to use MemBufInputSource in parse member
functionof DOMParser


Williams Roger wrote:
> 
> I am trying to use the parse member function(with the DOMParser) with a
> MemBufInputSource instead of a XMLfile or URL. But the Node I get from
trhe
> NodeList is null. When I use a file instead of a membuf, it works fine.
But
> when I use a MemBufInputSource teh Node is null.

Not for me.
The output I get is: 
123456789

That's what you wanted, I guess.

Stefan
-- 
--------------------------------------------------------------------
Stefan Naewe                                  English, German spoken
                                     s.naewe@eu.theimagingsource.com
The Imaging Source Europe GmbH       http://www.theimagingsource.com
Tel: +49-(0)421-33591-0              Fax: +49-(0)421-33591-80
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: RE: NEWBIE: Trying to use MemBufInputSource in parse member functionof DOMParser]

Posted by Volker Krause <v....@samuelson.de>.
> Only funny thing is that it works on Windows, but I get an exception when
I
> run it on solaris 2.7 . The exception is caught where I try to make the
> MemBufInputSource class.
When debugging the win32 code (VC I suppose) take a look at 'numread' before
and after the memset function.

If someone know something like malloc_dbg (allocating 4 extra-bytes in front
of and after the 'user memory' and testing them in free_dbg) for the stack
(project settings/pragma/tools): please post it to me

regards,
 Volker Krause


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: [Fwd: RE: NEWBIE: Trying to use MemBufInputSource in parse member functionof DOMParser]

Posted by Stefan Naewe <s....@eu.theimagingsource.com>.
> -------- Original Message --------
> From: Williams Roger <RW...@OLDMUTUAL.com>
> Subject: RE: NEWBIE: Trying to use MemBufInputSource in parse member
> functionof  DOMParser
> To: "'s.naewe@eu.theimagingsource.com'" <s....@eu.theimagingsource.com>
> 
> Thanks. Yes, 123456789 is what I wanted. I saw what my problem was. I used
> sizeof instead of strlen when constructing the MemBufInputSource.
> 
> MemBufInputSource memBufIS ((const XMLByte*)gXMLInMemBuf
>                                         , strlen(gXMLInMemBuf)
>                                         , gMemBufId
>                                         , false
>                                         );
> 
> Only funny thing is that it works on Windows, but I get an exception when I
> run it on solaris 2.7 . The exception is caught where I try to make the
> MemBufInputSource class.
> 
> When catching an XMLException, I want to use the getMessage() member
> function to get the error message. But this function returns XMLCh*
> 
> How does one convert a XMLCh* to char* ?

XMLString::transcode()

Stefan
-- 
--------------------------------------------------------------------
Stefan Naewe                                  English, German spoken
                                     s.naewe@eu.theimagingsource.com
The Imaging Source Europe GmbH       http://www.theimagingsource.com
Tel: +49-(0)421-33591-0              Fax: +49-(0)421-33591-80
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org