You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2009/12/08 21:01:30 UTC

svn commit: r888552 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/dv/xs/ impl/xs/ impl/xs/traversers/ xs/

Author: knoaman
Date: Tue Dec  8 20:01:29 2009
New Revision: 888552

URL: http://svn.apache.org/viewvc?rev=888552&view=rev
Log:
Store {context} property in type definitions

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSTypeDefinition.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Tue Dec  8 20:01:29 2009
@@ -44,6 +44,7 @@
 import org.apache.xerces.xs.XSFacet;
 import org.apache.xerces.xs.XSMultiValueFacet;
 import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSObject;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
@@ -333,6 +334,9 @@
     // The namespace schema information item corresponding to the target namespace 
     // of the simple type definition, if it is globally declared; or null otherwise.
     private XSNamespaceItem fNamespaceItem = null;
+    
+    // context
+    XSObject fContext = null;
 
     // default constructor
     public XSSimpleTypeDecl(){}
@@ -3124,6 +3128,8 @@
         fAnnotations = null;
         fFacets = null;
 
+        fContext = null;
+
         // REVISIT: reset for fundamental facets
     }
     
@@ -3137,6 +3143,17 @@
     public void setNamespaceItem(XSNamespaceItem namespaceItem) {
         fNamespaceItem = namespaceItem;
     }
+    
+    /**
+     * 
+     */
+    public void setContext(XSObject context) {
+        fContext = context;
+    }
+    
+    public XSObject getContext() {
+        return fContext;
+    }
 
     /**
      * @see java.lang.Object#toString()

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java Tue Dec  8 20:01:29 2009
@@ -26,6 +26,7 @@
 import org.apache.xerces.impl.dv.XSSimpleType;
 import org.apache.xerces.xs.StringList;
 import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSObject;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
@@ -205,6 +206,10 @@
         return type.validate(content, context, validatedInfo);
     }
     
+    public XSObject getContext() {
+        return type.getContext();
+    }
+    
     public String toString() {
         return type.toString();
     }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java Tue Dec  8 20:01:29 2009
@@ -26,6 +26,7 @@
 import org.apache.xerces.xs.XSComplexTypeDefinition;
 import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSObject;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSOpenContent;
 import org.apache.xerces.xs.XSParticle;
@@ -98,6 +99,9 @@
     
     // list of assertions affiliated with this type
     XSObjectListImpl fAssertions = null;
+    
+    // context
+    XSObject fContext = null;
 
     // DOM Level 3 TypeInfo Derivation Method constants
     static final int DERIVATION_ANY = 0;
@@ -577,6 +581,7 @@
             fAssertions.clear();
         }
         fAssertions = null;
+        fContext = null;
     }
 
     /**
@@ -760,4 +765,12 @@
         return (fAssertions != null) ? fAssertions : XSObjectListImpl.EMPTY_LIST;
     }
 
+    public void setContext(XSObject context) {
+        fContext = context;
+    }
+
+    public XSObject getContext() {
+        return fContext;
+    }
+
 } // class XSComplexTypeDecl

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=888552&r1=888551&r2=888552&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 Tue Dec  8 20:01:29 2009
@@ -331,7 +331,7 @@
             String childName = DOMUtil.getLocalName(child);
             
             if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
-                attrType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar);
+                attrType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar, attribute);
                 haveAnonType = true;
                 child = DOMUtil.getNextSiblingElement(child);
             }

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=888552&r1=888551&r2=888552&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 Tue Dec  8 20:01:29 2009
@@ -42,6 +42,7 @@
 import org.apache.xerces.xs.XSAttributeUse;
 import org.apache.xerces.xs.XSComplexTypeDefinition;
 import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSObject;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSTypeDefinition;
 import org.w3c.dom.Element;
@@ -158,7 +159,8 @@
      */
     XSComplexTypeDecl traverseLocal(Element complexTypeNode,
             XSDocumentInfo schemaDoc,
-            SchemaGrammar grammar) {
+            SchemaGrammar grammar,
+            XSObject context) {
         
         
         Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
@@ -166,7 +168,7 @@
         String complexTypeName = genAnonTypeName(complexTypeNode);
         contentBackup();
         XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
-                complexTypeName, attrValues, schemaDoc, grammar);
+                complexTypeName, attrValues, schemaDoc, grammar, context);
         contentRestore();
         // need to add the type to the grammar for later constraint checking
         grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
