You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2010/10/19 00:06:36 UTC

svn commit: r1024038 - in /xerces/java/trunk/src/org/apache/xerces: dom/ impl/dv/ impl/dv/util/ impl/dv/xs/ impl/xs/ xs/ xs/datatypes/

Author: sandygao
Date: Mon Oct 18 22:06:35 2010
New Revision: 1024038

URL: http://svn.apache.org/viewvc?rev=1024038&view=rev
Log:
For Jira issue https://issues.apache.org/jira/browse/XERCESJ-1469. Update XSModel interfaces to a) expose an interface for values, and b) expose Identity Constraint definitions as top-level components.

Modified:
    xerces/java/trunk/src/org/apache/xerces/dom/PSVIAttrNSImpl.java
    xerces/java/trunk/src/org/apache/xerces/dom/PSVIElementNSImpl.java
    xerces/java/trunk/src/org/apache/xerces/impl/dv/ValidatedInfo.java
    xerces/java/trunk/src/org/apache/xerces/impl/dv/util/ByteListImpl.java
    xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
    xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/AttributePSVImpl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/SchemaGrammar.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSModelImpl.java
    xerces/java/trunk/src/org/apache/xerces/xs/ItemPSVI.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeDeclaration.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeUse.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSElementDeclaration.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSFacet.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSModel.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSMultiValueFacet.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSNamespaceItem.java
    xerces/java/trunk/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java
    xerces/java/trunk/src/org/apache/xerces/xs/datatypes/ByteList.java

Modified: xerces/java/trunk/src/org/apache/xerces/dom/PSVIAttrNSImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/PSVIAttrNSImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/PSVIAttrNSImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/PSVIAttrNSImpl.java Mon Oct 18 22:06:35 2010
@@ -22,14 +22,15 @@ import java.io.NotSerializableException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.xs.util.StringListImpl;
 import org.apache.xerces.xs.AttributePSVI;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.StringList;
 import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * Attribute namespace implementation; stores PSVI attribute items.
@@ -71,20 +72,8 @@ public class PSVIAttrNSImpl extends Attr
      * value in the original document, this is true; otherwise, it is false  */
     protected boolean fSpecified = true;
 
-    /** schema normalized value property */
-    protected String fNormalizedValue = null;
-    
-    /** schema actual value */
-    protected Object fActualValue = null;
-
-    /** schema actual value type */
-    protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
-    /** actual value types if the value is a list */
-    protected ShortList fItemValueTypes = null;
-
-    /** member type definition against which attribute was validated */
-    protected XSSimpleTypeDefinition fMemberType = null;
+    /** Schema value */
+    protected ValidatedInfo fValue = new ValidatedInfo();
 
     /** validation attempted: none, partial, full */
     protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE;
