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 Drew Tennenbaum <DT...@10fold.com> on 2002/01/24 23:17:24 UTC

Parser reuse

I am using an XML2Reader object (I called it 'parser') to read in a
buffer. I am reusing this object between two buffers. In other words I
do not delete the 'parser' object.

I have two XML buffers:

One has a DTD within the file

and the second has no DTD at all (neither referenced or in the buffer)

When I pass the second buffer into parser->parse I get the validation
errors because the parser is still using the DTD rules from the first
parse. Is there a way to 'reset' the parser to a clean state. I have the
features set so that validation is set to true and the
validation/dynamic is also set to true (only validate if a DTD exists).

Any ideas on how to get rid of the validation errors in the second
buffer when no DTD exists?

Thanks,
Drew


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the TenFold Postmaster (postmaster@10fold.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: Parser reuse

Posted by Tinny Ng <tn...@ca.ibm.com>.
Do not set validation to true.   Setting validation to true will overwrite
the dynamic switch, and always validate even DTD does not exist, and thus
error.

Just set validation/dynamic to true is enough, which will validate only if
grammar exists.

Tinny

Drew Tennenbaum wrote:

> I am using an XML2Reader object (I called it 'parser') to read in a
> buffer. I am reusing this object between two buffers. In other words I
> do not delete the 'parser' object.
>
> I have two XML buffers:
>
> One has a DTD within the file
>
> and the second has no DTD at all (neither referenced or in the buffer)
>
> When I pass the second buffer into parser->parse I get the validation
> errors because the parser is still using the DTD rules from the first
> parse. Is there a way to 'reset' the parser to a clean state. I have the
> features set so that validation is set to true and the
> validation/dynamic is also set to true (only validate if a DTD exists).
>
> Any ideas on how to get rid of the validation errors in the second
> buffer when no DTD exists?
>
> Thanks,
> Drew
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the TenFold Postmaster (postmaster@10fold.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