@@ -193,7 +195,7 @@
         String complexTypeName = (String)  attrValues[XSAttributeChecker.ATTIDX_NAME];
         contentBackup();
         XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
-                complexTypeName, attrValues, schemaDoc, grammar);
+                complexTypeName, attrValues, schemaDoc, grammar, null);
         contentRestore();
         // need to add the type to the grammar for later constraint checking
         grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
@@ -202,6 +204,17 @@
             reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_COMPLEXTYPE, SchemaSymbols.ATT_NAME}, complexTypeNode);
             type = null;
         } else {
+
+            // XML Schema 1.1
+            // If parent of complex type is redefine, then we need to set the
+            // context of the redefined complex type
+            if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                Element parent = DOMUtil.getParent(complexTypeNode);
+                if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE)) {
+                    ((XSComplexTypeDecl)type.getBaseType()).setContext(type);
+                }
+            }
+            
             if (grammar.getGlobalTypeDecl(type.getName()) == null) {
                 grammar.addGlobalComplexTypeDecl(type);
             }
@@ -308,7 +321,8 @@
             String complexTypeName,
             Object[] attrValues,
             XSDocumentInfo schemaDoc,
-            SchemaGrammar grammar) {
+            SchemaGrammar grammar,
+            XSObject context) {
         
         fComplexTypeDecl = new XSComplexTypeDecl();
         fAttrGrp = new XSAttributeGroupDecl();
@@ -461,6 +475,13 @@
                 fDerivedBy, fFinal, fBlock, fContentType, fIsAbstract,
                 fAttrGrp, fXSSimpleType, fParticle, new XSObjectListImpl(fAnnotations, 
                         fAnnotations == null? 0 : fAnnotations.length), fOpenContent);
+
+        // XML Schema 1.1
+        // Store context information
+        if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+            fComplexTypeDecl.setContext(context);
+        }
+
         fComplexTypeDecl.setAssertions(fAssertions != null 
                 ? new XSObjectListImpl(fAssertions, fAssertions.length) : null);
         return fComplexTypeDecl;
@@ -656,11 +677,12 @@
             // There may be a simple type definition in the restriction element
             // The data type validator will be based on it, if specified
             // -----------------------------------------------------------------------
+            boolean needToSetContext = false;
             if (simpleContent !=null &&
                     DOMUtil.getLocalName(simpleContent).equals(SchemaSymbols.ELT_SIMPLETYPE )) {
                 
                 XSSimpleType dv = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(
-                        simpleContent, schemaDoc, grammar);
+                        simpleContent, schemaDoc, grammar, null);
                 if (dv == null) {
                     fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
                     fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
@@ -678,6 +700,12 @@
                             new Object[]{fName, dv.getName(), baseValidator.getName()},
                             simpleContent);
                 }
+                // XML Schema 1.1 - need to set context of dv
+                if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                   if (dv instanceof XSSimpleTypeDecl) {
+                       needToSetContext = true;
+                   }
+                }
                 baseValidator = dv;
                 simpleContent = DOMUtil.getNextSiblingElement(simpleContent);
             }
@@ -721,6 +749,11 @@
                 ((XSSimpleTypeDecl)fXSSimpleType).setAnonymous(true);
             }
             
