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 Rocky Raccoon <rr...@bigfoot.com> on 2000/04/28 21:22:12 UTC

Validator reuse

I have to parse 2 XML Files both having identical DOCTYPE Declaration.

I tried
parser.parse(file1);
parser.parse(file2,true);

The second one chokes
Fatal Error at (file F:\xerces-c_1_1_0-win32\samples\data\a.xml, line 2,
char 20
): An exception occured! Type:IllegalArgumentException, Message:The
element
personnel already exists

However if I remove the DOCTYPE Declaration from the 2nd file,
everything works fine.
Can be reproduced by modifying the Saxprint example.
Is this a bug or am I doing something wrong ?




Re: Validator reuse

Posted by Rahul Jain <ra...@jtcsv.com>.
The fix has been checked in. Just for the record.
rahul



Re: Validator reuse

Posted by Andy Heninger <an...@jtcsv.com>.
Rocky, you you didn't mention whether your document had an internal DTD
or not.  If it doesn't, and it doesn't work on the latest code, it would
be a bug in need of fixing.

If you don't want to mess with CVS, current source is available from
http://xml.apache.org/form-cvs/xml-xerces/

  -- Andy


Dean wrote,

> Theoretically, you should be able to have a DOCTYPE and an external
subset.
> If you use the resuseValidator, its supposed to just ignore the external
> subset. You cannot have any internal subset at all, but its supposed to be
> able to ignore the external subset (and it was at one point, so I'm not
sure
> what's wrong now.)
>
>


Re: Validator reuse

Posted by Dean Roddey <dr...@charmedquark.com>.
I'll take a look at this tonight and see what I can find.

--------------------------
Dean Roddey
The CIDLib Class Libraries
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Give me immortality, or give me death"



RE: Validator reuse

Posted by Henry Luo <he...@openmarket.com>.
Looks like this is not true any more.  The document cannot have
DOCTYPE at all.

> -----Original Message-----
> From: Dean Roddey [mailto:droddey@charmedquark.com]
> Sent: Friday, April 28, 2000 4:21 PM
> To: xerces-c-dev@xml.apache.org
> Subject: Re: Validator reuse
>
>
> Theoretically, you should be able to have a DOCTYPE and an
> external subset.
> If you use the resuseValidator, its supposed to just ignore the external
> subset. You cannot have any internal subset at all, but its supposed to be
> able to ignore the external subset (and it was at one point, so
> I'm not sure
> what's wrong now.)
>
> --------------------------
> Dean Roddey
> The CIDLib Class Libraries
> Charmed Quark Software
> droddey@charmedquark.com
> http://www.charmedquark.com
>
> "Give me immortality, or give me death"
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


Re: Validator reuse

Posted by Dean Roddey <dr...@charmedquark.com>.
Theoretically, you should be able to have a DOCTYPE and an external subset.
If you use the resuseValidator, its supposed to just ignore the external
subset. You cannot have any internal subset at all, but its supposed to be
able to ignore the external subset (and it was at one point, so I'm not sure
what's wrong now.)

--------------------------
Dean Roddey
The CIDLib Class Libraries
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Give me immortality, or give me death"



Re: Validator reuse

Posted by Tom Jordahl <to...@allaire.com>.
My understanding is this is correct behavior.

It is an error to have a DOCTYPE declaration when you are trying to
reuse the parser.  The validator is already set up for the original
DTD and changing it on the fly would create many problems.

Also - my code depends on this so I can force the use of a single
DTD for all documents I am validating.

-- 
Tom Jordahl			tomj@allaire.com
Allaire Corp.			http://www.allaire.com


Rocky Raccoon wrote:
> 
> I have to parse 2 XML Files both having identical DOCTYPE Declaration.
> 
> I tried
> parser.parse(file1);
> parser.parse(file2,true);
> 
> The second one chokes
> Fatal Error at (file F:\xerces-c_1_1_0-win32\samples\data\a.xml, line 2,
> char 20
> ): An exception occured! Type:IllegalArgumentException, Message:The
> element
> personnel already exists
> 
> However if I remove the DOCTYPE Declaration from the 2nd file,
> everything works fine.
> Can be reproduced by modifying the Saxprint example.
> Is this a bug or am I doing something wrong ?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org