@@ -123,7 +112,7 @@ public class PSVIAttrNSImpl extends Attr
      * @return the normalized value of this item after validation
      */
     public String getSchemaNormalizedValue() {
-        return fNormalizedValue;
+        return fValue.getNormalizedValue();
     }
 
     /**
@@ -207,7 +196,7 @@ public class PSVIAttrNSImpl extends Attr
      * @return  a simple type declaration
      */
     public XSSimpleTypeDefinition getMemberTypeDefinition() {
-        return fMemberType;
+        return fValue.getMemberTypeDefinition();
     }
 
     /**
@@ -232,12 +221,8 @@ public class PSVIAttrNSImpl extends Attr
         this.fValidationAttempted = attr.getValidationAttempted();
         this.fErrorCodes = attr.getErrorCodes();
         this.fErrorMessages = attr.getErrorMessages();
-        this.fNormalizedValue = attr.getSchemaNormalizedValue();
-        this.fActualValue = attr.getActualNormalizedValue();
-        this.fActualValueType = attr.getActualNormalizedValueType();
-        this.fItemValueTypes = attr.getItemValueTypes();
+        this.fValue.copyFrom(attr.getSchemaValue());
         this.fTypeDecl = attr.getTypeDefinition();
-        this.fMemberType = attr.getMemberTypeDefinition();
         this.fSpecified = attr.getIsSchemaSpecified();
     }
     
@@ -245,21 +230,28 @@ public class PSVIAttrNSImpl extends Attr
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue()
      */
     public Object getActualNormalizedValue() {
-        return this.fActualValue;
+        return fValue.getActualValue();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType()
      */
     public short getActualNormalizedValueType() {
-        return this.fActualValueType;
+        return fValue.getActualValueType();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes()
      */
     public ShortList getItemValueTypes() {
-        return this.fItemValueTypes;
+        return fValue.getListValueTypes();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue()
+     */
+    public XSValue getSchemaValue() {
+        return fValue;
     }
     
     // REVISIT: Forbid serialization of PSVI DOM until

Modified: xerces/java/trunk/src/org/apache/xerces/dom/PSVIElementNSImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/PSVIElementNSImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/PSVIElementNSImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/PSVIElementNSImpl.java Mon Oct 18 22:06:35 2010
@@ -22,16 +22,18 @@ import java.io.NotSerializableException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.xs.util.StringListImpl;
 import org.apache.xerces.xs.ElementPSVI;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
 import org.apache.xerces.xs.XSElementDeclaration;
 import org.apache.xerces.xs.XSModel;
 import org.apache.xerces.xs.XSNotationDeclaration;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * Element namespace implementation; stores PSVI element items.
@@ -78,24 +80,12 @@ public class PSVIElementNSImpl extends E
      */
     protected boolean fSpecified = true;
 
-    /** schema normalized value property */
-    protected String fNormalizedValue = null;
-
-    /** schema actual value */
-    protected Object fActualValue = null;
-
-    /** schema actual value type */
-    protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
-    /** actual value types if the value is a list */
-    protected ShortList fItemValueTypes = null;
+    /** Schema value */
+    protected ValidatedInfo fValue = new ValidatedInfo();
 
     /** http://www.w3.org/TR/xmlschema-1/#e-notation*/
     protected XSNotationDeclaration fNotation = null;
 
-    /** member type definition against which element was validated */
-    protected XSSimpleTypeDefinition fMemberType = null;
-
     /** validation attempted: none, partial, full */
     protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE;
 
@@ -136,7 +126,7 @@ public class PSVIElementNSImpl extends E
      * @return the normalized value of this item after validation
      */
     public String getSchemaNormalizedValue() {
-        return fNormalizedValue;
+        return fValue.getNormalizedValue();
     }
 
     /**
@@ -237,7 +227,7 @@ public class PSVIElementNSImpl extends E
      * @return  a simple type declaration
      */
     public XSSimpleTypeDefinition getMemberTypeDefinition() {
-        return fMemberType;
+        return fValue.getMemberTypeDefinition();
     }
 
     /**
@@ -275,11 +265,14 @@ public class PSVIElementNSImpl extends E
         this.fValidationAttempted = elem.getValidationAttempted();
         this.fErrorCodes = elem.getErrorCodes();
         this.fErrorMessages = elem.getErrorMessages();
-        this.fNormalizedValue = elem.getSchemaNormalizedValue();
-        this.fActualValue = elem.getActualNormalizedValue();
-        this.fActualValueType = elem.getActualNormalizedValueType();
-        this.fItemValueTypes = elem.getItemValueTypes();
-        this.fMemberType = elem.getMemberTypeDefinition();
+        if (fTypeDecl instanceof XSSimpleTypeDefinition ||
+                fTypeDecl instanceof XSComplexTypeDefinition &&
+                ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
+            this.fValue.copyFrom(elem.getSchemaValue());
+        }
+        else {
+            this.fValue.reset();
+        }
         this.fSpecified = elem.getIsSchemaSpecified();
         this.fNil = elem.getNil();
     }
@@ -288,21 +281,28 @@ public class PSVIElementNSImpl extends E
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue()
      */
     public Object getActualNormalizedValue() {
-        return this.fActualValue;
+        return fValue.getActualValue();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType()
      */
     public short getActualNormalizedValueType() {
-        return this.fActualValueType;
+        return fValue.getActualValueType();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes()
      */
     public ShortList getItemValueTypes() {
-        return this.fItemValueTypes;
+        return fValue.getListValueTypes();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue()
+     */
+    public XSValue getSchemaValue() {
+        return fValue;
     }
     
     // REVISIT: Forbid serialization of PSVI DOM until

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/ValidatedInfo.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dv/ValidatedInfo.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/ValidatedInfo.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/ValidatedInfo.java Mon Oct 18 22:06:35 2010
@@ -17,8 +17,13 @@
 
 package org.apache.xerces.impl.dv;
 
+import org.apache.xerces.impl.xs.util.ShortListImpl;
+import org.apache.xerces.impl.xs.util.XSObjectListImpl;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * Class to get the information back after content is validated. This info
@@ -30,7 +35,7 @@ import org.apache.xerces.xs.XSConstants;
  *
  * @version $Id$
  */
-public class ValidatedInfo {
+public class ValidatedInfo implements XSValue {
 
     /**
      * The normalized value of a string value
@@ -52,6 +57,11 @@ public class ValidatedInfo {
     public short actualValueType;
 
     /**
+     * The declared type of the value.
+     */
+    public XSSimpleType actualType;
+
+    /**
      * If the type is a union type, then the member type which
      * actually validated the string value.
      */
@@ -81,6 +91,7 @@ public class ValidatedInfo {
         this.normalizedValue = null;
         this.actualValue = null;
         this.actualValueType = XSConstants.UNAVAILABLE_DT;
+        this.actualType = null;
         this.memberType = null;
         this.memberTypes = null;
         this.itemValueTypes = null;
@@ -154,4 +165,71 @@ public class ValidatedInfo {
         /** Other types. */
         return valueType;
     }
-}
\ No newline at end of file
+
+    // XSValue methods
+    
+    public Object getActualValue() {
+        return actualValue;
+    }
+
+    public short getActualValueType() {
+        return actualValueType;
+    }
+
+    public ShortList getListValueTypes() {
+        return itemValueTypes == null ? ShortListImpl.EMPTY_LIST : itemValueTypes;
+    }
+
+    public XSObjectList getMemberTypeDefinitions() {
+        if (memberTypes == null) {
+            return XSObjectListImpl.EMPTY_LIST;
+        }
+        return new XSObjectListImpl(memberTypes, memberTypes.length);
+    }
+
+    public String getNormalizedValue() {
+        return normalizedValue;
+    }
+
+    public XSSimpleTypeDefinition getTypeDefinition() {
+        return actualType;
+    }
+    
+    public XSSimpleTypeDefinition getMemberTypeDefinition() {
+        return memberType;
+    }
+
+    public void copyFrom(XSValue o) {
+        if (o == null) {
+            reset();
+        }
+        else if (o instanceof ValidatedInfo) {
+            ValidatedInfo other = (ValidatedInfo)o;
+            normalizedValue = other.normalizedValue;
+            actualValue = other.actualValue;
+            actualValueType = other.actualValueType;
+            actualType = other.actualType;
+            memberType = other.memberType;
+            memberTypes = other.memberTypes;
+            itemValueTypes = other.itemValueTypes;
+        }
+        else {
+            normalizedValue = o.getNormalizedValue();
+            actualValue = o.getActualValue();
+            actualValueType = o.getActualValueType();
+            actualType = (XSSimpleType)o.getTypeDefinition();
+            memberType = (XSSimpleType)o.getMemberTypeDefinition();
+            XSObjectList members = o.getMemberTypeDefinitions();
+            if (members == null || members.getLength() == 0) {
+                memberTypes = null;
+            }
+            else {
+                memberTypes = new XSSimpleType[members.getLength()];
+                for (int i = 0; i < members.getLength(); i++) {
+                    memberTypes[i] = (XSSimpleType)members.get(i);
+                }
+            }
+            itemValueTypes = o.getListValueTypes();
+        }
+    }
+}

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/util/ByteListImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dv/util/ByteListImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/util/ByteListImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/util/ByteListImpl.java Mon Oct 18 22:06:35 2010
@@ -101,5 +101,11 @@ public class ByteListImpl extends Abstra
     public int size() {
         return getLength();
     }
+    
+    public byte[] toByteArray() {
+        byte[] ret = new byte[data.length];
+        System.arraycopy(data, 0, ret, 0, data.length);
+        return ret;
+    }
 }
 

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Mon Oct 18 22:06:35 2010
@@ -17,6 +17,7 @@
 
 package org.apache.xerces.impl.dv.xs;
 
+import java.math.BigInteger;
 import java.util.AbstractList;
 import java.util.Locale;
 import java.util.StringTokenizer;
@@ -32,6 +33,7 @@ import org.apache.xerces.impl.dv.XSFacet
 import org.apache.xerces.impl.dv.XSSimpleType;
 import org.apache.xerces.impl.xpath.regex.RegularExpression;
 import org.apache.xerces.impl.xs.SchemaSymbols;
+import org.apache.xerces.impl.xs.util.ObjectListImpl;
 import org.apache.xerces.impl.xs.util.ShortListImpl;
 import org.apache.xerces.impl.xs.util.StringListImpl;
 import org.apache.xerces.impl.xs.util.XSObjectListImpl;
@@ -44,6 +46,7 @@ import org.apache.xerces.xs.XSConstants;
 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;
@@ -264,9 +267,8 @@ public class XSSimpleTypeDecl implements
     private int fFractionDigits = -1;
     private Vector fPattern;
     private Vector fPatternStr;
-    private Vector fEnumeration;
-    private short[] fEnumerationType;
-    private ShortList[] fEnumerationItemType;   // used in case fenumerationType value is LIST or LISTOFUNION 
+    private ValidatedInfo[] fEnumeration;
+    private int fEnumerationSize;
     private ShortList fEnumerationTypeList;
     private ObjectList fEnumerationItemTypeList;
     private StringList fLexicalPattern;
@@ -384,8 +386,7 @@ public class XSSimpleTypeDecl implements
         fPattern = fBase.fPattern;
         fPatternStr = fBase.fPatternStr;
         fEnumeration = fBase.fEnumeration;
-        fEnumerationType = fBase.fEnumerationType;
-        fEnumerationItemType = fBase.fEnumerationItemType;
+        fEnumerationSize = fBase.fEnumerationSize;
         fWhiteSpace = fBase.fWhiteSpace;
         fMaxExclusive = fBase.fMaxExclusive;
         fMaxInclusive = fBase.fMaxInclusive;
@@ -505,8 +506,7 @@ public class XSSimpleTypeDecl implements
         fPattern = fBase.fPattern;
         fPatternStr = fBase.fPatternStr;
         fEnumeration = fBase.fEnumeration;
-        fEnumerationType = fBase.fEnumerationType;
-        fEnumerationItemType = fBase.fEnumerationItemType;
+        fEnumerationSize = fBase.fEnumerationSize;
         fWhiteSpace = fBase.fWhiteSpace;
         fMaxExclusive = fBase.fMaxExclusive;
         fMaxInclusive = fBase.fMaxInclusive;
@@ -870,22 +870,20 @@ public class XSSimpleTypeDecl implements
             if ((allowedFacet & FACET_ENUMERATION) == 0) {
                 reportError("cos-applicable-facets", new Object[]{"enumeration", fTypeName});
             } else {
-                fEnumeration = new Vector();
                 Vector enumVals = facets.enumeration;
-                fEnumerationType = new short[enumVals.size()];
-                fEnumerationItemType = new ShortList[enumVals.size()];
+                int size = enumVals.size();
+                fEnumeration = new ValidatedInfo[size];
                 Vector enumNSDecls = facets.enumNSDecls;
                 ValidationContextImpl ctx = new ValidationContextImpl(context);
                 enumerationAnnotations = facets.enumAnnotations;
-                for (int i = 0; i < enumVals.size(); i++) {
+                fEnumerationSize = 0;
+                for (int i = 0; i < size; i++) {
                     if (enumNSDecls != null)
                         ctx.setNSContext((NamespaceContext)enumNSDecls.elementAt(i));
                     try {
-                        ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, tempInfo);
+                        ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, null);
                         // check 4.3.5.c0 must: enumeration values from the value space of base
-                        fEnumeration.addElement(info.actualValue);
-                        fEnumerationType[i] = info.actualValueType;
-                        fEnumerationItemType[i] = info.itemValueTypes;
+                        fEnumeration[fEnumerationSize++] = info;
                     } catch (InvalidDatatypeValueException ide) {
                         reportError("enumeration-valid-restriction", new Object[]{enumVals.elementAt(i), this.getBaseType().getName()});
                     }
@@ -1475,6 +1473,7 @@ public class XSSimpleTypeDecl implements
         if ((fFacetsDefined & FACET_ENUMERATION) == 0 && (fBase.fFacetsDefined & FACET_ENUMERATION) != 0) {
             fFacetsDefined |= FACET_ENUMERATION;
             fEnumeration = fBase.fEnumeration;
+            fEnumerationSize = fBase.fEnumerationSize;
             enumerationAnnotations = fBase.enumerationAnnotations;
         }
         // inherit maxExclusive
@@ -1670,16 +1669,16 @@ public class XSSimpleTypeDecl implements
         //enumeration
         if ( ((fFacetsDefined & FACET_ENUMERATION) != 0 ) ) {
             boolean present = false;
-            final int enumSize = fEnumeration.size();
+            final int enumSize = fEnumerationSize;
             final short primitiveType1 = convertToPrimitiveKind(type);
             for (int i = 0; i < enumSize; i++) {
-                final short primitiveType2 = convertToPrimitiveKind(fEnumerationType[i]);
+                final short primitiveType2 = convertToPrimitiveKind(fEnumeration[i].actualValueType);
                 if ((primitiveType1 == primitiveType2 ||
                         primitiveType1 == XSConstants.ANYSIMPLETYPE_DT && primitiveType2 == XSConstants.STRING_DT ||
                         primitiveType1 == XSConstants.STRING_DT && primitiveType2 == XSConstants.ANYSIMPLETYPE_DT)
-                        && fEnumeration.elementAt(i).equals(ob)) {
+                        && fEnumeration[i].actualValue.equals(ob)) {
                     if (primitiveType1 == XSConstants.LIST_DT || primitiveType1 == XSConstants.LISTOFUNION_DT) {
-                        ShortList enumItemType = fEnumerationItemType[i];
+                        ShortList enumItemType = fEnumeration[i].itemValueTypes;
                         final int typeList1Length = itemType != null ? itemType.getLength() : 0;
                         final int typeList2Length = enumItemType != null ? enumItemType.getLength() : 0;
                         if (typeList1Length == typeList2Length) {
@@ -1708,8 +1707,10 @@ public class XSSimpleTypeDecl implements
                 }
             }
             if(!present){
+                StringBuffer sb = new StringBuffer();
+                appendEnumString(sb);
                 throw new InvalidDatatypeValueException("cvc-enumeration-valid",
-                        new Object [] {content, fEnumeration.toString()});
+                        new Object [] {content, sb.toString()});
             }
         }
 
@@ -1817,6 +1818,8 @@ public class XSSimpleTypeDecl implements
             ValidatedInfo validatedInfo, boolean needNormalize)
     throws InvalidDatatypeValueException{
 
+        validatedInfo.actualType = this;
+
         String nvalue;
         if (needNormalize) {
             nvalue = normalize(content, fWhiteSpace);
@@ -1921,6 +1924,8 @@ public class XSSimpleTypeDecl implements
                         fMemberTypes[i].checkFacets(validatedInfo);
                     }
                     validatedInfo.memberType = fMemberTypes[i];
+                    // Set this again because it was changed to the member type
+                    validatedInfo.actualType = this;
                     return aValue;
                 } catch(InvalidDatatypeValueException invalidValue) {
                 }
@@ -1938,14 +1943,8 @@ public class XSSimpleTypeDecl implements
                 }
                 typesBuffer.append(decl.fTypeName);
                 if(decl.fEnumeration != null) {
-                    Vector v = decl.fEnumeration;
-                    typesBuffer.append(" : [");
-                    for(int j = 0;j < v.size(); j++) {
-                        if(j != 0)
-                            typesBuffer.append(',');
-                        typesBuffer.append(v.elementAt(j));
-                    }
-                    typesBuffer.append(']');
+                    typesBuffer.append(" : ");
+                    decl.appendEnumString(typesBuffer);
                 }             
             }
             throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3",
@@ -2237,10 +2236,10 @@ public class XSSimpleTypeDecl implements
         if (fLexicalEnumeration == null){
             if (fEnumeration == null)
                 return StringListImpl.EMPTY_LIST;
-            int size = fEnumeration.size();
+            int size = fEnumerationSize;
             String[] strs = new String[size];
             for (int i = 0; i < size; i++)
-                strs[i] = fEnumeration.elementAt(i).toString();
+                strs[i] = fEnumeration[i].normalizedValue;
             fLexicalEnumeration = new StringListImpl(strs, size);
         }
         return fLexicalEnumeration;
@@ -2254,16 +2253,24 @@ public class XSSimpleTypeDecl implements
         if (fActualEnumeration == null) {
             fActualEnumeration = new AbstractObjectList() {
                 public int getLength() {
-                    return (fEnumeration != null) ? fEnumeration.size() : 0;
+                    return (fEnumeration != null) ? fEnumerationSize : 0;
                 }
                 public boolean contains(Object item) {
-                    return (fEnumeration != null && fEnumeration.contains(item));
+                    if (fEnumeration == null) {
+                        return false;
+                    }
+                    for (int i = 0; i < fEnumerationSize; i++) {
+                        if (fEnumeration[i].getActualValue().equals(item)) {
+                            return true;
+                        }
+                    }
+                    return false;
                 }
                 public Object item(int index) {
                     if (index < 0 || index >= getLength()) {
                         return null;
                     }
-                    return fEnumeration.elementAt(index);
+                    return fEnumeration[index].getActualValue();
                 }
             };
         }
@@ -2276,17 +2283,18 @@ public class XSSimpleTypeDecl implements
      */
     public ObjectList getEnumerationItemTypeList() {
         if (fEnumerationItemTypeList == null) {
-            if(fEnumerationItemType == null)
+            if (fEnumeration == null) {
                 return null;
+            }
             fEnumerationItemTypeList = new AbstractObjectList() {
                 public int getLength() {
-                    return (fEnumerationItemType != null) ? fEnumerationItemType.length : 0;
+                    return (fEnumeration != null) ? fEnumerationSize : 0;
                 }
                 public boolean contains(Object item) {
-                    if(fEnumerationItemType == null || !(item instanceof ShortList))
+                    if (fEnumeration == null || !(item instanceof ShortList))
                         return false;
-                    for(int i = 0;i < fEnumerationItemType.length; i++)
-                        if(fEnumerationItemType[i] == item)
+                    for (int i = 0;i < fEnumerationSize; i++)
+                        if (fEnumeration[i].itemValueTypes == item)
                             return true;
                     return false;
                 }
@@ -2294,7 +2302,7 @@ public class XSSimpleTypeDecl implements
                     if (index < 0 || index >= getLength()) {
                         return null;
                     }
-                    return fEnumerationItemType[index];
+                    return fEnumeration[index].itemValueTypes;
                 }
             };
         }
@@ -2303,10 +2311,14 @@ public class XSSimpleTypeDecl implements
 
     public ShortList getEnumerationTypeList() {
         if (fEnumerationTypeList == null) {
-            if (fEnumerationType == null) {
+            if (fEnumeration == null) {
                 return ShortListImpl.EMPTY_LIST;
             }
-            fEnumerationTypeList = new ShortListImpl (fEnumerationType, fEnumerationType.length);
+            short[] list = new short[fEnumerationSize];
+            for (int i = 0; i < fEnumerationSize; i++) {
+                list[i] = fEnumeration[i].actualValueType;
+            }
+            fEnumerationTypeList = new ShortListImpl(list, fEnumerationSize);
         }
         return fEnumerationTypeList;
     }
@@ -2970,10 +2982,11 @@ public class XSSimpleTypeDecl implements
         fPattern = null;
         fPatternStr = null;
         fEnumeration = null;
-        fEnumerationType = null;
-        fEnumerationItemType = null;
         fLexicalPattern = null;
         fLexicalEnumeration = null;
+        fActualEnumeration = null;
+        fEnumerationTypeList = null;
+        fEnumerationItemTypeList = null;
         fMaxInclusive = null;
         fMaxExclusive = null;
         fMinExclusive = null;
@@ -3035,6 +3048,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_WHITESPACE,
                             WS_FACET_STRING[fWhiteSpace],
+                            0,
+                            null,
                             (fFixedFacet & FACET_WHITESPACE) != 0,
                             whiteSpaceAnnotation);
                 count++;
@@ -3044,6 +3059,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_LENGTH,
                             Integer.toString(fLength),
+                            fLength,
+                            null,
                             (fFixedFacet & FACET_LENGTH) != 0,
                             lengthAnnotation);
                 count++;
@@ -3053,6 +3070,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MINLENGTH,
                             Integer.toString(fMinLength),
+                            fMinLength,
+                            null,
                             (fFixedFacet & FACET_MINLENGTH) != 0,
                             minLengthAnnotation);
                 count++;
@@ -3062,6 +3081,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MAXLENGTH,
                             Integer.toString(fMaxLength),
+                            fMaxLength,
+                            null,
                             (fFixedFacet & FACET_MAXLENGTH) != 0,
                             maxLengthAnnotation);
                 count++;
@@ -3071,6 +3092,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_TOTALDIGITS,
                             Integer.toString(fTotalDigits),
+                            fTotalDigits,
+                            null,
                             (fFixedFacet & FACET_TOTALDIGITS) != 0,
                             totalDigitsAnnotation);
                 count++;
@@ -3080,6 +3103,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_FRACTIONDIGITS,
                             "0",
+                            0,
+                            null,
                             true,
                             fractionDigitsAnnotation);
                 count++;
