xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From knoa...@apache.org
Subject svn commit: r695518 [2/2] - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/msg/ impl/xs/ impl/xs/traversers/ xs/
Date Mon, 15 Sep 2008 16:00:38 GMT
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=695518&r1=695517&r2=695518&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Mon Sep 15 09:00:36 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.xerces.impl.xs.traversers;
 
+import org.apache.xerces.impl.Constants;
 import org.apache.xerces.impl.dv.InvalidDatatypeFacetException;
 import org.apache.xerces.impl.dv.SchemaDVFactory;
 import org.apache.xerces.impl.dv.XSFacets;
@@ -29,6 +30,7 @@
 import org.apache.xerces.impl.xs.XSComplexTypeDecl;
 import org.apache.xerces.impl.xs.XSConstraints;
 import org.apache.xerces.impl.xs.XSModelGroupImpl;
+import org.apache.xerces.impl.xs.XSOpenContentDecl;
 import org.apache.xerces.impl.xs.XSParticleDecl;
 import org.apache.xerces.impl.xs.XSWildcardDecl;
 import org.apache.xerces.impl.xs.util.XInt;
@@ -65,7 +67,7 @@
 class  XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
     
     // size of stack to hold globals:
-    private final static int GLOBAL_NUM = 11;
+    private final static int GLOBAL_NUM = 12;
     
     // globals for building XSComplexTypeDecls
     private String fName = null;
@@ -81,6 +83,7 @@
     private boolean fIsAbstract = false;
     private XSComplexTypeDecl fComplexTypeDecl = null;
     private XSAnnotationImpl [] fAnnotations = null;
+    private XSOpenContentDecl fOpenContent = null;
     
     private XSParticleDecl fEmptyParticle = null;
     
@@ -173,8 +176,74 @@
         
         return type;
     }
-    
-    
+
+    XSOpenContentDecl traverseOpenContent(Element elmNode,
+            XSDocumentInfo schemaDoc,
+            SchemaGrammar grammar,
+            boolean isDefault) {
+
+        // General Attribute Checking for elmNode
+        Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
+
+        // Create open content declaration
+        XSOpenContentDecl ocDecl = new XSOpenContentDecl();
+
+        // get attribute values
+        final XInt modeAttr = (XInt) attrValues[XSAttributeChecker.ATTIDX_MODE];
+        final short ocMode = modeAttr.shortValue();
+        
+        if (isDefault) {
+        	final Boolean appliesToEmptyAttr = ((Boolean) attrValues[XSAttributeChecker.ATTIDX_APPLIESTOEMPTY]);
+        	ocDecl.fAppliesToEmpty = appliesToEmptyAttr.booleanValue();
+        }
+        ocDecl.fMode = ocMode;
+
+        // ---------------------------------------------------------------
+        // First, handle any ANNOTATION declaration and get next child
+        // ---------------------------------------------------------------
+        Element child = DOMUtil.getFirstChildElement(elmNode);
+        if (child != null) {
+            if (DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
+                addAnnotation(traverseAnnotationDecl(child, attrValues, false, schemaDoc));
+                child = DOMUtil.getNextSiblingElement(child);
+            }
+            else {
+                String text = DOMUtil.getSyntheticAnnotation(elmNode);
+                if (text != null) {
+                    addAnnotation(traverseSyntheticAnnotation(elmNode, text, attrValues,
false, schemaDoc));
+                }
+            }
+            if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION))
{
+                reportSchemaError("s4s-elt-invalid-content.1",
+                        new Object[]{SchemaSymbols.ELT_OPENCONTENT,SchemaSymbols.ELT_ANNOTATION},
child);
+            }
+        }
+        else {
+            String text = DOMUtil.getSyntheticAnnotation(elmNode);
+            if (text != null) {
+                addAnnotation(traverseSyntheticAnnotation(elmNode, text, attrValues, false,
schemaDoc));
+            }
+        }
+
+        // ---------------------------------------------------------------
+        // Process the wildcard
+        // ---------------------------------------------------------------
+        if (child == null) {
+            if (ocMode != XSOpenContentDecl.MODE_NONE) {
+                reportSchemaError("src-ct.6", new Object[]{fName}, elmNode);
+            }
+        }
+        else {
+            Object[] wcAttrValues = fAttrChecker.checkAttributes(child, false, schemaDoc);
+            ocDecl.fWildcard = fSchemaHandler.fWildCardTraverser.traverseWildcardDecl(child,
wcAttrValues, schemaDoc, grammar);
+            fAttrChecker.returnAttrArray(wcAttrValues, schemaDoc);
+        }
+
+        fAttrChecker.returnAttrArray(attrValues, schemaDoc);
+
+        return ocDecl;
+    }
+
     private XSComplexTypeDecl traverseComplexTypeDecl(Element complexTypeDecl,
             String complexTypeName,
             Object[] attrValues,
@@ -200,6 +269,7 @@
         
         fIsAbstract = (abstractAtt != null && abstractAtt.booleanValue());
         fAnnotations = null;
+        fOpenContent = null;
         
         Element child = null;
         
@@ -297,7 +367,7 @@
         fComplexTypeDecl.setValues(fName, fTargetNamespace, fBaseType,
                 fDerivedBy, fFinal, fBlock, fContentType, fIsAbstract,
                 fAttrGrp, fXSSimpleType, fParticle, new XSObjectListImpl(fAnnotations, 
-                        fAnnotations == null? 0 : fAnnotations.length));
+                        fAnnotations == null? 0 : fAnnotations.length), fOpenContent);
         return fComplexTypeDecl;
     }
     
