Ori Doolman wrote:
> Hello,
>
> I'm parsing xml files using Xerces-c 2.7 DOM.
>
> I do the following things (more or less):
>
>
>
> 1. create a XMLGrammarPoolImpl object and then create a new
> DOMBuilder using it as an input.
> 2. parse an xml file using the DOMBuilder and keep a reference to
> the DOMDocument, 'doc1'
> 3. parse another XML file using the same DOMBuilder and keep a
> reference to the DOMDocument 'doc2'
> 4. Create a new DOMInputSource and call DOMBuilder
> ->loadGrammar(inputSrc, SchemaGrammarType, true)
>
>
>
> The result is that my previous parsed document, 'doc2' is being released
> by the following code in parsers\DOMBuilderImpl.cpp on
> DOMBuilderImpl::loadGrammar (line 703):
>
>
>
> // Release DOM tree - DTD
>
> DOMDocument* doc = adoptDocument();
>
> if (doc)
>
> doc->release();
>
>
>
>
>
> Can someone explain why my document is being release and how to overcome
> that? Is it a bug?
Ori,
AFAIK you can call adoptDocument() yourself and release the doc after use.
HTH,
Axel