@@ -3089,6 +3114,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_FRACTIONDIGITS,
                             Integer.toString(fFractionDigits),
+                            fFractionDigits,
+                            null,
                             (fFixedFacet & FACET_FRACTIONDIGITS) != 0,
                             fractionDigitsAnnotation);
                 count++;
@@ -3098,6 +3125,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MAXINCLUSIVE,
                             fMaxInclusive.toString(),
+                            0,
+                            fMaxInclusive,
                             (fFixedFacet & FACET_MAXINCLUSIVE) != 0,
                             maxInclusiveAnnotation);
                 count++;
@@ -3107,6 +3136,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MAXEXCLUSIVE,
                             fMaxExclusive.toString(),
+                            0,
+                            fMaxExclusive,
                             (fFixedFacet & FACET_MAXEXCLUSIVE) != 0,
                             maxExclusiveAnnotation);
                 count++;
@@ -3116,6 +3147,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MINEXCLUSIVE,
                             fMinExclusive.toString(),
+                            0,
+                            fMinExclusive,
                             (fFixedFacet & FACET_MINEXCLUSIVE) != 0,
                             minExclusiveAnnotation);
                 count++;
@@ -3125,6 +3158,8 @@ public class XSSimpleTypeDecl implements
                     new XSFacetImpl(
                             FACET_MININCLUSIVE,
                             fMinInclusive.toString(),
+                            0,
+                            fMinInclusive,
                             (fFixedFacet & FACET_MININCLUSIVE) != 0,
                             minInclusiveAnnotation);
                 count++;