@@ -634,12 +704,10 @@
             boolean mixedOnType, XSDocumentInfo schemaDoc,
             SchemaGrammar grammar)
     throws ComplexTypeRecoverableError {
-        
-        
+
         Object[] complexContentAttrValues = fAttrChecker.checkAttributes(complexContentElement,
false,
                 schemaDoc);
-        
-        
+
         // -----------------------------------------------------------------------
         // Determine if this is mixed content
         // -----------------------------------------------------------------------
@@ -647,15 +715,14 @@
         Boolean mixedAtt     = (Boolean) complexContentAttrValues[XSAttributeChecker.ATTIDX_MIXED];
         if (mixedAtt != null) {
             mixedContent = mixedAtt.booleanValue();
-        }
-        
-        
+        }        
+
         // -----------------------------------------------------------------------
         // Since the type must have complex content, set the simple type validators
         // to null
         // -----------------------------------------------------------------------
         fXSSimpleType = null;
-        
+
         Element complexContent = DOMUtil.getFirstChildElement(complexContentElement);
         if (complexContent != null && DOMUtil.getLocalName(complexContent).equals(SchemaSymbols.ELT_ANNOTATION))
{
             addAnnotation(traverseAnnotationDecl(complexContent, complexContentAttrValues,
false, schemaDoc));
@@ -667,7 +734,7 @@
                 addAnnotation(traverseSyntheticAnnotation(complexContentElement, text, complexContentAttrValues,
false, schemaDoc));
             }
         }
-        
+
         // If there are no children, return
         if (complexContent==null) {
             fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
@@ -675,7 +742,7 @@
                     new Object[]{fName,SchemaSymbols.ELT_COMPLEXCONTENT},
                     complexContentElement);
         }
-        
+
         // -----------------------------------------------------------------------
         // The content should be either "restriction" or "extension"
         // -----------------------------------------------------------------------
@@ -696,12 +763,11 @@
             throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
                     new Object[]{fName, siblingName}, elemTmp);
         }
-        
+
         Object[] derivationTypeAttrValues = fAttrChecker.checkAttributes(complexContent,
false,
                 schemaDoc);
         QName baseTypeName = (QName)  derivationTypeAttrValues[XSAttributeChecker.ATTIDX_BASE];
-        
-        
+
         // -----------------------------------------------------------------------
         // Need a base type.  Check that it's a complex type
         // -----------------------------------------------------------------------
