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 "Mukul Gandhi (JIRA)" <xe...@xml.apache.org> on 2010/04/15 05:49:48 UTC

[jira] Commented: (XERCESJ-1437) XML Schema 1.1: anyAtomicType cannot be used as the base of built in simpleType.

    [ https://issues.apache.org/jira/browse/XERCESJ-1437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857187#action_12857187 ] 

Mukul Gandhi commented on XERCESJ-1437:
---------------------------------------

I think, these patches will have useful addition to the implementation.

I propose to have these little changes to the patches:

a) XSDComplexTypeTraverser.java

if ((XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespace()) &&
("anyAtomicType".equals(type.getName()) || "anySimpleType".equals(type.getName())))
&&
(fDerivedBy == XSConstants.DERIVATION_RESTRICTION)) {
  throw new ComplexTypeRecoverableError ...
} 


b) XSDSimpleTypeTraverser.java

if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(baseTypeStr.uri) &&
"anyAtomicType".equals(baseTypeStr.localpart)) {
  reportSchemaError ...
}

The above proposed changes, indicate that:
a) We need to consider also the namespace of the type, while checking this
b) We also need to do this, for anySimpleType as well (for, XSDComplexTypeTraverser)

Please evaluate these suggestions, while reviewing this issue.

Regards,
Mukul



> XML Schema 1.1: anyAtomicType cannot be used as the base of built in simpleType.
> --------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1437
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1437
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.9.1
>            Reporter: Kun Xu
>            Assignee: Khaled Noaman
>            Priority: Minor
>         Attachments: XSDComplexTypeTraverser_patch.txt, XSDSimpleTypeTraverser_patch.txt
>
>
> Failed to check that anyAtomicType cannot be used as the base of built in simpleType.
> Example:
> XSD:
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> 	targetNamespace="http://www.schemaTest.org/schema11"
> 	xmlns:sv="http://www.schemaTest.org/schema11">
> 	
> <simpleType name="strType">
> 	<restriction base="anyAtomicType"/>
> </simpleType>
> <element name="root">
> 	<complexType>
> 		<sequence>
> 			<element name="elAnySimpleType" type="sv:strType"/>
> 		</sequence>
> 	</complexType>
> </element>    
> </schema> 
> XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <dv:root xmlns:dv="http://www.schemaTest.org/schema11"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://www.schemaTest.org/schema11
> 	test_anyAtomicType.xsd">
> 	
> 	<elAnySimpleType>Test</elAnySimpleType>
> </dv:root>
> Suggestion:
> Add condition when we verify the base type.  Please verify the attached patch. Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org