The following comment has been added to this issue: Author: Matthew Berry Created: Thu, 16 Sep 2004 3:34 AM Body: >From debugging I observed that although I have set 'fgXercesSchema', for the document >element IGXMLScanner::fValidator is of type DTDValidator. When we then process a >child element, its is of type SchemaValidator.
A workaround is to force the parser to use the Schema validator using: setProperty(XMLUni::fgXercesScannerName, XMLUni::fgSGXMLScanner) --------------------------------------------------------------------- View this comment: http://issues.apache.org/jira/browse/XERCESC-1263?page=comments#action_53132 --------------------------------------------------------------------- View the issue: http://issues.apache.org/jira/browse/XERCESC-1263 Here is an overview of the issue: --------------------------------------------------------------------- Key: XERCESC-1263 Summary: Abstract type not handled correctly by cached grammar Type: Bug Status: Unassigned Priority: Major 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: Thu, 16 Sep 2004 3:34 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 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" /> --------------------------------------------------------------------- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]