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 Ranjana Srivastava <rs...@CTCHOME.com> on 2002/01/15 21:15:47 UTC

MalformedURLException

I am trying to parse an xml file that resides on my local machine. If i
try sending in the path of the file to the Parser I get an
MalformedURLException
I have tried passing the file name as" file:C:/wf32/personal.xml " the
parser object but I get a RuntimeException  error . This is the same xml
file that came with the samples
 so I am sure the problem is not with the file. BTW I am using Borland
C++5 on Windows98. Any help will be appreciated

A few lines of the code are as follows:
  char * fileName = "file:C:/wf32/personal.xml"
 DOMParser *parser = new DOMParser;
    //  Parse the XML file, catching any XML exceptions that might
propogate
    //  out of it.
    //
    bool errorsOccured = false;
    try
    {
        parser->parse(fileName);
        int errorCount = parser->getErrorCount();
        if (errorCount > 0)
            errorsOccured = true;
    }

    catch (const XMLException& e)
    {

    }



Ranjana Srivastava



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


Re: MalformedURLException

Posted by Don Mastrovito <dm...@marathontechnologies.com>.
Replace file: with file:/// in the local url.  Note the 3 slashes!

Don

At 03:15 PM 1/15/2002 -0500, you wrote:
>I am trying to parse an xml file that resides on my local machine. If i
>try sending in the path of the file to the Parser I get an
>MalformedURLException
>I have tried passing the file name as" file:C:/wf32/personal.xml " the
>parser object but I get a RuntimeException  error . This is the same xml
>file that came with the samples
>  so I am sure the problem is not with the file. BTW I am using Borland
>C++5 on Windows98. Any help will be appreciated
>
>A few lines of the code are as follows:
>   char * fileName = "file:C:/wf32/personal.xml"
>  DOMParser *parser = new DOMParser;
>     //  Parse the XML file, catching any XML exceptions that might
>propogate
>     //  out of it.
>     //
>     bool errorsOccured = false;
>     try
>     {
>         parser->parse(fileName);
>         int errorCount = parser->getErrorCount();
>         if (errorCount > 0)
>             errorsOccured = true;
>     }
>
>     catch (const XMLException& e)
>     {
>
>     }
>
>
>
>Ranjana Srivastava
>
>
>
>---------------------------------------------------------------------
>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: Memory Profiler

Posted by Martin Kalen <ma...@todaysystems.com.au>.
> I must thank Martin for the answer, but I've got a problem:
> I'm not developing an EXE file, but a DLL.

No problem - just instrument the final EXE using your DLL.

Note that "minmal" instrumentation occurs when you don't have any
debug info available for a module (be it DLL or EXE) - you should get
"precise" instrumentation with your DLL. If you set your project to
use program database debug information, i.e. external ".PDB"-files,
you must copy these to the location of you DLL in order for purify to
pick up the information.

That's all you need to purify Xerces-C or any DLL using it.

Please check the purify help for additional info, e.g. how to tune
which level of instrumentation you want for individual modules in your
project etc.

If you get warnings about "freeing invalid memory" etc. when using
Xerces-C, make sure you link with the same runtime library as Xerces-C
(/MDd for debug exe files and /MDd /LDd for debug DLL files). Check
the Xerces-C FAQ on the website for some background info on this.

Regards,
 Martin


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


RE: Memory Profiler

Posted by Erik Rydgren <er...@mandarinen.se>.
We use NuMega Boundchecker to detect memory leaks. It still need an exe to
work. But that is no problem. You still need code to drive the tests. Just
load the dll and perform tests. It should work the same way with purify.

Regards

Erik Rydgren
Mandarinen systems AB
Sweden


-----Original Message-----
From: Xerces Rule [mailto:xerces-c@bilbao.com]
Sent: den 21 januari 2002 13:32
To: xerces-c-dev@xml.apache.org
Subject: Re: Memory Profiler


Hi.

I must thank Martin for the answer, but I've got a problem:
I'm not developing an EXE file, but a DLL.

So my 'very short' Purify Report is:
*****************************
Instrumenting:
   myfile.dll 499762 bytes
*****************************

Is not there any way to detect memory leaks within a DLL?

regards.


El Mon, 21 Jan 2002 11:45:08 +1100
 "Martin Kalen" <ma...@todaysystems.com.au> escribió:
> > Now, I want to optimize the memory using by my program,
> and
> > I've downloaded 'Rational Purify', in order to test it.
>
> NB that Purify will not provide any
> profiling/optimization hints, but
> it will detect memory leaks, buffer under-/overruns,
> invalid pointer
> reads etc.
>
> As Herb Chong pointed out, Purify should integrate with
> VC++ at
> install time and give you some handy toolbar buttons that
> you can use
> in Visual Studio.
>
> If you want to go for the command-line option, make sure
> you have the
> purify install- and cache directories in your path
> (normally SET
> PATH=%PATH%;C:\progra~1\rational\purify;C:\progra~1\rational\purify\ca
> che) and run:
>
> # (your nmake line)
> # purify /replace=yes /run=no myexecutable.exe
>
> This will replace your executable with an instrumented
> version that
> will load the Purify GUI at start-up.
>
> Good luck,
>  Martin.
>
> --
> Martin Kalen
> Software Engineer
> TODAY Systems, Inc.
> http://www.todaysystems.com.au/
> Tel +61-3-9536 3900 - Fax +61-3-9536 3901
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-c-dev-help@xml.apache.org
>

