You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2007/03/14 21:27:05 UTC

svn commit: r518306 - in /xerces/java/trunk/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/traversers/XSDComplexTypeTraverser.java

Author: mrglavas
Date: Wed Mar 14 13:27:04 2007
New Revision: 518306

URL: http://svn.apache.org/viewvc?view=rev&rev=518306
Log:
Fixing JIRA Bug #1239:
http://issues.apache.org/jira/browse/XERCESJ-1239

If the union of two attribute wildcards is not expressible an error should be reported.
Note that XML Schema 1.0 2nd edition doesn't actually specify this constraint. It's a bug [1]
in the spec which will eventually be fixed. At the moment we're just guessing what the error 
code will be. If it turns out to be something else we'll need to change it.

[1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=4390

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
    xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?view=diff&rev=518306&r1=518305&r2=518306
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Wed Mar 14 13:27:04 2007
@@ -96,7 +96,8 @@
         src-ct.1 = src-ct.1: Complex Type Definition Representation Error for type ''{0}''.  When <complexContent> is used, the base type must be a complexType. ''{1}'' is a simpleType.
         src-ct.2.1 = src-ct.2.1: Complex Type Definition Representation Error for type ''{0}''.  When <simpleContent> is used, the base type must be a complexType whose content type is simple, or, only if restriction is specified, a complex type with mixed content and emptiable particle, or, only if extension is specified, a simple type. ''{1}'' satisfies none of these conditions.
         src-ct.2.2 = src-ct.2.2: Complex Type Definition Representation Error for type ''{0}''.  When a complexType with simpleContent restricts a complexType with mixed content and emptiable particle, then there must be a <simpleType> among the children of <restriction>.
-        src-ct.4 = src-ct.4: Complex Type Definition Representation Error for type ''{0}''.  The intersection of wildcards is not expressible.
+        src-ct.4 = src-ct.4: Complex Type Definition Representation Error for type ''{0}''. The intersection of wildcards is not expressible.
+        src-ct.5 = src-ct.5: Complex Type Definition Representation Error for type ''{0}''. The union of wildcards is not expressible.
         src-element.1 = src-element.1: The properties ''default'' and ''fixed'' cannot both be present in element declaration ''{0}''. Use only one of them.
         src-element.2.1 = src-element.2.1: : One of 'ref' or 'name' must be present in a local element declaration.
         src-element.2.2 = src-element.2.2: Since ''{0}'' contains the ''ref'' attribute, its content must match (annotation?). However, ''{1}'' was found.

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?view=diff&rev=518306&r1=518305&r2=518306
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Wed Mar 14 13:27:04 2007
@@ -941,6 +941,12 @@
             }
             else if (fromAttrGrp.fAttributeWC != null) {
                 toAttrGrp.fAttributeWC = toAttrGrp.fAttributeWC.performUnionWith(fromAttrGrp.fAttributeWC, toAttrGrp.fAttributeWC.fProcessContents);
+                if (toAttrGrp.fAttributeWC == null) {
+                    // REVISIT: XML Schema 1.0 2nd edition doesn't actually specify this constraint. It's a bug in the spec
+                    // which will eventually be fixed. We're just guessing what the error code will be. If it turns out to be
+                    // something else we'll need to change it. -- mrglavas
+                    throw new ComplexTypeRecoverableError("src-ct.5", new Object[]{typeName}, elem);
+                }
             }
             
         }



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