You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by "Tankel, Ifat" <If...@icomverse.com> on 2002/05/29 07:39:04 UTC
"working with Dom input and output" pattern but with DOM objects
created with NEW
Hi,
I am using the first part of usage pattern named "working with Dom input and
output"
to create a XalanDocument. This is done in an init method of a class I wrote
(in c++)
// some of the members of my class
static DOMParser *_domParser;
static XercesParserLiaison * _parserLiaison;
DOM_Document * _domDocument;
XalanDocument * _xalanReelDoc;
// initiating the class members
_domParser=new DOMParser();
_parserLiaison = new XercesParserLiaison();
_domDocument =new DOMDocument();
_domParser->parse( xmlfileSource);
*_domDocument= _domParser->getDocument();
_xalanRealDoc= _parserLiaison->createDocument(*_domDocument)
The difference is that I use "new" to create the DOMParser,
XercesParserLiaison and DOMDocument.
I wrote a program that use this class and everything works.
but then I entered Xercess DOM programming guide and I read this:
"Never "new" a DOM object into the heap or make an ordinary C pointer
variable to one, as this will greatly confuse the automatic memory
management.
way "newing" a DOM object do that ?
will I get an exception when this happened?
Ifat
ifat.tankel@comverse.com
Comverse Divisional Developer