_______________________________________________________________________
¿Ya conoces eBay, el mayor centro de compra y venta en internet?
Móviles, portátiles, pda´s, cd´s, cámaras digitales...
¡Compruébalo tú mismo!
http://adfarm.mediaplex.com/ad/ck/1185-5550-4234-3?RedirectEnter&partner=341
13&loc=http://www.es.ebay.com

---------------------------------------------------------------------
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: Memory Profiler

Posted by Xerces Rule <xe...@bilbao.com>.
Hi.

I must thank Martin for the answer, but I've got a problem:
I'm not developing an EXE file, but a DLL.

So my 'very short' Purify Report is:
*****************************
Instrumenting:
   myfile.dll 499762 bytes
*****************************

Is not there any way to detect memory leaks within a DLL?

regards.


El Mon, 21 Jan 2002 11:45:08 +1100
 "Martin Kalen" <ma...@todaysystems.com.au> escribió:
> > Now, I want to optimize the memory using by my program,
> and
> > I've downloaded 'Rational Purify', in order to test it.
> 
> NB that Purify will not provide any
> profiling/optimization hints, but
> it will detect memory leaks, buffer under-/overruns,
> invalid pointer
> reads etc.
> 
> As Herb Chong pointed out, Purify should integrate with
> VC++ at
> install time and give you some handy toolbar buttons that
> you can use
> in Visual Studio.
> 
> If you want to go for the command-line option, make sure
> you have the
> purify install- and cache directories in your path
> (normally SET
> PATH=%PATH%;C:\progra~1\rational\purify;C:\progra~1\rational\purify\ca
> che) and run:
> 
> # (your nmake line)
> # purify /replace=yes /run=no myexecutable.exe
> 
> This will replace your executable with an instrumented
> version that
> will load the Purify GUI at start-up.
> 
> Good luck,
>  Martin.
> 
> --
> Martin Kalen
> Software Engineer
> TODAY Systems, Inc.
> http://www.todaysystems.com.au/
> Tel +61-3-9536 3900 - Fax +61-3-9536 3901
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-c-dev-help@xml.apache.org
> 

_______________________________________________________________________
¿Ya conoces eBay, el mayor centro de compra y venta en internet?
Móviles, portátiles, pda´s, cd´s, cámaras digitales...
¡Compruébalo tú mismo!
http://adfarm.mediaplex.com/ad/ck/1185-5550-4234-3?RedirectEnter&partner=34113&loc=http://www.es.ebay.com

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


Re: Memory Profiler

Posted by Martin Kalen <ma...@todaysystems.com.au>.
> Now, I want to optimize the memory using by my program, and
> I've downloaded 'Rational Purify', in order to test it.

NB that Purify will not provide any profiling/optimization hints, but
it will detect memory leaks, buffer under-/overruns, invalid pointer
reads etc.

As Herb Chong pointed out, Purify should integrate with VC++ at
install time and give you some handy toolbar buttons that you can use
in Visual Studio.

If you want to go for the command-line option, make sure you have the
purify install- and cache directories in your path (normally SET
PATH=%PATH%;C:\progra~1\rational\purify;C:\progra~1\rational\purify\ca
che) and run:

# (your nmake line)
# purify /replace=yes /run=no myexecutable.exe

This will replace your executable with an instrumented version that
will load the Purify GUI at start-up.

Good luck,
 Martin.

--
Martin Kalen
Software Engineer
TODAY Systems, Inc.
http://www.todaysystems.com.au/
Tel +61-3-9536 3900 - Fax +61-3-9536 3901


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


Memory Profiler

Posted by Xerces Rule <xe...@bilbao.com>.
Hi!

I'm creating a program by using:
nmake /f "my_makefile.mak" CFG "my_program - Release"
(Using VC++6.0 on Windows NT4.0)

Now, I want to optimize the memory using by my program, and
I've
downloaded 'Rational Purify', in order to test it.

Does anybody know how to modify my 'makefile' in order to
use
'Rational Purify'?

Does anybody know a better way to 'purify' my program?

Regards and thanks.
_______________________________________________________________________
¿Ya conoces eBay, el mayor centro de compra y venta en internet?
Móviles, portátiles, pda´s, cd´s, cámaras digitales...
¡Compruébalo tú mismo!
http://adfarm.mediaplex.com/ad/ck/1185-5550-4234-3?RedirectEnter&partner=34113&loc=http://www.es.ebay.com

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