[ 
http://issues.apache.org/jira/browse/XERCESC-1345?page=comments#action_60468 ]
     
Christian Will commented on XERCESC-1345:
-----------------------------------------

Hi,

I discovered yesterday the reason for this bug.

During we parse the invalid xml file we create the missing element declaration 
for the element <content>, declare it as JustFaultIn and put it into the table 
fDTDElemNonDeclPool.

When we parse the valid xml file again and reach our element <content> the 
validator finds the wrong element declaration in fDTDElemNonDeclPool and 
reports the error.

I think we should clear the table fDTDElemNonDeclPool before we parse a new 
document. So I just added "fDTDElemNonDeclPool->removeAll();" to
IGXMLScanner::scanReset(...) and it works fine.

Regards,
Christian Will


> Validating correct xml fails after validating invalid one.
> ----------------------------------------------------------
>
>          Key: XERCESC-1345
>          URL: http://issues.apache.org/jira/browse/XERCESC-1345
>      Project: Xerces-C++
>         Type: Bug
>   Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>     Versions: 2.5.0
>  Environment: Linux
>     Reporter: mind
>     Priority: Critical
>  Attachments: IGXMLScanner2.cpp.patch, bug.tar.gz
>
> I do following:
> 1. create saxparser and set caching grammars
> 2. load schema >3<
> 3. validate >1<  => valid
> 4. validate >2<  => invalid
> 5. validate >1<  => invalid (WRONG !!!)
> >1<
> <?xml version="1.0"?>
> <content xmlns="http://mind.p4.com/mytest"/>
> >2<
> <?xml version="1.0"?>
> <content></content>
> >3<
> <?xml version="1.0"?>
> <xs:schema elementFormDefault="qualified" 
> targetNamespace="http://mind.p4.com/mytest"; xmlns="http://mind.p4.com/mytest"; 
> xmlns:xs="http://www.w3.org/2001/XMLSchema";>
>  <xs:element name="content" type="xs:anyType"/>
> </xs:schema>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to