+            // set context of local simple type (baseValidator)
+            if (needToSetContext) {
+                ((XSSimpleTypeDecl)baseValidator).setContext(fXSSimpleType);
+            }
+            
             // -----------------------------------------------------------------------
             // Traverse any attributes/asserts
             // -----------------------------------------------------------------------

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java Tue Dec  8 20:01:29 2009
@@ -384,12 +384,12 @@
             String childName = DOMUtil.getLocalName(child);
             
             if (childName.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
-                elementType = fSchemaHandler.fComplexTypeTraverser.traverseLocal(child, schemaDoc, grammar);
+                elementType = fSchemaHandler.fComplexTypeTraverser.traverseLocal(child, schemaDoc, grammar, element);
                 haveAnonType = true;
                 child = DOMUtil.getNextSiblingElement(child);
             }
             else if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
-                elementType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar);
+                elementType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar, element);
                 haveAnonType = true;
                 child = DOMUtil.getNextSiblingElement(child);
             }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java Tue Dec  8 20:01:29 2009
@@ -32,6 +32,7 @@
 import org.apache.xerces.util.DOMUtil;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSObject;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSTypeDefinition;
 import org.w3c.dom.Element;
@@ -108,6 +109,20 @@
         
         // don't add global components without name to the grammar
         if (type != null) {
+            
+            // XML Schema 1.1
+            // If parent is redefine, then we need to set the
+            // context of the redefined simple type
+            if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                Element parent = DOMUtil.getParent(elmNode);
+                if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE)) {
+                    final XSTypeDefinition baseType = type.getBaseType();
+                    if (baseType instanceof XSSimpleTypeDecl) {
+                        ((XSSimpleTypeDecl)baseType).setContext(type);
+                    }
+                }
+            }
+            
             if (grammar.getGlobalTypeDecl(type.getName()) == null) {
                 grammar.addGlobalSimpleTypeDecl(type);
             }
@@ -135,14 +150,18 @@
     
     XSSimpleType traverseLocal(Element elmNode,
             XSDocumentInfo schemaDoc,
-            SchemaGrammar grammar) {
+            SchemaGrammar grammar,
+            XSObject context) {
         
         // General Attribute Checking
         Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
         String name = genAnonTypeName(elmNode);
-        XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
+        XSSimpleType type = getSimpleType(name, elmNode, attrValues, schemaDoc, grammar);
         if (type instanceof XSSimpleTypeDecl) {
             ((XSSimpleTypeDecl)type).setAnonymous(true);
+            if (context != null && fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                ((XSSimpleTypeDecl)type).setContext(context);
+            }
         }
         fAttrChecker.returnAttrArray(attrValues, schemaDoc);
         
@@ -310,6 +329,11 @@
             }
         }
 
+        // XML Schema 1.1
+        //
+        // Store local simple types, so we can set the proper context on them
+        ArrayList localValidators = new ArrayList(2);
+
         // check if there is a child "simpleType"
         if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_SIMPLETYPE)) {
             if (restriction || list) {
@@ -319,7 +343,12 @@
                 }
                 if (baseValidator == null) {
                     // traverse this child to get the base type
-                    baseValidator = traverseLocal(content, schemaDoc, grammar);
+                    baseValidator = traverseLocal(content, schemaDoc, grammar, null);
+                    if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1 &&
+                            baseValidator instanceof XSSimpleTypeDecl) {
+                        localValidators.add(baseValidator);
+                    }
+                    
                 }
                 // get the next element
                 content = DOMUtil.getNextSiblingElement(content);