@@ -711,18 +777,18 @@
             throw new ComplexTypeRecoverableError("s4s-att-must-appear",
                     new Object[]{complexContentName, "base"}, complexContent);
         }
-        
+
         XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
                 XSDHandler.TYPEDECL_TYPE,
                 baseTypeName,
                 complexContent);
-        
+
         if (type==null) {
             fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
             fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
             throw new ComplexTypeRecoverableError();
         }
-        
+
         if (! (type instanceof XSComplexTypeDecl)) {
             fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
             fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
@@ -731,7 +797,7 @@
         }
         XSComplexTypeDecl baseType = (XSComplexTypeDecl)type;
         fBaseType = baseType;
-        
+
         // -----------------------------------------------------------------------
         // Check that the base permits the derivation
         // -----------------------------------------------------------------------
@@ -743,12 +809,12 @@
             throw new ComplexTypeRecoverableError(errorKey,
                     new Object[]{fName, fBaseType.getName()}, complexContent);
         }
-        
+
         // -----------------------------------------------------------------------
         // Skip over any potential annotations
         // -----------------------------------------------------------------------
         complexContent = DOMUtil.getFirstChildElement(complexContent);
-        
+
         if (complexContent != null) {
             // traverse annotation if any
             if (DOMUtil.getLocalName(complexContent).equals(SchemaSymbols.ELT_ANNOTATION))
{
@@ -787,20 +853,21 @@
             fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
             throw e;
         }
-        
+
         // -----------------------------------------------------------------------
         // Compose the final content and attribute uses
         // -----------------------------------------------------------------------
         XSParticleDecl baseContent = (XSParticleDecl)baseType.getParticle();
+        // XML Schema 1.1
+        XSOpenContentDecl explicitOpenContent = null;
+
         if (fDerivedBy==XSConstants.DERIVATION_RESTRICTION) {
-            
+
             // This is an RESTRICTION
-            
+
             // N.B. derivation-ok-restriction.5.3 is checked under schema
             // full checking.   That's because we need to wait until locals are
             // traversed so that occurrence information is correct.
-            
-            
             if (fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED &&
                     baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_MIXED) {
                 fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
@@ -809,7 +876,7 @@
                         new Object[]{fName, baseType.getName()},
                         complexContent);
             }
-            
+
             try {
                 mergeAttributes(baseType.getAttrGrp(), fAttrGrp, fName, false, complexContent);
             } catch (ComplexTypeRecoverableError e) {
@@ -819,7 +886,7 @@
             }
             // Remove prohibited uses.   Must be done after merge for RESTRICTION.
             fAttrGrp.removeProhibitedAttrs();
-            
+
             if (baseType != SchemaGrammar.fAnyType) {
                 Object[] errArgs = fAttrGrp.validRestrictionOf(fName, baseType.getAttrGrp());
                 if (errArgs != null) {
@@ -839,6 +906,9 @@
                 fContentType = baseType.getContentType();
                 fXSSimpleType = (XSSimpleType)baseType.getSimpleType();
                 fParticle = baseContent;
+                if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                    explicitOpenContent = (XSOpenContentDecl) baseType.getOpenContent();
+                }
             }
             else if (baseType.getContentType() == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
             }
@@ -886,6 +956,9 @@
                 particle.fAnnotations = XSObjectListImpl.EMPTY_LIST; 
                 
                 fParticle = particle;
+                if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                    explicitOpenContent = (XSOpenContentDecl) baseType.getOpenContent();
+                }
             }
             
             // Remove prohibited uses.   Must be done before merge for EXTENSION.
@@ -897,16 +970,108 @@
                 fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
                 throw e;
             }
-            
         }
