[ 
https://issues.apache.org/jira/browse/XERCESC-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Boris Kolpackov updated XERCESC-1263:
-------------------------------------

    Affects Version/s:     (was: 2.5.0)
                           (was: 2.3.0)
                       3.1.0
        Fix Version/s: 3.1.0

The bug is still present in 3.1.0.

> Abstract type not handled correctly by cached grammar
> -----------------------------------------------------
>
>                 Key: XERCESC-1263
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1263
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (XML Schema)
>    Affects Versions: 3.1.0
>            Reporter: Matthew Berry
>             Fix For: 3.1.0
>
>
> 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 messages:
>   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" />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org

Reply via email to