@@ -3134,6 +3169,28 @@ public class XSSimpleTypeDecl implements
         return (fFacets != null) ? fFacets : XSObjectListImpl.EMPTY_LIST;
     }
 
+    public XSObject getFacet(int facetType) {
+        if (facetType == FACET_ENUMERATION || facetType == FACET_PATTERN) {
+            XSObjectList list = getMultiValueFacets();
+            for (int i = 0; i < list.getLength(); i++) {
+                XSMultiValueFacet f = (XSMultiValueFacet)list.item(i);
+                if (f.getFacetKind() == facetType) {
+                    return f;
+                }
+            }
+        }
+        else {
+            XSObjectList list = getFacets();
+            for (int i = 0; i < list.getLength(); i++) {
+                XSFacet f = (XSFacet)list.item(i);
+                if (f.getFacetKind() == facetType) {
+                    return f;
+                }
+            }
+        }
+        return null;
+    }
+    
     /**
      *  A list of enumeration and pattern constraining facets if it exists,
      * otherwise an empty <code>XSObjectList</code>.
@@ -3154,6 +3211,7 @@ public class XSSimpleTypeDecl implements
                     new XSMVFacetImpl(
                             FACET_PATTERN,
                             this.getLexicalPattern(),
+                            null,
                             patternAnnotations);
                 count++;
             }
@@ -3162,6 +3220,7 @@ public class XSSimpleTypeDecl implements
                     new XSMVFacetImpl(
                             FACET_ENUMERATION,
                             this.getLexicalEnumeration(),
+                            new ObjectListImpl(fEnumeration, fEnumerationSize),
                             enumerationAnnotations);
                 count++;
             }
@@ -3193,13 +3252,17 @@ public class XSSimpleTypeDecl implements
 
     private static final class XSFacetImpl implements XSFacet {
         final short kind;
-        final String value;
+        final String svalue;
+        final int ivalue;
+        Object avalue;
         final boolean fixed;
         final XSObjectList annotations;  
 
-        public XSFacetImpl(short kind, String value, boolean fixed, XSAnnotation annotation) {
+        public XSFacetImpl(short kind, String svalue, int ivalue, Object avalue, boolean fixed, XSAnnotation annotation) {
             this.kind = kind;
-            this.value = value;
+            this.svalue = svalue;
+            this.ivalue = ivalue;
+            this.avalue = avalue;
             this.fixed = fixed;
 
             if (annotation != null) {
@@ -3246,9 +3309,26 @@ public class XSSimpleTypeDecl implements
          * @see org.apache.xerces.xs.XSFacet#getLexicalFacetValue()
          */
         public String getLexicalFacetValue() {
-            return value;
+            return svalue;
         }
 
