You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "David Green-Lank (JIRA)" <xe...@xml.apache.org> on 2010/09/11 18:29:32 UTC
[jira] Updated: (XERCESJ-1467) cvc-elt.4.3: Type
'xs:localComplexType' is not validly derived from the type definition,
'complexType', of element 'child'.
[ https://issues.apache.org/jira/browse/XERCESJ-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Green-Lank updated XERCESJ-1467:
--------------------------------------
Summary: cvc-elt.4.3: Type 'xs:localComplexType' is not validly derived from the type definition, 'complexType', of element 'child'. (was: cvc-elt.4.3: Type 'ns0:localComplexType' is not validly derived from the type definition, 'complexType', of element 'value'.)
> cvc-elt.4.3: Type 'xs:localComplexType' is not validly derived from the type definition, 'complexType', of element 'child'.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1467
> URL: https://issues.apache.org/jira/browse/XERCESJ-1467
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.0 Structures
> Affects Versions: 2.10.0
> Environment: Xerces2-J 2.10.0
> Reporter: David Green-Lank
>
> Given the schema (dgreen.xsd):
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"/>
> <xs:element name="root">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="child" type="xs:complexType"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> Parsing the instance document (dgreen.xml):
> <?xml version="1.0"?>
> <root>
> <child xsi:type="xs:localComplexType"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
> </root>
> Code to reproduce (Main.java):
> import org.apache.xerces.jaxp.validation.XMLSchemaFactory;
> import javax.xml.validation.Schema;
> import javax.xml.validation.Validator;
> import javax.xml.transform.stream.StreamSource;
> import java.io.File;
> public class Main {
> public static void main( String... args ) throws Exception {
> XMLSchemaFactory schemaFactory = new XMLSchemaFactory();
> Schema schema = schemaFactory.newSchema( new File( "dgreen.xsd" ) );
> Validator validator = schema.newValidator();
> validator.validate( new StreamSource( new File( "dgreen.xml" ) ) );
> }
> }
> Produces the following:
> Exception in thread "main" org.xml.sax.SAXParseException: cvc-elt.4.3: Type 'xs:localComplexType' is not validly derived from the type definition, 'complexType', of element 'child'.
> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.getAndCheckXsiType(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
> at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.jaxp.validation.StreamValidatorHelper.validate(Unknown Source)
> at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
> at javax.xml.validation.Validator.validate(Validator.java:127)
> at Main.main(Main.java:11)
> I believe that localComplexType is validly derived from complexType, or am I missing something? I apologize in advance if I filed this bug in error.
--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org