@@ -330,18 +359,25 @@
                 }
                 do {
                     // traverse this child to get the member type
-                    dv = traverseLocal(content, schemaDoc, grammar);
+                    dv = traverseLocal(content, schemaDoc, grammar,null);
                     if (dv != null) {
                         // if it's a union, expand it (only in XML 1.0)
-                        if (dv.getVariety() == XSSimpleType.VARIETY_UNION &&
-                                fSchemaHandler.fSchemaVersion < Constants.SCHEMA_VERSION_1_1) {
-                            dvs = dv.getMemberTypes();
-                            for (int j = 0; j < dvs.getLength(); j++) {
-                                dTValidators.add(dvs.item(j));
+                        if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
+                            dTValidators.add(dv);
+                            if (dv instanceof XSSimpleTypeDecl) {
+                                localValidators.add(dv);
                             }
-                        } 
+                        }
                         else {
-                            dTValidators.add(dv);
+                            if (dv.getVariety() == XSSimpleType.VARIETY_UNION) {
+                                dvs = dv.getMemberTypes();
+                                for (int j = 0; j < dvs.getLength(); j++) {
+                                    dTValidators.add(dvs.item(j));
+                                }
+                            }
+                            else {
+                                dTValidators.add(dv);
+                            }
                         }
                     }
                     // get the next element
@@ -408,6 +444,14 @@
                         annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
             }
         }
+        
+        // XML Schema 1.1
+        // Set context information
+        final int localValidatorsSize = localValidators.size();
+        for (int i=0; i<localValidatorsSize; i++) {
+            ((XSSimpleTypeDecl)localValidators.get(i)).setContext(newDecl);
+        }
+        
         // no element should appear after this point
         if (content != null) {
             if (restriction) {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Tue Dec  8 20:01:29 2009
@@ -116,12 +116,12 @@
             String childName = DOMUtil.getLocalName(childNode);
             XSTypeDefinition typeDef = null;
             if (childName.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
-                typeDef = fSchemaHandler.fComplexTypeTraverser.traverseLocal(childNode, schemaDoc, grammar);
+                typeDef = fSchemaHandler.fComplexTypeTraverser.traverseLocal(childNode, schemaDoc, grammar, element);
                 hasAnonType = true;
                 childNode = DOMUtil.getNextSiblingElement(childNode);
             }
             else if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
-                typeDef = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(childNode, schemaDoc, grammar);
+                typeDef = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(childNode, schemaDoc, grammar, element);
                 hasAnonType = true;
                 childNode = DOMUtil.getNextSiblingElement(childNode);
             }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSTypeDefinition.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSTypeDefinition.java?rev=888552&r1=888551&r2=888552&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSTypeDefinition.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSTypeDefinition.java Tue Dec  8 20:01:29 2009
@@ -98,5 +98,39 @@
     public boolean derivedFrom(String namespace, 
                                String name, 
                                short derivationMethod);
-
+    
+    /**
+     * A property that simplifies testing for the identity of anonymous type
+     * definitions.
+     * 
+     * For complex type definition:
+     * 1. If the name [attribute] is present (with the exception of the type being
+     *    redefined, number 2 below), then absent, otherwise the Element
+     *    Declaration corresponding to that parent information item
+     * 2. In the case of redefine, the context of the redefined complex type is the
+     *    redefining complex type definition
+     * 
+     * For simple type definition,
+     * 1. If the name [attribute] is present (with the exception of the type being
+     *    redefined, number 3 below), then absent
+     * 2. otherwise the appropriate case among the following:
+     *    2.1 If the parent element information item is attribute, then the
+     *        corresponding Attribute Declaration
+     *    2.2 If the parent element information item is element, then the
+     *        corresponding Element Declaration
+     *    2.3 If the parent element information item is list or union, then
+     *        the Simple Type Definition corresponding to the grandparent simpleType
+     *        element information item
+     *    2.4 otherwise (the parent element information item is restriction), the
+     *        appropriate case among the following:
+     *        2.4.1 If the grandparent element information item is simpleType, then
+     *              the Simple Type Definition corresponding to the grandparent
+     *        2.4.2 otherwise (the grandparent element information item is simpleContent),
+     *              the Simple Type Definition which is the {content type} of the Complex
+     *              Type Definition corresponding to the great-grandparent complexType
+     *              element information item.
+     * 3. In the case of redefine, the context of the redefined simple type is the
+     *    redefining simple type definition
+     */
+    public XSObject getContext();
 }



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