+        public Object getActualFacetValue() {
+            if (avalue == null) {
+                if (kind == FACET_WHITESPACE) {
+                    avalue = svalue;
+                }
+                else {
+                    // Must a facet with an integer value. Use BigInteger.
+                    avalue = BigInteger.valueOf(ivalue);
+                }
+            }
+            return avalue;
+        }
+        
+        public int getIntFacetValue() {
+            return ivalue;
+        }
+        
         /* (non-Javadoc)
          * @see org.apache.xerces.xs.XSFacet#isFixed()
          */
@@ -3290,11 +3370,13 @@ public class XSSimpleTypeDecl implements
     private static final class XSMVFacetImpl implements XSMultiValueFacet {
         final short kind;
         final XSObjectList annotations;
-        final StringList values;
+        final StringList svalues;
+        final ObjectList avalues;
 
-        public XSMVFacetImpl(short kind, StringList values, XSObjectList annotations) {
+        public XSMVFacetImpl(short kind, StringList svalues, ObjectList avalues, XSObjectList annotations) {
             this.kind = kind;
-            this.values = values;
+            this.svalues = svalues;
+            this.avalues = avalues;
             this.annotations = (annotations != null) ? annotations : XSObjectListImpl.EMPTY_LIST;
         }		
 
@@ -3316,9 +3398,13 @@ public class XSSimpleTypeDecl implements
          * @see org.apache.xerces.xs.XSMultiValueFacet#getLexicalFacetValues()
          */
         public StringList getLexicalFacetValues() {
-            return values;
+            return svalues;
         }
 
+        public ObjectList getEnumerationValues() {
+            return avalues;
+        }
+        
         /* (non-Javadoc)
          * @see org.apache.xerces.xs.XSObject#getName()
          */
@@ -3386,5 +3472,15 @@ public class XSSimpleTypeDecl implements
         return valueType;
     }
 
+    private void appendEnumString(StringBuffer sb) {
+        sb.append('[');
+        for (int i = 0; i < fEnumerationSize; i++) {
+            if (i != 0) {
+                sb.append(", ");
+            }
+            sb.append(fEnumeration[i].actualValue);
+        }
+        sb.append(']');
+    }
 } // class XSSimpleTypeDecl
 

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java Mon Oct 18 22:06:35 2010
@@ -26,6 +26,7 @@ import org.apache.xerces.impl.dv.XSFacet
 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;
@@ -73,6 +74,10 @@ public class XSSimpleTypeDelegate
         return type.getFacets();
     }
 
+    public XSObject getFacet(int facetType) {
+        return type.getFacet(facetType);
+    }
+
     public boolean getFinite() {
         return type.getFinite();
     }

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/AttributePSVImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/AttributePSVImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/AttributePSVImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/AttributePSVImpl.java Mon Oct 18 22:06:35 2010
@@ -17,14 +17,15 @@
 
 package org.apache.xerces.impl.xs;
 
+import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.xs.util.StringListImpl;
 import org.apache.xerces.xs.AttributePSVI;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.StringList;
 import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * Attribute PSV infoset augmentations implementation.
@@ -47,20 +48,8 @@ public class AttributePSVImpl implements
      * value in the original document, this is false; otherwise, it is true */
     protected boolean fSpecified = false;
 
-    /** schema normalized value property */
-    protected String fNormalizedValue = null;
-    
-    /** schema actual value */
-    protected Object fActualValue = null;
-
-    /** schema actual value type */
-    protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
-    /** actual value types if the value is a list */
-    protected ShortList fItemValueTypes = null;
-
-    /** member type definition against which attribute was validated */
-    protected XSSimpleTypeDefinition fMemberType = null;
+    /** Schema value */
+    protected ValidatedInfo fValue = new ValidatedInfo();
 
     /** validation attempted: none, partial, full */
     protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE;
