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 xe...@xml.apache.org on 2004/08/24 16:08:20 UTC

[jira] Closed: (XERCESC-1262) Abstract type not handled correctly by cached grammar

Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1262

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1262
    Summary: Abstract type not handled correctly by cached grammar
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: DUPLICATE

    Project: Xerces-C++
 Components: 
             Validating Parser (Schema) (Xerces 1.5 or up only)
   Versions:
             2.3.0
             2.5.0

   Assignee: 
   Reporter: Matthew Berry

    Created: Tue, 24 Aug 2004 5:14 AM
    Updated: Tue, 24 Aug 2004 7:08 AM

Description:
Details:
--------

I have managed to narrow the problem I am having to a simple test case. In the schema, I have an abstract type defined and am using xsi:type with a concrete type in the data file.

If I have a xsi:schemaLocation attribute in my data file, then the test Xml file passes the validation. (I have used DOMCount to verify this)

If I remove xsi:schemaLocation and instead from my source code call loadGrammar() and setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true), I am getting the following error message:

  Message: Element paramInstance is declared with a type that is
     abstract.  Use xsi:type to specify a non-abstract type

  Message: Attribute 'name' is not declared for element 'paramInstance'
Schema:
-------

<xsd:schema targetNamespace="http://www.temp.org" xmlns:tmp="http://www.temp.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <!-- 
      Define a 'paramInstance' element
      NOTE: We use an abstract base to allow for extension
      -->
   <xsd:complexType name="ParamInstanceType" abstract="true" />
   <xsd:element name="paramInstance" type="ParamInstanceType" />
   <!-- 
      Specifying a concrete type
     -->
   <xsd:complexType name="ConcreteParamInstance">
      <xsd:complexContent>
         <xsd:extension base="tmp:ParamInstanceType">
            <xsd:attribute name="name" type="xsd:string" use="required" />
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
</xsd:schema>

Test data file:
---------------
<paramInstance xmlns="http://www.temp.org"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:type="ConcreteParamInstance" name="param1" />







---------------------------------------------------------------------
JIRA INFORMATION:
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