-        
+
+        //------------------------------------------------------------------------
+        // XML Schema 1.1
+        // Applies open content, if present
+        //------------------------------------------------------------------------
+        if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+            XSOpenContentDecl baseOpenContent = (XSOpenContentDecl) baseType.getOpenContent();
+
+            // Let the wildcard element be  the appropriate case among the following:
+            //    5.1 If the <openContent> [child] is present , then the <openContent>
[child].
+            //    5.2 If the <openContent> [child] is not present, the <schema>
ancestor has an <defaultOpenContent> [child], and one of the following is true
+            //      5.2.1 the {variety} of the explicit content type is not empty
+            //      5.2.2 the {variety} of the explicit content type is empty and the actual
value of the appliesToEmpty [attribute] is true
+            //      , then the <defaultOpenContent> [child] of the <schema>.
+            //    5.3 otherwise absent.
+            if (fOpenContent == null) {
+                if (schemaDoc.fDefaultOpenContent != null) {
+                    if (fContentType != XSComplexTypeDecl.CONTENTTYPE_EMPTY || schemaDoc.fDefaultOpenContent.fAppliesToEmpty)
{
+                        fOpenContent = schemaDoc.fDefaultOpenContent;
+                    }
+                }
+            }
+
+            // If the wildcard element is not absent
+            if (fOpenContent != null) {
+                // 6.2 If the actual value of its mode [attribute] is 'none', then an absent
{open content}
+                if (fOpenContent.fMode == XSOpenContentDecl.MODE_NONE) {
+                    fOpenContent = null;
+                }
+                // 6.3 If the {variety} is empty, then a Particle as follows:
+                //   {min occurs} 1
+                //   {max occurs} 1
+                //   {term}       a model group whose {compositor} is sequence and whose
{particles} is empty.
+                else if (fContentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
+                    if (fEmptyParticle == null) {
+                        XSModelGroupImpl group = new XSModelGroupImpl();
+                        group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
+                        group.fParticleCount = 0;
+                        group.fParticles = null;
+                        group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
+                        fEmptyParticle = new XSParticleDecl();
+                        fEmptyParticle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
+                        fEmptyParticle.fValue = group;
+                        fEmptyParticle.fAnnotations = XSObjectListImpl.EMPTY_LIST;
+                    }
+                    fParticle = fEmptyParticle;
+                    fContentType = XSComplexTypeDecl.CONTENTTYPE_ELEMENT;
+                }
+            }
+            // 6.1 If the wildcard element is absent, then the explicit open content.
+            else {
+                fOpenContent = explicitOpenContent;
+            }
+
+            if (fDerivedBy == XSConstants.DERIVATION_EXTENSION && baseType.getContentType()
!= XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
+
+            	// 1.4.3.2.2.3  One or more of the following is true:
+                //    1.4.3.2.2.3.1 B.{content type}.{open content} (call it BOT) is absent.
+                //    1.4.3.2.2.3.2 T.{content type}.{open content} (call it EOT) has {mode}
interleave.
+                //    1.4.3.2.2.3.3 Both BOT and EOT have {mode} suffix.
+                //    1.4.3.2.2.4 If neither BOT nor EOT is absent, then BOT.{wildcard}.{namespace
constraint} is a subset
+                //                of EOT.{wildcard}.{namespace constraint}, as defined by
Wildcard Subset (3.10.6.2).
+
+                if (baseOpenContent != null && fOpenContent != baseOpenContent) {
+                    // {open content} had a mode of 'none'
+                    if (fOpenContent == null) {
+                    	fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
+                        fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
+                    	throw new ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.3",
+                                new Object[]{fName}, complexContent);
+                    }
+                    else {
+                    	// 1.4.3.2.2.3.2
+                    	// 1.4.3.2.2.3.3
+                        if (fOpenContent.fMode == XSOpenContentDecl.MODE_SUFFIX) {
+                            if (baseOpenContent.fMode != XSOpenContentDecl.MODE_SUFFIX) {
+                            	fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
+                                fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
+                            	throw new ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.3.3",
+                                        new Object[]{fName}, complexContent);
+                            }
+                        }
+
+                        // 1.4.3.2.2.4
+                        if (!baseOpenContent.fWildcard.isSubsetOf(fOpenContent.fWildcard))
{
+                        	fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
+                            fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
+                        	throw new ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.3.4",
+                                    new Object[]{fName}, complexContent);
+                        }
+                    }
+                }
+            }
+        } // end of fSchema11Support
+
         // and *finally* we can legitimately return the attributes!
         fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
         fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
         
     } // end of traverseComplexContent
     
