Author: knoaman
Date: Mon Dec  5 21:32:06 2011
New Revision: 1210648

URL: http://svn.apache.org/viewvc?rev=1210648&view=rev
Log:
If fixed and use are both present, use must not have the actual value prohibited

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1210648&r1=1210647&r2=1210648&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
 Mon Dec  5 21:32:06 2011
@@ -123,6 +123,7 @@
         src-attribute.3.1 = src-attribute.3.1: One of 'ref' or 'name' must be 
present in a local attribute declaration.
         src-attribute.3.2 = src-attribute.3.2: The content must match 
(annotation?) for the attribute reference ''{0}''.
         src-attribute.4 = src-attribute.4: Attribute ''{0}'' has both a 
''type'' attribute and an anonymous ''simpleType'' child. Only one of these is 
allowed for an attribute.
+        src-attribute.5 = src-attribute.5: The property ''fixed'' is present 
in attribute ''{0}'', so the value of ''use'' must not be ''prohibited''.
         src-attribute.6.2 = src-attribute.6.2: Since attribute ''{0}'' 
contains the 'targetNamespace' attribute, the 'form' attribute must be absent.
         src-attribute.6.3.1 = src-attribute.6.3.1: Since attribute ''{0}'' 
contains the 'targetNamespace' attribute and <schema> does not have a 
'targetNamespace' attribute or its value is different from the value of 
'targetNamespace' of ''{0}'', ''{0}'' must have a <complexType> as an ancestor.
         src-attribute.6.3.2 = src-attribute.6.3.2: Since attribute ''{0}'' 
contains the 'targetNamespace' attribute and <schema> does not have a 
'targetNamespace' attribute or its value is different from the value of 
'targetNamespace' of ''{0}'', there must be a <restriction> ancestor between 
''{0}'' and the nearest <complexType> ancestor, and the value of the 'base' 
attribute of <restriction> does not match the name of 'xs:anyType'.  

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java?rev=1210648&r1=1210647&r2=1210648&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
 Mon Dec  5 21:32:06 2011
@@ -177,6 +177,14 @@ class XSDAttributeTraverser extends XSDA
             attrUse.fUse = SchemaSymbols.USE_OPTIONAL;
         }
         
+        // 5 If fixed and use are both present, use must not have the actual 
value prohibited
+        if (consType == XSConstants.VC_FIXED &&
+                useAtt != null && useAtt.intValue() == 
SchemaSymbols.USE_PROHIBITED) {
+            reportSchemaError("src-attribute.5", new Object[]{nameAtt}, 
attrDecl);
+            // Recover by honouring the default value
+            attrUse.fUse = SchemaSymbols.USE_OPTIONAL;
+        }
+        
         // a-props-correct
         
         if (defaultAtt != null && attrUse != null) {



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

Reply via email to