@@ -96,7 +85,7 @@ public class AttributePSVImpl implements
      * @return the normalized value of this item after validation
      */
     public String getSchemaNormalizedValue() {
-        return fNormalizedValue;
+        return fValue.getNormalizedValue();
     }
 
     /**
@@ -180,7 +169,7 @@ public class AttributePSVImpl implements
      * @return  a simple type declaration
      */
     public XSSimpleTypeDefinition getMemberTypeDefinition() {
-        return fMemberType;
+        return fValue.getMemberTypeDefinition();
     }
 
     /**
@@ -197,35 +186,38 @@ public class AttributePSVImpl implements
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue()
      */
     public Object getActualNormalizedValue() {
-        return this.fActualValue;
+        return fValue.getActualValue();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType()
      */
     public short getActualNormalizedValueType() {
-        return this.fActualValueType;
+        return fValue.getActualValueType();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes()
      */
     public ShortList getItemValueTypes() {
-        return this.fItemValueTypes;
+        return fValue.getListValueTypes();
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue()
+     */
+    public XSValue getSchemaValue() {
+        return fValue;
+    }
+    
     /**
      * Reset() 
      */
     public void reset() {
-        fNormalizedValue = null;
-        fActualValue = null;
-        fActualValueType = XSConstants.UNAVAILABLE_DT;
-        fItemValueTypes = null;
+        fValue.reset();
         fDeclaration = null;
         fTypeDecl = null;
         fSpecified = false;
-        fMemberType = null;
         fValidationAttempted = AttributePSVI.VALIDATION_NONE;
         fValidity = AttributePSVI.VALIDITY_NOTKNOWN;
         fErrors = null;

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/ElementPSVImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/ElementPSVImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/ElementPSVImpl.java Mon Oct 18 22:06:35 2010
@@ -17,17 +17,17 @@
 
 package org.apache.xerces.impl.xs;
 
-import org.apache.xerces.impl.xs.util.ShortListImpl;
+import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.xs.util.StringListImpl;
 import org.apache.xerces.xs.ElementPSVI;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSElementDeclaration;
 import org.apache.xerces.xs.XSModel;
 import org.apache.xerces.xs.XSNotationDeclaration;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * Element PSV infoset augmentations implementation.
@@ -60,24 +60,12 @@ public class ElementPSVImpl implements E
      */
     protected boolean fSpecified = false;
 
-    /** schema normalized value property */
-    protected String fNormalizedValue = null;
-
-    /** schema actual value */
-    protected Object fActualValue = null;
-
-    /** schema actual value type */
-    protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
-    /** actual value types if the value is a list */
-    protected ShortList fItemValueTypes = null;
+    /** Schema value */
+    protected ValidatedInfo fValue = new ValidatedInfo();
 
     /** http://www.w3.org/TR/xmlschema-1/#e-notation*/
     protected XSNotationDeclaration fNotation = null;
 
-    /** member type definition against which element was validated */
-    protected XSSimpleTypeDefinition fMemberType = null;
-
     /** validation attempted: none, partial, full */
     protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE;
 
@@ -118,7 +106,7 @@ public class ElementPSVImpl implements E
      * @return the normalized value of this item after validation
      */
     public String getSchemaNormalizedValue() {
-        return fNormalizedValue;
+        return fValue.getNormalizedValue();
     }
 
     /**
@@ -219,7 +207,7 @@ public class ElementPSVImpl implements E
      * @return  a simple type declaration
      */
     public XSSimpleTypeDefinition getMemberTypeDefinition() {
-        return fMemberType;
+        return fValue.getMemberTypeDefinition();
     }
 
     /**
@@ -249,23 +237,30 @@ public class ElementPSVImpl implements E
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue()
      */
     public Object getActualNormalizedValue() {
-        return this.fActualValue;
+        return fValue.getActualValue();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType()
      */
     public short getActualNormalizedValueType() {
-        return this.fActualValueType;
+        return fValue.getActualValueType();
     }
 
     /* (non-Javadoc)
      * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes()
      */
     public ShortList getItemValueTypes() {
-        return this.fItemValueTypes != null ? this.fItemValueTypes : ShortListImpl.EMPTY_LIST;
+        return fValue.getListValueTypes();
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue()
+     */
+    public XSValue getSchemaValue() {
+        return fValue;
+    }
+    
     /**
      * Reset() should be called in validator startElement(..) method.
      */
@@ -275,15 +270,11 @@ public class ElementPSVImpl implements E
         fNil = false;
         fSpecified = false;
         fNotation = null;
-        fMemberType = null;
         fValidationAttempted = ElementPSVI.VALIDATION_NONE;
         fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
         fErrors = null;
         fValidationContext = null;
-        fNormalizedValue = null;
-        fActualValue = null;
-        fActualValueType = XSConstants.UNAVAILABLE_DT;
-        fItemValueTypes = null;
+        fValue.reset();
     }
     
     public void copySchemaInformationTo(ElementPSVImpl target) {

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/SchemaGrammar.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/SchemaGrammar.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/SchemaGrammar.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/SchemaGrammar.java Mon Oct 18 22:06:35 2010
@@ -46,6 +46,7 @@ import org.apache.xerces.xs.XSAttributeD
 import org.apache.xerces.xs.XSAttributeGroupDefinition;
 import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSIDCDefinition;
 import org.apache.xerces.xs.XSModel;
 import org.apache.xerces.xs.XSModelGroupDefinition;
 import org.apache.xerces.xs.XSNamedMap;
@@ -1345,7 +1346,7 @@ public class SchemaGrammar implements XS
                                                   false,    // model group
                                                   false,    // particle
                                                   false,    // wildcard
-                                                  false,    // idc
+                                                  true,    // idc
                                                   true,     // notation
                                                   false,    // annotation
                                                   false,    // facet
@@ -1482,6 +1483,9 @@ public class SchemaGrammar implements XS
             case XSConstants.NOTATION_DECLARATION:
                 table = fGlobalNotationDecls;
                 break;
+            case XSConstants.IDENTITY_CONSTRAINT:
+                table = this.fGlobalIDConstraintDecls;
+                break;
             }
 
             // for complex/simple types, create a special implementation,
@@ -1531,6 +1535,9 @@ public class SchemaGrammar implements XS
             case XSConstants.NOTATION_DECLARATION:
                 table = fGlobalNotationDeclsExt;
                 break;
+            case XSConstants.IDENTITY_CONSTRAINT:
+                table = this.fGlobalIDConstraintDeclsExt;
+                break;
             }
 
             Object[] entries = table.getEntries();
@@ -1608,6 +1615,10 @@ public class SchemaGrammar implements XS
         return getGlobalNotationDecl(name);
     }
 
+    public XSIDCDefinition getIDCDefinition(String name) {
+        return getIDConstraintDecl(name);
+    }
+
 
     /**
      * [document location]

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Mon Oct 18 22:06:35 2010
@@ -2557,11 +2557,7 @@ public class XMLSchemaValidator
 
             if (fDefaultValue != null)
                 fCurrentPSVI.fSpecified = true;
-            fCurrentPSVI.fMemberType = fValidatedInfo.memberType;
-            fCurrentPSVI.fNormalizedValue = fValidatedInfo.normalizedValue;
-            fCurrentPSVI.fActualValue = fValidatedInfo.actualValue;
-            fCurrentPSVI.fActualValueType = fValidatedInfo.actualValueType;
-            fCurrentPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes;
+            fCurrentPSVI.fValue.copyFrom(fValidatedInfo);
 
             if (fStrictAssess) {
                 // get all errors for the current element, its attribute,
@@ -3151,7 +3147,7 @@ public class XMLSchemaValidator
             }
         }
         if (fIdConstraint) {
-            attrPSVI.fActualValue = actualValue;
+            attrPSVI.fValue.copyFrom(fValidatedInfo);
         }
 
         if (fAugPSVI) {
@@ -3160,18 +3156,11 @@ public class XMLSchemaValidator
             // PSVI: attribute type
             attrPSVI.fTypeDecl = attDV;
 
-            // PSVI: attribute memberType
-            attrPSVI.fMemberType = fValidatedInfo.memberType;
             // PSVI: attribute normalized value
             // NOTE: we always store the normalized value, even if it's invlid,
             // because it might still be useful to the user. But when the it's
             // not valid, the normalized value is not trustable.
-            attrPSVI.fNormalizedValue = fValidatedInfo.normalizedValue;
-            attrPSVI.fActualValue = fValidatedInfo.actualValue;
-            attrPSVI.fActualValueType = fValidatedInfo.actualValueType;
-            attrPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes;
-
-
+            attrPSVI.fValue.copyFrom(fValidatedInfo);
 
             // PSVI: validation attempted:
             attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL;
@@ -3258,11 +3247,7 @@ public class XMLSchemaValidator
 
                     attrPSVI.fDeclaration = currDecl;
                     attrPSVI.fTypeDecl = currDecl.fType;
-                    attrPSVI.fMemberType = defaultValue.memberType;
-                    attrPSVI.fNormalizedValue = normalized;
-                    attrPSVI.fActualValue = defaultValue.actualValue;
-                    attrPSVI.fActualValueType = defaultValue.actualValueType;
-                    attrPSVI.fItemValueTypes = defaultValue.itemValueTypes;
+                    attrPSVI.fValue.copyFrom(defaultValue);
                     attrPSVI.fValidationContext = fValidationRoot;
                     attrPSVI.fValidity = AttributePSVI.VALIDITY_VALID;
                     attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL;

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java Mon Oct 18 22:06:35 2010
@@ -29,6 +29,7 @@ import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSNamespaceItem;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * The XML representation for an attribute declaration
@@ -209,4 +210,8 @@ public class XSAttributeDecl implements 
                fDefault.itemValueTypes;
     }
 
+    public XSValue getValueConstraintValue() {
+        return fDefault;
+    }
+
 } // class XSAttributeDecl

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java Mon Oct 18 22:06:35 2010
@@ -25,6 +25,7 @@ import org.apache.xerces.xs.XSAttributeU
 import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSNamespaceItem;
 import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * The XML representation for an attribute use
@@ -140,6 +141,10 @@ public class XSAttributeUseImpl implemen
                fDefault.itemValueTypes;
     }
 
+    public XSValue getValueConstraintValue() {
+        return fDefault;
+    }
+
     /**
      * Optional. Annotations.
      */

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java Mon Oct 18 22:06:35 2010
@@ -31,6 +31,7 @@ import org.apache.xerces.xs.XSNamedMap;
 import org.apache.xerces.xs.XSNamespaceItem;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSValue;
 
 /**
  * The XML representation for an element declaration
@@ -382,4 +383,8 @@ public class XSElementDecl implements XS
                fDefault.itemValueTypes;
     }
 
+    public XSValue getValueConstraintValue() {
+        return fDefault;
+    }
+
 } // class XSElementDecl

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSModelImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSModelImpl.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSModelImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSModelImpl.java Mon Oct 18 22:06:35 2010
@@ -36,6 +36,7 @@ import org.apache.xerces.xs.XSAttributeD
 import org.apache.xerces.xs.XSAttributeGroupDefinition;
 import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSIDCDefinition;
 import org.apache.xerces.xs.XSModel;
 import org.apache.xerces.xs.XSModelGroupDefinition;
 import org.apache.xerces.xs.XSNamedMap;
@@ -70,7 +71,7 @@ public final class XSModelImpl extends A
                                                   false,    // model group
                                                   false,    // particle
                                                   false,    // wildcard
-                                                  false,    // idc
+                                                  true,    // idc
                                                   true,     // notation
                                                   false,    // annotation
                                                   false,    // facet
@@ -324,6 +325,9 @@ public final class XSModelImpl extends A
                 case XSConstants.NOTATION_DECLARATION:
                     tables[i] = fGrammarList[i].fGlobalNotationDecls;
                     break;
+                case XSConstants.IDENTITY_CONSTRAINT:
+                    tables[i] = fGrammarList[i].fGlobalIDConstraintDecls;
+                    break;
                 }
             }
             // for complex/simple types, create a special implementation,
@@ -403,6 +407,9 @@ public final class XSModelImpl extends A
             case XSConstants.NOTATION_DECLARATION:
                 table = fGrammarList[i].fGlobalNotationDecls;
                 break;
+            case XSConstants.IDENTITY_CONSTRAINT:
+                table = fGrammarList[i].fGlobalIDConstraintDecls;
+                break;
             }
             
             // for complex/simple types, create a special implementation,
@@ -593,6 +600,40 @@ public final class XSModelImpl extends A
         return sg.getGlobalGroupDecl(name, loc);
     }
 
+    /**
+     * Convenience method. Returns a top-level model group definition.
+     *
+     * @param name      The name of the definition.
+     * @param namespace The namespace of the definition, otherwise null.
+     * @return A top-level model group definition definition or null if such
+     *         definition does not exist.
+     */
+    public XSIDCDefinition getIDCDefinition(String name, String namespace) {
+        SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
+        if (sg == null) {
+            return null;
+        }
+        return (XSIDCDefinition)sg.fGlobalIDConstraintDecls.get(name);
+    }
+    
+    /**
+     * Convenience method. Returns a top-level model group definition.
+     *
+     * @param name      The name of the definition.
+     * @param namespace The namespace of the definition, otherwise null.
+     * @param loc The schema location where the component was defined
+     * @return A top-level model group definition definition or null if such
+     *         definition does not exist.
+     */
+    public XSIDCDefinition getIDCDefinition(String name, String namespace,
+                                                          String loc) {
+        SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
+        if (sg == null) {
+            return null;
+        }
+        return sg.getIDConstraintDecl(name, loc);
+    }
+
 
     /**
      * @see org.apache.xerces.xs.XSModel#getNotationDeclaration(String, String)

Modified: xerces/java/trunk/src/org/apache/xerces/xs/ItemPSVI.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/ItemPSVI.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/ItemPSVI.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/ItemPSVI.java Mon Oct 18 22:06:35 2010
@@ -96,6 +96,8 @@ public interface ItemPSVI {
     /**
      * <code>[schema normalized value]</code>: the normalized value of this 
      * item after validation. 
+     * 
+     * @deprecated Use getSchemaValue().getNormalizedValue() instead
      */
     public String getSchemaNormalizedValue();
 
@@ -105,6 +107,8 @@ public interface ItemPSVI {
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getSchemaValue().getActualValue() instead
      */
     public Object getActualNormalizedValue()
                                    throws XSException;
@@ -118,11 +122,12 @@ public interface ItemPSVI {
      * method returns <code>LISTOFUNION_DT</code>. To query the actual value 
      * of the list or list of union type definitions use 
      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
-     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
-     * . 
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>. 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     *   
+     *  @deprecated Use getSchemaValue().getActualValueType() instead
      */
     public short getActualNormalizedValueType()
                                    throws XSException;
@@ -157,11 +162,21 @@ public interface ItemPSVI {
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     *  
+     *  @deprecated Use getSchemaValue().getListValueTypes() instead
      */
     public ShortList getItemValueTypes()
                                    throws XSException;
 
     /**
+     * If this item has a simple type definition or a complex type with simple
+     * content, then return the value with respect to the simple type. If
+     * this item doesn't have a simple-typed value, the behavior of this method
+     * is not specified.
+     */
+    public XSValue getSchemaValue();
+    
+    /**
      * <code>[type definition]</code>: an item isomorphic to the type 
      * definition used to validate the schema item. 
      */

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeDeclaration.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeDeclaration.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeDeclaration.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeDeclaration.java Mon Oct 18 22:06:35 2010
@@ -48,6 +48,8 @@ public interface XSAttributeDeclaration 
     /**
      * Value constraint: The constraint value with respect to the [type 
      * definition], otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
      */
     public String getConstraintValue();
 
@@ -58,6 +60,8 @@ public interface XSAttributeDeclaration 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     *  
+     *  @deprecated Use getValueConstraintValue().getActualValue() instead
      */
     public Object getActualVC()
                                                         throws XSException;
@@ -75,6 +79,8 @@ public interface XSAttributeDeclaration 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     *  
+     *  @deprecated Use getValueConstraintValue().getActualValueType() instead
      */
     public short getActualVCType()
                                                         throws XSException;
@@ -91,11 +97,18 @@ public interface XSAttributeDeclaration 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     *   
+     *  @deprecated Use getValueConstraintValue().getListValueTypes() instead
      */
     public ShortList getItemValueTypes()
                                                         throws XSException;
 
     /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
      * An annotation if it exists, otherwise <code>null</code>. 
      * If not null then the first [annotation] from the sequence of annotations.
      */

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeUse.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeUse.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeUse.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSAttributeUse.java Mon Oct 18 22:06:35 2010
@@ -35,12 +35,14 @@ public interface XSAttributeUse extends 
     public XSAttributeDeclaration getAttrDeclaration();
 
     /**
-     * Value Constraint: one of default, fixed. 
+     * Value Constraint: one of default, fixed, or none.
      */
     public short getConstraintType();
 
     /**
      * Value Constraint: The constraint value, otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
      */
     public String getConstraintValue();
 
@@ -51,6 +53,8 @@ public interface XSAttributeUse extends 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValue() instead
      */
     public Object getActualVC()
                                        throws XSException;
@@ -64,11 +68,12 @@ public interface XSAttributeUse extends 
      * method returns <code>LISTOFUNION_DT</code>. To query the actual 
      * constraint value of the list or list of union type definitions use 
      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
-     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
-     * . 
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>. 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValueType() instead
      */
     public short getActualVCType()
                                        throws XSException;
@@ -85,11 +90,18 @@ public interface XSAttributeUse extends 
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getListValueTypes() instead
      */
     public ShortList getItemValueTypes()
                                        throws XSException;
 
     /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
      * A sequence of [annotations] or an empty <code>XSObjectList</code>.
      */
     public XSObjectList getAnnotations();    

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSElementDeclaration.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSElementDeclaration.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSElementDeclaration.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSElementDeclaration.java Mon Oct 18 22:06:35 2010
@@ -49,6 +49,8 @@ public interface XSElementDeclaration ex
     /**
      * [Value constraint]: the constraint value with respect to the [type 
      * definition], otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
      */
     public String getConstraintValue();
 
@@ -59,6 +61,8 @@ public interface XSElementDeclaration ex
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValue() instead
      */
     public Object getActualVC()
                                             throws XSException;
@@ -72,11 +76,12 @@ public interface XSElementDeclaration ex
      * method returns <code>LISTOFUNION_DT</code>. To query the actual 
      * constraint value of the list or list of union type definitions use 
      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
-     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
-     * . 
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>.
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValueType() instead
      */
     public short getActualVCType()
                                             throws XSException;
@@ -93,11 +98,18 @@ public interface XSElementDeclaration ex
      * @exception XSException
      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
      *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getListValueTypes() instead
      */
     public ShortList getItemValueTypes()
                                             throws XSException;
 
     /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
      *  If nillable is true, then an element may also be valid if it carries 
      * the namespace qualified attribute with local name <code>nil</code> 
      * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code> 

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSFacet.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSFacet.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSFacet.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSFacet.java Mon Oct 18 22:06:35 2010
@@ -34,6 +34,24 @@ public interface XSFacet extends XSObjec
     public String getLexicalFacetValue();
 
     /**
+     * If this facet is length, minLength, maxLength, totalDigits, or
+     * fractionDigits, and if the value can fit in "int", then return the value
+     * of the facet as an int. If the value can't fit, return -1. Use
+     * getActualFacetValue() to get the BigInteger representation. For all other
+     * facets, return 0.
+     */
+    public int getIntFacetValue();
+
+    /**
+     * If this facet is minInclusive, maxInclusive, minExclusive, or
+     * maxExclusive, then return the actual value of the facet. If this facet
+     * is length, minLength, maxLength, totalDigits, or fractionDigits, then
+     * return a BigInteger representation of the value. If this facet is
+     * whiteSpace, then return the String representation of the facet.
+     */
+    public Object getActualFacetValue();
+
+    /**
      * [Facets]: check whether a facet is fixed. 
      */
     public boolean getFixed();

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSModel.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSModel.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSModel.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSModel.java Mon Oct 18 22:06:35 2010
@@ -41,7 +41,9 @@ public interface XSModel {
 
     /**
      * Returns a list of top-level components, i.e. element declarations, 
-     * attribute declarations, etc. 
+     * attribute declarations, etc. Identity-constraint definitions are also
+     * considered top-level.
+     * 
      * @param objectType The type of the declaration, i.e. 
      *   <code>ELEMENT_DECLARATION</code>. Note that 
      *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and 
@@ -57,7 +59,9 @@ public interface XSModel {
     /**
      * Convenience method. Returns a list of top-level component declarations 
      * that are defined within the specified namespace, i.e. element 
-     * declarations, attribute declarations, etc. 
+     * declarations, attribute declarations, etc. Identity-constraint
+     * definitions are also considered top-level.
+     * 
      * @param objectType The type of the declaration, i.e. 
      *   <code>ELEMENT_DECLARATION</code>.
      * @param namespace The namespace to which the declaration belongs or 
@@ -143,6 +147,17 @@ public interface XSModel {
                                                         String namespace);
     
     /**
+     * Convenience method. Returns an identity-constraint definition.
+     * @param name The name of the definition.
+     * @param namespace The namespace of the definition, otherwise 
+     *   <code>null</code>.
+     * @return An identity-constraint definition or <code>null</code> if such 
+     *   a declaration does not exist. 
+     */
+    public XSIDCDefinition getIDCDefinition(String name,
+                                            String namespace);
+    
+    /**
      * Convenience method. Returns a list containing the members of the
      * substitution group for the given <code>XSElementDeclaration</code>
      * or an empty <code>XSObjectList</code> if the substitution group

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSMultiValueFacet.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSMultiValueFacet.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSMultiValueFacet.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSMultiValueFacet.java Mon Oct 18 22:06:35 2010
@@ -17,6 +17,8 @@
 
 package org.apache.xerces.xs;
 
+import org.apache.xerces.xs.datatypes.ObjectList;
+
 /**
  * Describes a multi-value constraining facets: pattern and enumeration.
  */
@@ -33,6 +35,11 @@ public interface XSMultiValueFacet exten
     public StringList getLexicalFacetValues();
 
     /**
+     * A list of XSValue objects. The actual enumeration values.
+     */
+    public ObjectList getEnumerationValues();
+
+    /**
      * A sequence of [annotations] or an empty <code>XSObjectList</code>.
      */
     public XSObjectList getAnnotations();

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSNamespaceItem.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSNamespaceItem.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSNamespaceItem.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSNamespaceItem.java Mon Oct 18 22:06:35 2010
@@ -30,7 +30,9 @@ public interface XSNamespaceItem {
 
     /**
      * [schema components]: a list of top-level components, i.e. element 
-     * declarations, attribute declarations, etc. 
+     * declarations, attribute declarations, etc. Identity-constraint
+     * definitions are also considered top-level.
+     * 
      * @param objectType The type of the declaration, i.e. 
      *   <code>ELEMENT_DECLARATION</code>. Note that 
      *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and 
@@ -99,6 +101,14 @@ public interface XSNamespaceItem {
     public XSNotationDeclaration getNotationDeclaration(String name);
 
     /**
+     * Convenience method. Returns an identity-constraint definition.
+     * @param name The name of the definition.
+     * @return An identity-constraint definition or <code>null</code> if such 
+     *   a declaration does not exist. 
+     */
+    public XSIDCDefinition getIDCDefinition(String name);
+
+    /**
      * [document location] - a list of location URIs for the documents that 
      * contributed to the <code>XSModel</code>.
      */

Modified: xerces/java/trunk/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java Mon Oct 18 22:06:35 2010
@@ -232,6 +232,11 @@ public interface XSSimpleTypeDefinition 
     public XSObjectList getMultiValueFacets();
 
     /**
+     * A constraining facet object. An instance of XSFacet or XSMultiValueFacet.
+     */
+    public XSObject getFacet(int facetType);
+
+    /**
      * A sequence of [annotations] or an empty <code>XSObjectList</code>.
      */
     public XSObjectList getAnnotations();

Modified: xerces/java/trunk/src/org/apache/xerces/xs/datatypes/ByteList.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xs/datatypes/ByteList.java?rev=1024038&r1=1024037&r2=1024038&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xs/datatypes/ByteList.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xs/datatypes/ByteList.java Mon Oct 18 22:06:35 2010
@@ -58,4 +58,8 @@ public interface ByteList extends List {
      */
     public byte item(int index) throws XSException;
     
+    /**
+     * Construct and return a byte array for bytes contained in this list.
+     */
+    public byte[] toByteArray();
 }



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