-    
     // This method merges attribute uses from the base, into the derived set.
     // The first duplicate attribute, if any, is returned.
     // LM: may want to merge with attributeGroup processing.
@@ -971,13 +1136,20 @@
         boolean emptyParticle = false;
         if (complexContentChild != null) {
             // -------------------------------------------------------------
-            // GROUP, ALL, SEQUENCE or CHOICE, followed by attributes, if specified.
+            // OPENCONTENT?, followed by GROUP, ALL, SEQUENCE or CHOICE, 
+            //   followed by attributes, if specified, followed by
+            //   assertions if specified.
             // Note that it's possible that only attributes are specified.
             // -------------------------------------------------------------
-            
-            
             String childName = DOMUtil.getLocalName(complexContentChild);
-            
+
+            // XML Schema 1.1
+            if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1 &&
childName.equals(SchemaSymbols.ELT_OPENCONTENT)) {
+                fOpenContent = traverseOpenContent(complexContentChild, schemaDoc, grammar,
false);
+                complexContentChild = DOMUtil.getNextSiblingElement(complexContentChild);
+                childName = DOMUtil.getLocalName(complexContentChild);
+            }
+
             if (childName.equals(SchemaSymbols.ELT_GROUP)) {
                 
                 particle = fSchemaHandler.fGroupTraverser.traverseLocal(complexContentChild,
@@ -1199,9 +1371,11 @@
         fGlobalStore[fGlobalStorePos++] = fParticle;
         fGlobalStore[fGlobalStorePos++] = fXSSimpleType;
         fGlobalStore[fGlobalStorePos++] = fAnnotations;
+        fGlobalStore[fGlobalStorePos++] = fOpenContent;
     }
     
     private void contentRestore() {
+        fOpenContent = (XSOpenContentDecl)fGlobalStore[--fGlobalStorePos];
         fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
         fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
         fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=695518&r1=695517&r2=695518&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Mon Sep 15 09:00:36 2008
@@ -45,6 +45,7 @@
 import org.apache.xerces.impl.xs.XSGroupDecl;
 import org.apache.xerces.impl.xs.XSMessageFormatter;
 import org.apache.xerces.impl.xs.XSModelGroupImpl;
+import org.apache.xerces.impl.xs.XSOpenContentDecl;
 import org.apache.xerces.impl.xs.XSParticleDecl;
 import org.apache.xerces.impl.xs.opti.ElementImpl;
 import org.apache.xerces.impl.xs.opti.SchemaDOMParser;
@@ -1194,14 +1195,25 @@
                     //DOMUtil.setHidden(globalComp);
                 }
                 else {
-                    dependenciesCanOccur = false;
                     String lName = DOMUtil.getAttrValue(globalComp, SchemaSymbols.ATT_NAME);
+                    String componentType = DOMUtil.getLocalName(globalComp);
+
+                    // In XML Schema 1.1, a defaultOpenContent element may occur
+                    if (componentType.equals(SchemaSymbols.ELT_DEFAULTOPENCONTENT)) {
+                        if (fSchemaVersion < Constants.SCHEMA_VERSION_1_1 || !dependenciesCanOccur)
{
+                            reportSchemaError("s4s-elt-invalid-content.3", new Object []
{componentType}, globalComp);
+                        }
+                        // skip it; traverse it later
+                        dependenciesCanOccur = false;
+                        continue;
+                    }
+                    
+                    dependenciesCanOccur = false;
                     if (lName.length() == 0) // an error we'll catch later
                         continue;
                     String qName = currSchemaDoc.fTargetNamespace == null?
                             ","+lName:
                                 currSchemaDoc.fTargetNamespace +","+lName;
-                    String componentType = DOMUtil.getLocalName(globalComp);
                     if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
                         checkForDuplicateNames(qName, fUnparsedAttributeRegistry, fUnparsedAttributeRegistrySub,
globalComp, currSchemaDoc);
                     }
@@ -1331,6 +1343,9 @@
                     currSG.addAnnotation(fElementTraverser.traverseAnnotationDecl(globalComp,
currSchemaDoc.getSchemaAttrs(), true, currSchemaDoc));
                     sawAnnotation = true;
                 }
