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 Bala Ayres <ba...@XSeLlence.com> on 2000/09/10 00:31:01 UTC

Multiple use of DTDValidator and SAXParser causes memory fault

The code snippet :

 DTDValidator *valTouse
 valToUse = new DTDValidator;
SAXParser::ValSchemes valScheme = SAXParser::Val_Auto ;
......
.......
.......

SAXParser parser(valToUse);
parser.serValidationScheme(valScheme) ;
......more code
......

This snippet included first time in a function called xmlmain() works
fine.
But creating yet another function say xmlmain2() with exact same
construct
causes memory fault at SAXParser parser(valToUse);

Question: Is it not possible to create as many instances of the parser
as needed in different parts of the program ?? Should only one instance
of the parser be used to do all the work?

TIA

Bala Ayres
XSeLLENCE Inc



Re: Multiple use of DTDValidator and SAXParser causes memory fault

Posted by Bala Ayres <ba...@XSeLlence.com>.

Dean Roddey wrote:

> The parser adopts the validator. You must create a new one for each new
> parser instance.

Ok - and the code creates new Validator instance for each new parser
instance...The platform is Linux - and still no luck.

Bala Ayres
XSeLLENCE Inc


>
>
> --------------------------
> Dean Roddey
> The CIDLib C++ Frameworks
> Charmed Quark Software
> droddey@charmedquark.com
> http://www.charmedquark.com
>
> "It takes two buttocks to make friction"
>     - African Proverb
>
> ----- Original Message -----
> From: "Bala Ayres" <ba...@XSeLlence.com>
> To: <xe...@xml.apache.org>
> Sent: Saturday, September 09, 2000 3:31 PM
> Subject: Multiple use of DTDValidator and SAXParser causes memory fault
>
> > The code snippet :
> >
> >  DTDValidator *valTouse
> >  valToUse = new DTDValidator;
> > SAXParser::ValSchemes valScheme = SAXParser::Val_Auto ;
> > ......
> > .......
> > .......
> >
> > SAXParser parser(valToUse);
> > parser.serValidationScheme(valScheme) ;
> > ......more code
> > ......
> >
> > This snippet included first time in a function called xmlmain() works
> > fine.
> > But creating yet another function say xmlmain2() with exact same
> > construct
> > causes memory fault at SAXParser parser(valToUse);
> >
> > Question: Is it not possible to create as many instances of the parser
> > as needed in different parts of the program ?? Should only one instance
> > of the parser be used to do all the work?
> >
> > TIA
> >
> > Bala Ayres
> > XSeLLENCE Inc
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >


Re: Multiple use of DTDValidator and SAXParser causes memory fault

Posted by Dean Roddey <dr...@charmedquark.com>.
The parser adopts the validator. You must create a new one for each new
parser instance.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"It takes two buttocks to make friction"
    - African Proverb


----- Original Message -----
From: "Bala Ayres" <ba...@XSeLlence.com>
To: <xe...@xml.apache.org>
Sent: Saturday, September 09, 2000 3:31 PM
Subject: Multiple use of DTDValidator and SAXParser causes memory fault


> The code snippet :
>
>  DTDValidator *valTouse
>  valToUse = new DTDValidator;
> SAXParser::ValSchemes valScheme = SAXParser::Val_Auto ;
> ......
> .......
> .......
>
> SAXParser parser(valToUse);
> parser.serValidationScheme(valScheme) ;
> ......more code
> ......
>
> This snippet included first time in a function called xmlmain() works
> fine.
> But creating yet another function say xmlmain2() with exact same
> construct
> causes memory fault at SAXParser parser(valToUse);
>
> Question: Is it not possible to create as many instances of the parser
> as needed in different parts of the program ?? Should only one instance
> of the parser be used to do all the work?
>
> TIA
>
> Bala Ayres
> XSeLLENCE Inc
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>