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 "mind (JIRA)" <xe...@xml.apache.org> on 2005/02/17 13:26:53 UTC

[jira] Created: (XERCESC-1345) Validating correct xml fails after validating invalid one.

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: 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Resolved: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=history ]
     
cargilld resolved XERCESC-1345:
-------------------------------

    Resolution: Fixed

I have applied Christian's patch.  Please verify.

> 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "Christian Will (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=comments#action_59563 ]
     
Christian Will commented on XERCESC-1345:
-----------------------------------------

Hi Gareth,

maybe I'm wrong, but I think the element in >1< gets implicit qualification provided by the default namespace.

fyi: The mechanism for defaulting the namespaces is specified for elements and not attributes. Attributes which are set to be qualified must be explicitly prefixed.

Regards,
Christian

> 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: 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Updated: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "mind (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=history ]

mind updated XERCESC-1345:
--------------------------

    Attachment: bug.tar.gz

> 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: 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Updated: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "Christian Will (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=history ]

Christian Will updated XERCESC-1345:
------------------------------------

    Attachment: IGXMLScanner2.cpp.patch

fixpatch...

> 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "mind (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=comments#action_59574 ]
     
mind commented on XERCESC-1345:
-------------------------------

Gareth:
Element in >1< IS qualified, by setting default namespace. Try any other validator - eg. xmlbeans - it says valid. So it's a bug.




> 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: 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "Christian Will (JIRA)" <xe...@xml.apache.org>.
     [ 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1345) Validating correct xml fails after validating invalid one.

Posted by "Gareth Reakes (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1345?page=comments#action_59331 ]
     
Gareth Reakes commented on XERCESC-1345:
----------------------------------------

There is something strange going on here! Its not quite the problem you think. Both of your doucuments are invalid. You specify elementFormDefault="qualified" which means that the elements in your instance file must be qualified. So the real problem is that the first time it has not picked that up. If you change them to be qualified it reports both attemps at validation of c.xml to be valid.

> 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: 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org