+                else if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1 && componentType.equals(SchemaSymbols.ELT_DEFAULTOPENCONTENT))
{
+                    currSchemaDoc.fDefaultOpenContent = fComplexTypeTraverser.traverseOpenContent(globalComp,
currSchemaDoc, currSG, true);
+                }
                 else {
                     reportSchemaError("s4s-elt-invalid-content.1", new Object [] {SchemaSymbols.ELT_SCHEMA,
DOMUtil.getLocalName(globalComp)}, globalComp);
                 }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java?rev=695518&r1=695517&r2=695518&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
Mon Sep 15 09:00:36 2008
@@ -24,6 +24,7 @@
 import org.apache.xerces.impl.xs.SchemaNamespaceSupport;
 import org.apache.xerces.impl.xs.SchemaSymbols;
 import org.apache.xerces.impl.xs.XMLSchemaException;
+import org.apache.xerces.impl.xs.XSOpenContentDecl;
 import org.apache.xerces.impl.xs.util.XInt;
 import org.apache.xerces.util.SymbolTable;
 import org.w3c.dom.Element;
@@ -84,6 +85,9 @@
     // once removeAnnotations has been called.
     protected XSAnnotationInfo fAnnotations = null;
 
+    // defaultOpenContent
+    XSOpenContentDecl fDefaultOpenContent = null;
+
     // note that the caller must ensure to call returnSchemaAttrs()
     // to avoid memory leaks!
     XSDocumentInfo (Element schemaRoot, XSAttributeChecker attrChecker, SymbolTable symbolTable)

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSComplexTypeDefinition.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSComplexTypeDefinition.java?rev=695518&r1=695517&r2=695518&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSComplexTypeDefinition.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSComplexTypeDefinition.java
Mon Sep 15 09:00:36 2008
@@ -110,4 +110,9 @@
      */
     public XSObjectList getAnnotations();
 
+    /**
+     * An open content
+     */
+    public XSOpenContent getOpenContent();
+
 }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSConstants.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSConstants.java?rev=695518&r1=695517&r2=695518&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSConstants.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSConstants.java Mon
Sep 15 09:00:36 2008
@@ -90,6 +90,11 @@
      */
     public static final short ASSERTION                 = 16;
 
+    /**
+     * The object describes an openContent
+     */
+    public static final short OPEN_CONTENT              = 17;
+
     // Derivation constants
     /**
      * No constraint is available.

Added: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java?rev=695518&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java (added)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java Mon
Sep 15 09:00:36 2008
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.xerces.xs;
+
+/**
+ * This interface represents an openContent.
+ * 
+ * @author Khaled Noaman, IBM
+ * @version $Id$
+ */
+public interface XSOpenContent extends XSObject {
+
+	/**
+     * Mode type
+     */
+    public static final short MODE_NONE       = 0;
+    public static final short MODE_INTERLEAVE = 1;
+    public static final short MODE_SUFFIX     = 2;
+
+    /**
+     * A mode type: none, interleave, suffix. 
+     */
+    public short getModeType();
+
+    /**
+     * A wildcard declaration
+     */
+    public XSWildcard getWildcard();
+    
+    /**
+     * A flag that indicates whether a default open content is applied
+     * when the content type of a complex type declaration is empty
+     */
+    // TODO: do we have two different implementations (i.e. XSOenContentDecl and XSDefaultOpenContentDecl)
+    //       and add that method only to XSDefaultOpenContentDecl
+    public boolean appliesToEmpty();
+
+}

Propchange: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSOpenContent.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



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


Mime
View raw message