jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
author ohair
Sun, 04 Mar 2012 11:55:34 -0800
changeset 12005 a754d69d5e60
permissions -rw-r--r--
7150324: Stop using drop bundles in jaxp Reviewed-by: prr, joehw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     1
/*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     2
 * reserved comment block
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     4
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     5
/*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     6
 * Copyright 2001-2004 The Apache Software Foundation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     7
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    10
 * You may obtain a copy of the License at
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    11
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    12
 *      http://www.apache.org/licenses/LICENSE-2.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    13
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    18
 * limitations under the License.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    19
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    20
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    21
package com.sun.org.apache.xerces.internal.impl.xs.traversers;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    22
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    23
import java.util.Hashtable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    24
import java.util.Iterator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    25
import java.util.Map;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    26
import java.util.StringTokenizer;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    27
import java.util.Vector;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    28
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    29
import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    30
import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    31
import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    32
import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    33
import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    34
import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    35
import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    36
import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    37
import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    38
import com.sun.org.apache.xerces.internal.impl.xs.util.XIntPool;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    39
import com.sun.org.apache.xerces.internal.util.DOMUtil;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    40
import com.sun.org.apache.xerces.internal.util.SymbolTable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    41
import com.sun.org.apache.xerces.internal.util.XMLChar;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    42
import com.sun.org.apache.xerces.internal.util.XMLSymbols;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    43
import com.sun.org.apache.xerces.internal.xni.QName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    44
import com.sun.org.apache.xerces.internal.xs.XSConstants;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    45
import java.util.HashMap;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    46
import org.w3c.dom.Attr;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    47
import org.w3c.dom.Element;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    48
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    49
/**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    50
 * Class <code>XSAttributeCheck</code> is used to check the validity of attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    51
 * appearing in the schema document. It
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    52
 * - reports an error for invalid element (invalid namespace, invalid name)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    53
 * - reports an error for invalid attribute (invalid namespace, invalid name)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    54
 * - reports an error for invalid attribute value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    55
 * - return compiled values for attriute values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    56
 * - provide default value for missing optional attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    57
 * - provide default value for incorrect attribute values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    58
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    59
 * But it's the caller's responsibility to check whether a required attribute
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    60
 * is present.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    61
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    62
 * Things need revisiting:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    63
 * - Whether to return non-schema attributes/values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    64
 * - Do we need to update NamespaceScope and ErrorReporter when reset()?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    65
 * - Should have the datatype validators return compiled value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    66
 * - use symbol table instead of many hashtables
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    67
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    68
 * @xerces.internal
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    69
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    70
 * @author Sandy Gao, IBM
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    71
 * @version $Id: XSAttributeChecker.java,v 1.12 2010-11-01 04:40:02 joehw Exp $
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    72
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    73
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    74
public class XSAttributeChecker {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    75
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    76
    // REVISIT: only local element and attribute are different from others.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    77
    //          it's possible to have either name or ref. all the others
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    78
    //          are only allowed to have one of name or ref, or neither of them.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    79
    //          we'd better move such checking to the traverser.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    80
    private static final String ELEMENT_N = "element_n";
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    81
    private static final String ELEMENT_R = "element_r";
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    82
    private static final String ATTRIBUTE_N = "attribute_n";
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    83
    private static final String ATTRIBUTE_R = "attribute_r";
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    84
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    85
    private static       int ATTIDX_COUNT           = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    86
    public static final int ATTIDX_ABSTRACT        = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    87
    public static final int ATTIDX_AFORMDEFAULT    = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    88
    public static final int ATTIDX_BASE            = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    89
    public static final int ATTIDX_BLOCK           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    90
    public static final int ATTIDX_BLOCKDEFAULT    = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    91
    public static final int ATTIDX_DEFAULT         = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    92
    public static final int ATTIDX_EFORMDEFAULT    = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    93
    public static final int ATTIDX_FINAL           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    94
    public static final int ATTIDX_FINALDEFAULT    = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    95
    public static final int ATTIDX_FIXED           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    96
    public static final int ATTIDX_FORM            = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    97
    public static final int ATTIDX_ID              = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    98
    public static final int ATTIDX_ITEMTYPE        = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    99
    public static final int ATTIDX_MAXOCCURS       = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   100
    public static final int ATTIDX_MEMBERTYPES     = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   101
    public static final int ATTIDX_MINOCCURS       = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   102
    public static final int ATTIDX_MIXED           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   103
    public static final int ATTIDX_NAME            = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   104
    public static final int ATTIDX_NAMESPACE       = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   105
    public static final int ATTIDX_NAMESPACE_LIST  = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   106
    public static final int ATTIDX_NILLABLE        = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   107
    public static final int ATTIDX_NONSCHEMA       = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   108
    public static final int ATTIDX_PROCESSCONTENTS = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   109
    public static final int ATTIDX_PUBLIC          = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   110
    public static final int ATTIDX_REF             = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   111
    public static final int ATTIDX_REFER           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   112
    public static final int ATTIDX_SCHEMALOCATION  = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   113
    public static final int ATTIDX_SOURCE          = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   114
    public static final int ATTIDX_SUBSGROUP       = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   115
    public static final int ATTIDX_SYSTEM          = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   116
    public static final int ATTIDX_TARGETNAMESPACE = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   117
    public static final int ATTIDX_TYPE            = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   118
    public static final int ATTIDX_USE             = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   119
    public static final int ATTIDX_VALUE           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   120
    public static final int ATTIDX_ENUMNSDECLS     = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   121
    public static final int ATTIDX_VERSION         = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   122
    public static final int ATTIDX_XML_LANG        = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   123
    public static final int ATTIDX_XPATH           = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   124
    public static final int ATTIDX_FROMDEFAULT     = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   125
    //public static final int ATTIDX_OTHERVALUES     = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   126
    public static final int ATTIDX_ISRETURNED      = ATTIDX_COUNT++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   127
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   128
    private static final XIntPool fXIntPool = new XIntPool();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   129
    // constants to return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   130
    private static final XInt INT_QUALIFIED      = fXIntPool.getXInt(SchemaSymbols.FORM_QUALIFIED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   131
    private static final XInt INT_UNQUALIFIED    = fXIntPool.getXInt(SchemaSymbols.FORM_UNQUALIFIED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   132
    private static final XInt INT_EMPTY_SET      = fXIntPool.getXInt(XSConstants.DERIVATION_NONE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   133
    private static final XInt INT_ANY_STRICT     = fXIntPool.getXInt(XSWildcardDecl.PC_STRICT);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   134
    private static final XInt INT_ANY_LAX        = fXIntPool.getXInt(XSWildcardDecl.PC_LAX);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   135
    private static final XInt INT_ANY_SKIP       = fXIntPool.getXInt(XSWildcardDecl.PC_SKIP);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   136
    private static final XInt INT_ANY_ANY        = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_ANY);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   137
    private static final XInt INT_ANY_LIST       = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_LIST);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   138
    private static final XInt INT_ANY_NOT        = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_NOT);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   139
    private static final XInt INT_USE_OPTIONAL   = fXIntPool.getXInt(SchemaSymbols.USE_OPTIONAL);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   140
    private static final XInt INT_USE_REQUIRED   = fXIntPool.getXInt(SchemaSymbols.USE_REQUIRED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   141
    private static final XInt INT_USE_PROHIBITED = fXIntPool.getXInt(SchemaSymbols.USE_PROHIBITED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   142
    private static final XInt INT_WS_PRESERVE    = fXIntPool.getXInt(XSSimpleType.WS_PRESERVE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   143
    private static final XInt INT_WS_REPLACE     = fXIntPool.getXInt(XSSimpleType.WS_REPLACE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   144
    private static final XInt INT_WS_COLLAPSE    = fXIntPool.getXInt(XSSimpleType.WS_COLLAPSE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   145
    private static final XInt INT_UNBOUNDED      = fXIntPool.getXInt(SchemaSymbols.OCCURRENCE_UNBOUNDED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   146
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   147
    // used to store the map from element name to attribute list
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   148
    // for 14 global elements
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   149
    private static final Map fEleAttrsMapG = new HashMap(29);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   150
    // for 39 local elememnts
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   151
    private static final Map fEleAttrsMapL = new HashMap(79);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   152
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   153
    // used to initialize fEleAttrsMap
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   154
    // step 1: all possible data types
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   155
    // DT_??? >= 0 : validate using a validator, which is initialized staticly
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   156
    // DT_??? <  0 : validate directly, which is done in "validate()"
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   157
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   158
    protected static final int DT_ANYURI           = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   159
    protected static final int DT_ID               = 1;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   160
    protected static final int DT_QNAME            = 2;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   161
    protected static final int DT_STRING           = 3;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   162
    protected static final int DT_TOKEN            = 4;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   163
    protected static final int DT_NCNAME           = 5;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   164
    protected static final int DT_XPATH            = 6;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   165
    protected static final int DT_XPATH1           = 7;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   166
    protected static final int DT_LANGUAGE         = 8;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   167
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   168
    // used to store extra datatype validators
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   169
    protected static final int DT_COUNT            = DT_LANGUAGE + 1;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   170
    private static final XSSimpleType[] fExtraDVs = new XSSimpleType[DT_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   171
    static {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   172
        // step 5: register all datatype validators for new types
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   173
        SchemaGrammar grammar = SchemaGrammar.SG_SchemaNS;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   174
        // anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   175
        fExtraDVs[DT_ANYURI] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_ANYURI);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   176
        // ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   177
        fExtraDVs[DT_ID] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_ID);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   178
        // QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   179
        fExtraDVs[DT_QNAME] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_QNAME);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   180
        // string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   181
        fExtraDVs[DT_STRING] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   182
        // token
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   183
        fExtraDVs[DT_TOKEN] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_TOKEN);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   184
        // NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   185
        fExtraDVs[DT_NCNAME] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_NCNAME);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   186
        // xpath = a subset of XPath expression
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   187
        fExtraDVs[DT_XPATH] = fExtraDVs[DT_STRING];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   188
        // xpath = a subset of XPath expression
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   189
        fExtraDVs[DT_XPATH] = fExtraDVs[DT_STRING];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   190
        // language
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   191
        fExtraDVs[DT_LANGUAGE] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_LANGUAGE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   192
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   193
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   194
    protected static final int DT_BLOCK            = -1;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   195
    protected static final int DT_BLOCK1           = -2;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   196
    protected static final int DT_FINAL            = -3;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   197
    protected static final int DT_FINAL1           = -4;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   198
    protected static final int DT_FINAL2           = -5;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   199
    protected static final int DT_FORM             = -6;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   200
    protected static final int DT_MAXOCCURS        = -7;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   201
    protected static final int DT_MAXOCCURS1       = -8;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   202
    protected static final int DT_MEMBERTYPES      = -9;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   203
    protected static final int DT_MINOCCURS1       = -10;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   204
    protected static final int DT_NAMESPACE        = -11;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   205
    protected static final int DT_PROCESSCONTENTS  = -12;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   206
    protected static final int DT_USE              = -13;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   207
    protected static final int DT_WHITESPACE       = -14;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   208
    protected static final int DT_BOOLEAN          = -15;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   209
    protected static final int DT_NONNEGINT        = -16;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   210
    protected static final int DT_POSINT           = -17;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   211
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   212
    static {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   213
        // step 2: all possible attributes for all elements
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   214
        int attCount = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   215
        int ATT_ABSTRACT_D          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   216
        int ATT_ATTRIBUTE_FD_D      = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   217
        int ATT_BASE_R              = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   218
        int ATT_BASE_N              = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   219
        int ATT_BLOCK_N             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   220
        int ATT_BLOCK1_N            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   221
        int ATT_BLOCK_D_D           = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   222
        int ATT_DEFAULT_N           = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   223
        int ATT_ELEMENT_FD_D        = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   224
        int ATT_FINAL_N             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   225
        int ATT_FINAL1_N            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   226
        int ATT_FINAL_D_D           = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   227
        int ATT_FIXED_N             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   228
        int ATT_FIXED_D             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   229
        int ATT_FORM_N              = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   230
        int ATT_ID_N                = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   231
        int ATT_ITEMTYPE_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   232
        int ATT_MAXOCCURS_D         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   233
        int ATT_MAXOCCURS1_D        = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   234
        int ATT_MEMBER_T_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   235
        int ATT_MINOCCURS_D         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   236
        int ATT_MINOCCURS1_D        = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   237
        int ATT_MIXED_D             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   238
        int ATT_MIXED_N             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   239
        int ATT_NAME_R              = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   240
        int ATT_NAMESPACE_D         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   241
        int ATT_NAMESPACE_N         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   242
        int ATT_NILLABLE_D          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   243
        int ATT_PROCESS_C_D         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   244
        int ATT_PUBLIC_R            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   245
        int ATT_REF_R               = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   246
        int ATT_REFER_R             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   247
        int ATT_SCHEMA_L_R          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   248
        int ATT_SCHEMA_L_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   249
        int ATT_SOURCE_N            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   250
        int ATT_SUBSTITUTION_G_N    = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   251
        int ATT_SYSTEM_N            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   252
        int ATT_TARGET_N_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   253
        int ATT_TYPE_N              = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   254
        int ATT_USE_D               = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   255
        int ATT_VALUE_NNI_N         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   256
        int ATT_VALUE_PI_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   257
        int ATT_VALUE_STR_N         = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   258
        int ATT_VALUE_WS_N          = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   259
        int ATT_VERSION_N           = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   260
        int ATT_XML_LANG            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   261
        int ATT_XPATH_R             = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   262
        int ATT_XPATH1_R            = attCount++;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   263
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   264
        // step 3: store all these attributes in an array
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   265
        OneAttr[] allAttrs = new OneAttr[attCount];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   266
        allAttrs[ATT_ABSTRACT_D]        =   new OneAttr(SchemaSymbols.ATT_ABSTRACT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   267
                                                        DT_BOOLEAN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   268
                                                        ATTIDX_ABSTRACT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   269
                                                        Boolean.FALSE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   270
        allAttrs[ATT_ATTRIBUTE_FD_D]    =   new OneAttr(SchemaSymbols.ATT_ATTRIBUTEFORMDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   271
                                                        DT_FORM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   272
                                                        ATTIDX_AFORMDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   273
                                                        INT_UNQUALIFIED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   274
        allAttrs[ATT_BASE_R]            =   new OneAttr(SchemaSymbols.ATT_BASE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   275
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   276
                                                        ATTIDX_BASE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   277
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   278
        allAttrs[ATT_BASE_N]            =   new OneAttr(SchemaSymbols.ATT_BASE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   279
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   280
                                                        ATTIDX_BASE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   281
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   282
        allAttrs[ATT_BLOCK_N]           =   new OneAttr(SchemaSymbols.ATT_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   283
                                                        DT_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   284
                                                        ATTIDX_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   285
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   286
        allAttrs[ATT_BLOCK1_N]          =   new OneAttr(SchemaSymbols.ATT_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   287
                                                        DT_BLOCK1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   288
                                                        ATTIDX_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   289
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   290
        allAttrs[ATT_BLOCK_D_D]         =   new OneAttr(SchemaSymbols.ATT_BLOCKDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   291
                                                        DT_BLOCK,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   292
                                                        ATTIDX_BLOCKDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   293
                                                        INT_EMPTY_SET);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   294
        allAttrs[ATT_DEFAULT_N]         =   new OneAttr(SchemaSymbols.ATT_DEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   295
                                                        DT_STRING,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   296
                                                        ATTIDX_DEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   297
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   298
        allAttrs[ATT_ELEMENT_FD_D]      =   new OneAttr(SchemaSymbols.ATT_ELEMENTFORMDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   299
                                                        DT_FORM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   300
                                                        ATTIDX_EFORMDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   301
                                                        INT_UNQUALIFIED);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   302
        allAttrs[ATT_FINAL_N]           =   new OneAttr(SchemaSymbols.ATT_FINAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   303
                                                        DT_FINAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   304
                                                        ATTIDX_FINAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   305
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   306
        allAttrs[ATT_FINAL1_N]          =   new OneAttr(SchemaSymbols.ATT_FINAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   307
                                                        DT_FINAL1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   308
                                                        ATTIDX_FINAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   309
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   310
        allAttrs[ATT_FINAL_D_D]         =   new OneAttr(SchemaSymbols.ATT_FINALDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   311
                                                        DT_FINAL2,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   312
                                                        ATTIDX_FINALDEFAULT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   313
                                                        INT_EMPTY_SET);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   314
        allAttrs[ATT_FIXED_N]           =   new OneAttr(SchemaSymbols.ATT_FIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   315
                                                        DT_STRING,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   316
                                                        ATTIDX_FIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   317
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   318
        allAttrs[ATT_FIXED_D]           =   new OneAttr(SchemaSymbols.ATT_FIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   319
                                                        DT_BOOLEAN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   320
                                                        ATTIDX_FIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   321
                                                        Boolean.FALSE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   322
        allAttrs[ATT_FORM_N]            =   new OneAttr(SchemaSymbols.ATT_FORM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   323
                                                        DT_FORM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   324
                                                        ATTIDX_FORM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   325
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   326
        allAttrs[ATT_ID_N]              =   new OneAttr(SchemaSymbols.ATT_ID,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   327
                                                        DT_ID,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   328
                                                        ATTIDX_ID,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   329
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   330
        allAttrs[ATT_ITEMTYPE_N]        =   new OneAttr(SchemaSymbols.ATT_ITEMTYPE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   331
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   332
                                                        ATTIDX_ITEMTYPE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   333
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   334
        allAttrs[ATT_MAXOCCURS_D]       =   new OneAttr(SchemaSymbols.ATT_MAXOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   335
                                                        DT_MAXOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   336
                                                        ATTIDX_MAXOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   337
                                                        fXIntPool.getXInt(1));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   338
        allAttrs[ATT_MAXOCCURS1_D]      =   new OneAttr(SchemaSymbols.ATT_MAXOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   339
                                                        DT_MAXOCCURS1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   340
                                                        ATTIDX_MAXOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   341
                                                        fXIntPool.getXInt(1));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   342
        allAttrs[ATT_MEMBER_T_N]        =   new OneAttr(SchemaSymbols.ATT_MEMBERTYPES,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   343
                                                        DT_MEMBERTYPES,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   344
                                                        ATTIDX_MEMBERTYPES,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   345
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   346
        allAttrs[ATT_MINOCCURS_D]       =   new OneAttr(SchemaSymbols.ATT_MINOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   347
                                                        DT_NONNEGINT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   348
                                                        ATTIDX_MINOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   349
                                                        fXIntPool.getXInt(1));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   350
        allAttrs[ATT_MINOCCURS1_D]      =   new OneAttr(SchemaSymbols.ATT_MINOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   351
                                                        DT_MINOCCURS1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   352
                                                        ATTIDX_MINOCCURS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   353
                                                        fXIntPool.getXInt(1));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   354
        allAttrs[ATT_MIXED_D]           =   new OneAttr(SchemaSymbols.ATT_MIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   355
                                                        DT_BOOLEAN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   356
                                                        ATTIDX_MIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   357
                                                        Boolean.FALSE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   358
        allAttrs[ATT_MIXED_N]           =   new OneAttr(SchemaSymbols.ATT_MIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   359
                                                        DT_BOOLEAN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   360
                                                        ATTIDX_MIXED,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   361
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   362
        allAttrs[ATT_NAME_R]            =   new OneAttr(SchemaSymbols.ATT_NAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   363
                                                        DT_NCNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   364
                                                        ATTIDX_NAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   365
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   366
        allAttrs[ATT_NAMESPACE_D]       =   new OneAttr(SchemaSymbols.ATT_NAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   367
                                                        DT_NAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   368
                                                        ATTIDX_NAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   369
                                                        INT_ANY_ANY);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   370
        allAttrs[ATT_NAMESPACE_N]       =   new OneAttr(SchemaSymbols.ATT_NAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   371
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   372
                                                        ATTIDX_NAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   373
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   374
        allAttrs[ATT_NILLABLE_D]        =   new OneAttr(SchemaSymbols.ATT_NILLABLE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   375
                                                        DT_BOOLEAN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   376
                                                        ATTIDX_NILLABLE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   377
                                                        Boolean.FALSE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   378
        allAttrs[ATT_PROCESS_C_D]       =   new OneAttr(SchemaSymbols.ATT_PROCESSCONTENTS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   379
                                                        DT_PROCESSCONTENTS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   380
                                                        ATTIDX_PROCESSCONTENTS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   381
                                                        INT_ANY_STRICT);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   382
        allAttrs[ATT_PUBLIC_R]          =   new OneAttr(SchemaSymbols.ATT_PUBLIC,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   383
                                                        DT_TOKEN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   384
                                                        ATTIDX_PUBLIC,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   385
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   386
        allAttrs[ATT_REF_R]             =   new OneAttr(SchemaSymbols.ATT_REF,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   387
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   388
                                                        ATTIDX_REF,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   389
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   390
        allAttrs[ATT_REFER_R]           =   new OneAttr(SchemaSymbols.ATT_REFER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   391
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   392
                                                        ATTIDX_REFER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   393
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   394
        allAttrs[ATT_SCHEMA_L_R]        =   new OneAttr(SchemaSymbols.ATT_SCHEMALOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   395
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   396
                                                        ATTIDX_SCHEMALOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   397
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   398
        allAttrs[ATT_SCHEMA_L_N]        =   new OneAttr(SchemaSymbols.ATT_SCHEMALOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   399
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   400
                                                        ATTIDX_SCHEMALOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   401
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   402
        allAttrs[ATT_SOURCE_N]          =   new OneAttr(SchemaSymbols.ATT_SOURCE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   403
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   404
                                                        ATTIDX_SOURCE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   405
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   406
        allAttrs[ATT_SUBSTITUTION_G_N]  =   new OneAttr(SchemaSymbols.ATT_SUBSTITUTIONGROUP,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   407
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   408
                                                        ATTIDX_SUBSGROUP,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   409
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   410
        allAttrs[ATT_SYSTEM_N]          =   new OneAttr(SchemaSymbols.ATT_SYSTEM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   411
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   412
                                                        ATTIDX_SYSTEM,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   413
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   414
        allAttrs[ATT_TARGET_N_N]        =   new OneAttr(SchemaSymbols.ATT_TARGETNAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   415
                                                        DT_ANYURI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   416
                                                        ATTIDX_TARGETNAMESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   417
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   418
        allAttrs[ATT_TYPE_N]            =   new OneAttr(SchemaSymbols.ATT_TYPE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   419
                                                        DT_QNAME,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   420
                                                        ATTIDX_TYPE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   421
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   422
        allAttrs[ATT_USE_D]             =   new OneAttr(SchemaSymbols.ATT_USE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   423
                                                        DT_USE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   424
                                                        ATTIDX_USE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   425
                                                        INT_USE_OPTIONAL);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   426
        allAttrs[ATT_VALUE_NNI_N]       =   new OneAttr(SchemaSymbols.ATT_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   427
                                                        DT_NONNEGINT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   428
                                                        ATTIDX_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   429
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   430
        allAttrs[ATT_VALUE_PI_N]        =   new OneAttr(SchemaSymbols.ATT_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   431
                                                        DT_POSINT,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   432
                                                        ATTIDX_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   433
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   434
        allAttrs[ATT_VALUE_STR_N]       =   new OneAttr(SchemaSymbols.ATT_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   435
                                                        DT_STRING,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   436
                                                        ATTIDX_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   437
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   438
        allAttrs[ATT_VALUE_WS_N]        =   new OneAttr(SchemaSymbols.ATT_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   439
                                                        DT_WHITESPACE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   440
                                                        ATTIDX_VALUE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   441
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   442
        allAttrs[ATT_VERSION_N]         =   new OneAttr(SchemaSymbols.ATT_VERSION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   443
                                                        DT_TOKEN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   444
                                                        ATTIDX_VERSION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   445
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   446
        allAttrs[ATT_XML_LANG]          =   new OneAttr(SchemaSymbols.ATT_XML_LANG,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   447
                                                        DT_LANGUAGE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   448
                                                        ATTIDX_XML_LANG,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   449
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   450
        allAttrs[ATT_XPATH_R]           =   new OneAttr(SchemaSymbols.ATT_XPATH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   451
                                                        DT_XPATH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   452
                                                        ATTIDX_XPATH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   453
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   454
        allAttrs[ATT_XPATH1_R]          =   new OneAttr(SchemaSymbols.ATT_XPATH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   455
                                                        DT_XPATH1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   456
                                                        ATTIDX_XPATH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   457
                                                        null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   458
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   459
        // step 4: for each element, make a list of possible attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   460
        Container attrList;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   461
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   462
        // for element "attribute" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   463
        attrList = Container.getContainer(5);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   464
        // default = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   465
        attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   466
        // fixed = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   467
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   468
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   469
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   470
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   471
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   472
        // type = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   473
        attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   474
        fEleAttrsMapG.put(SchemaSymbols.ELT_ATTRIBUTE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   475
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   476
        // for element "attribute" - local name
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   477
        attrList = Container.getContainer(7);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   478
        // default = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   479
        attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   480
        // fixed = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   481
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   482
        // form = (qualified | unqualified)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   483
        attrList.put(SchemaSymbols.ATT_FORM, allAttrs[ATT_FORM_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   484
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   485
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   486
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   487
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   488
        // type = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   489
        attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   490
        // use = (optional | prohibited | required) : optional
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   491
        attrList.put(SchemaSymbols.ATT_USE, allAttrs[ATT_USE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   492
        fEleAttrsMapL.put(ATTRIBUTE_N, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   493
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   494
        // for element "attribute" - local ref
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   495
        attrList = Container.getContainer(5);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   496
        // default = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   497
        attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   498
        // fixed = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   499
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   500
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   501
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   502
        // ref = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   503
        attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   504
        // use = (optional | prohibited | required) : optional
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   505
        attrList.put(SchemaSymbols.ATT_USE, allAttrs[ATT_USE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   506
        fEleAttrsMapL.put(ATTRIBUTE_R, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   507
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   508
        // for element "element" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   509
        attrList = Container.getContainer(10);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   510
        // abstract = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   511
        attrList.put(SchemaSymbols.ATT_ABSTRACT, allAttrs[ATT_ABSTRACT_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   512
        // block = (#all | List of (extension | restriction | substitution))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   513
        attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   514
        // default = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   515
        attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   516
        // final = (#all | List of (extension | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   517
        attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   518
        // fixed = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   519
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   520
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   521
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   522
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   523
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   524
        // nillable = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   525
        attrList.put(SchemaSymbols.ATT_NILLABLE, allAttrs[ATT_NILLABLE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   526
        // substitutionGroup = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   527
        attrList.put(SchemaSymbols.ATT_SUBSTITUTIONGROUP, allAttrs[ATT_SUBSTITUTION_G_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   528
        // type = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   529
        attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   530
        fEleAttrsMapG.put(SchemaSymbols.ELT_ELEMENT, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   531
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   532
        // for element "element" - local name
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   533
        attrList = Container.getContainer(10);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   534
        // block = (#all | List of (extension | restriction | substitution))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   535
        attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   536
        // default = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   537
        attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   538
        // fixed = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   539
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   540
        // form = (qualified | unqualified)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   541
        attrList.put(SchemaSymbols.ATT_FORM, allAttrs[ATT_FORM_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   542
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   543
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   544
        // maxOccurs = (nonNegativeInteger | unbounded)  : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   545
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   546
        // minOccurs = nonNegativeInteger : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   547
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   548
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   549
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   550
        // nillable = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   551
        attrList.put(SchemaSymbols.ATT_NILLABLE, allAttrs[ATT_NILLABLE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   552
        // type = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   553
        attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   554
        fEleAttrsMapL.put(ELEMENT_N, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   555
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   556
        // for element "element" - local ref
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   557
        attrList = Container.getContainer(4);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   558
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   559
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   560
        // maxOccurs = (nonNegativeInteger | unbounded)  : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   561
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   562
        // minOccurs = nonNegativeInteger : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   563
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   564
        // ref = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   565
        attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   566
        fEleAttrsMapL.put(ELEMENT_R, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   567
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   568
        // for element "complexType" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   569
        attrList = Container.getContainer(6);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   570
        // abstract = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   571
        attrList.put(SchemaSymbols.ATT_ABSTRACT, allAttrs[ATT_ABSTRACT_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   572
        // block = (#all | List of (extension | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   573
        attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK1_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   574
        // final = (#all | List of (extension | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   575
        attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   576
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   577
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   578
        // mixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   579
        attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   580
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   581
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   582
        fEleAttrsMapG.put(SchemaSymbols.ELT_COMPLEXTYPE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   583
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   584
        // for element "notation" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   585
        attrList = Container.getContainer(4);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   586
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   587
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   588
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   589
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   590
        // public = A public identifier, per ISO 8879
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   591
        attrList.put(SchemaSymbols.ATT_PUBLIC, allAttrs[ATT_PUBLIC_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   592
        // system = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   593
        attrList.put(SchemaSymbols.ATT_SYSTEM, allAttrs[ATT_SYSTEM_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   594
        fEleAttrsMapG.put(SchemaSymbols.ELT_NOTATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   595
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   596
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   597
        // for element "complexType" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   598
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   599
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   600
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   601
        // mixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   602
        attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   603
        fEleAttrsMapL.put(SchemaSymbols.ELT_COMPLEXTYPE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   604
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   605
        // for element "simpleContent" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   606
        attrList = Container.getContainer(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   607
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   608
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   609
        fEleAttrsMapL.put(SchemaSymbols.ELT_SIMPLECONTENT, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   610
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   611
        // for element "restriction" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   612
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   613
        // base = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   614
        attrList.put(SchemaSymbols.ATT_BASE, allAttrs[ATT_BASE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   615
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   616
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   617
        fEleAttrsMapL.put(SchemaSymbols.ELT_RESTRICTION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   618
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   619
        // for element "extension" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   620
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   621
        // base = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   622
        attrList.put(SchemaSymbols.ATT_BASE, allAttrs[ATT_BASE_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   623
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   624
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   625
        fEleAttrsMapL.put(SchemaSymbols.ELT_EXTENSION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   626
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   627
        // for element "attributeGroup" - local ref
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   628
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   629
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   630
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   631
        // ref = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   632
        attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   633
        fEleAttrsMapL.put(SchemaSymbols.ELT_ATTRIBUTEGROUP, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   634
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   635
        // for element "anyAttribute" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   636
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   637
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   638
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   639
        // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )  : ##any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   640
        attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   641
        // processContents = (lax | skip | strict) : strict
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   642
        attrList.put(SchemaSymbols.ATT_PROCESSCONTENTS, allAttrs[ATT_PROCESS_C_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   643
        fEleAttrsMapL.put(SchemaSymbols.ELT_ANYATTRIBUTE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   644
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   645
        // for element "complexContent" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   646
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   647
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   648
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   649
        // mixed = boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   650
        attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   651
        fEleAttrsMapL.put(SchemaSymbols.ELT_COMPLEXCONTENT, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   652
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   653
        // for element "attributeGroup" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   654
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   655
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   656
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   657
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   658
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   659
        fEleAttrsMapG.put(SchemaSymbols.ELT_ATTRIBUTEGROUP, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   660
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   661
        // for element "group" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   662
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   663
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   664
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   665
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   666
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   667
        fEleAttrsMapG.put(SchemaSymbols.ELT_GROUP, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   668
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   669
        // for element "group" - local ref
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   670
        attrList = Container.getContainer(4);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   671
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   672
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   673
        // maxOccurs = (nonNegativeInteger | unbounded)  : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   674
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   675
        // minOccurs = nonNegativeInteger : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   676
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   677
        // ref = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   678
        attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   679
        fEleAttrsMapL.put(SchemaSymbols.ELT_GROUP, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   680
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   681
        // for element "all" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   682
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   683
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   684
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   685
        // maxOccurs = 1 : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   686
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS1_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   687
        // minOccurs = (0 | 1) : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   688
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS1_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   689
        fEleAttrsMapL.put(SchemaSymbols.ELT_ALL, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   690
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   691
        // for element "choice" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   692
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   693
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   694
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   695
        // maxOccurs = (nonNegativeInteger | unbounded)  : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   696
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   697
        // minOccurs = nonNegativeInteger : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   698
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   699
        fEleAttrsMapL.put(SchemaSymbols.ELT_CHOICE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   700
        // for element "sequence" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   701
        fEleAttrsMapL.put(SchemaSymbols.ELT_SEQUENCE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   702
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   703
        // for element "any" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   704
        attrList = Container.getContainer(5);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   705
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   706
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   707
        // maxOccurs = (nonNegativeInteger | unbounded)  : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   708
        attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   709
        // minOccurs = nonNegativeInteger : 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   710
        attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   711
        // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )  : ##any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   712
        attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   713
        // processContents = (lax | skip | strict) : strict
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   714
        attrList.put(SchemaSymbols.ATT_PROCESSCONTENTS, allAttrs[ATT_PROCESS_C_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   715
        fEleAttrsMapL.put(SchemaSymbols.ELT_ANY, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   716
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   717
        // for element "unique" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   718
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   719
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   720
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   721
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   722
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   723
        fEleAttrsMapL.put(SchemaSymbols.ELT_UNIQUE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   724
        // for element "key" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   725
        fEleAttrsMapL.put(SchemaSymbols.ELT_KEY, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   726
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   727
        // for element "keyref" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   728
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   729
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   730
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   731
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   732
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   733
        // refer = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   734
        attrList.put(SchemaSymbols.ATT_REFER, allAttrs[ATT_REFER_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   735
        fEleAttrsMapL.put(SchemaSymbols.ELT_KEYREF, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   736
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   737
        // for element "selector" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   738
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   739
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   740
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   741
        // xpath = a subset of XPath expression
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   742
        attrList.put(SchemaSymbols.ATT_XPATH, allAttrs[ATT_XPATH_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   743
        fEleAttrsMapL.put(SchemaSymbols.ELT_SELECTOR, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   744
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   745
        // for element "field" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   746
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   747
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   748
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   749
        // xpath = a subset of XPath expression
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   750
        attrList.put(SchemaSymbols.ATT_XPATH, allAttrs[ATT_XPATH1_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   751
        fEleAttrsMapL.put(SchemaSymbols.ELT_FIELD, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   752
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   753
        // for element "annotation" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   754
        attrList = Container.getContainer(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   755
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   756
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   757
        fEleAttrsMapG.put(SchemaSymbols.ELT_ANNOTATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   758
        // for element "annotation" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   759
        fEleAttrsMapL.put(SchemaSymbols.ELT_ANNOTATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   760
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   761
        // for element "appinfo" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   762
        attrList = Container.getContainer(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   763
        // source = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   764
        attrList.put(SchemaSymbols.ATT_SOURCE, allAttrs[ATT_SOURCE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   765
        fEleAttrsMapG.put(SchemaSymbols.ELT_APPINFO, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   766
        fEleAttrsMapL.put(SchemaSymbols.ELT_APPINFO, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   767
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   768
        // for element "documentation" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   769
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   770
        // source = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   771
        attrList.put(SchemaSymbols.ATT_SOURCE, allAttrs[ATT_SOURCE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   772
        // xml:lang = language
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   773
        attrList.put(SchemaSymbols.ATT_XML_LANG, allAttrs[ATT_XML_LANG]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   774
        fEleAttrsMapG.put(SchemaSymbols.ELT_DOCUMENTATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   775
        fEleAttrsMapL.put(SchemaSymbols.ELT_DOCUMENTATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   776
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   777
        // for element "simpleType" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   778
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   779
        // final = (#all | List of (list | union | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   780
        attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL1_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   781
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   782
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   783
        // name = NCName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   784
        attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   785
        fEleAttrsMapG.put(SchemaSymbols.ELT_SIMPLETYPE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   786
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   787
        // for element "simpleType" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   788
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   789
        // final = (#all | List of (list | union | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   790
        attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL1_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   791
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   792
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   793
        fEleAttrsMapL.put(SchemaSymbols.ELT_SIMPLETYPE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   794
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   795
        // for element "restriction" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   796
        // already registered for complexType
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   797
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   798
        // for element "list" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   799
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   800
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   801
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   802
        // itemType = QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   803
        attrList.put(SchemaSymbols.ATT_ITEMTYPE, allAttrs[ATT_ITEMTYPE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   804
        fEleAttrsMapL.put(SchemaSymbols.ELT_LIST, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   805
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   806
        // for element "union" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   807
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   808
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   809
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   810
        // memberTypes = List of QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   811
        attrList.put(SchemaSymbols.ATT_MEMBERTYPES, allAttrs[ATT_MEMBER_T_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   812
        fEleAttrsMapL.put(SchemaSymbols.ELT_UNION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   813
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   814
        // for element "schema" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   815
        attrList = Container.getContainer(8);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   816
        // attributeFormDefault = (qualified | unqualified) : unqualified
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   817
        attrList.put(SchemaSymbols.ATT_ATTRIBUTEFORMDEFAULT, allAttrs[ATT_ATTRIBUTE_FD_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   818
        // blockDefault = (#all | List of (extension | restriction | substitution))  : ''
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   819
        attrList.put(SchemaSymbols.ATT_BLOCKDEFAULT, allAttrs[ATT_BLOCK_D_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   820
        // elementFormDefault = (qualified | unqualified) : unqualified
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   821
        attrList.put(SchemaSymbols.ATT_ELEMENTFORMDEFAULT, allAttrs[ATT_ELEMENT_FD_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   822
        // finalDefault = (#all | List of (extension | restriction | list | union))  : ''
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   823
        attrList.put(SchemaSymbols.ATT_FINALDEFAULT, allAttrs[ATT_FINAL_D_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   824
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   825
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   826
        // targetNamespace = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   827
        attrList.put(SchemaSymbols.ATT_TARGETNAMESPACE, allAttrs[ATT_TARGET_N_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   828
        // version = token
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   829
        attrList.put(SchemaSymbols.ATT_VERSION, allAttrs[ATT_VERSION_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   830
        // xml:lang = language
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   831
        attrList.put(SchemaSymbols.ATT_XML_LANG, allAttrs[ATT_XML_LANG]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   832
        fEleAttrsMapG.put(SchemaSymbols.ELT_SCHEMA, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   833
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   834
        // for element "include" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   835
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   836
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   837
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   838
        // schemaLocation = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   839
        attrList.put(SchemaSymbols.ATT_SCHEMALOCATION, allAttrs[ATT_SCHEMA_L_R]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   840
        fEleAttrsMapG.put(SchemaSymbols.ELT_INCLUDE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   841
        // for element "redefine" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   842
        fEleAttrsMapG.put(SchemaSymbols.ELT_REDEFINE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   843
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   844
        // for element "import" - global
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   845
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   846
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   847
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   848
        // namespace = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   849
        attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   850
        // schemaLocation = anyURI
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   851
        attrList.put(SchemaSymbols.ATT_SCHEMALOCATION, allAttrs[ATT_SCHEMA_L_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   852
        fEleAttrsMapG.put(SchemaSymbols.ELT_IMPORT, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   853
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   854
        // for element "length" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   855
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   856
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   857
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   858
        // value = nonNegativeInteger
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   859
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_NNI_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   860
        // fixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   861
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   862
        fEleAttrsMapL.put(SchemaSymbols.ELT_LENGTH, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   863
        // for element "minLength" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   864
        fEleAttrsMapL.put(SchemaSymbols.ELT_MINLENGTH, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   865
        // for element "maxLength" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   866
        fEleAttrsMapL.put(SchemaSymbols.ELT_MAXLENGTH, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   867
        // for element "fractionDigits" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   868
        fEleAttrsMapL.put(SchemaSymbols.ELT_FRACTIONDIGITS, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   869
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   870
        // for element "totalDigits" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   871
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   872
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   873
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   874
        // value = positiveInteger
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   875
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_PI_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   876
        // fixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   877
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   878
        fEleAttrsMapL.put(SchemaSymbols.ELT_TOTALDIGITS, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   879
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   880
        // for element "pattern" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   881
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   882
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   883
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   884
        // value = string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   885
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   886
        fEleAttrsMapL.put(SchemaSymbols.ELT_PATTERN, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   887
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   888
        // for element "enumeration" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   889
        attrList = Container.getContainer(2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   890
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   891
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   892
        // value = anySimpleType
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   893
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   894
        fEleAttrsMapL.put(SchemaSymbols.ELT_ENUMERATION, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   895
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   896
        // for element "whiteSpace" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   897
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   898
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   899
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   900
        // value = preserve | replace | collapse
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   901
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_WS_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   902
        // fixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   903
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   904
        fEleAttrsMapL.put(SchemaSymbols.ELT_WHITESPACE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   905
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   906
        // for element "maxInclusive" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   907
        attrList = Container.getContainer(3);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   908
        // id = ID
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   909
        attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   910
        // value = anySimpleType
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   911
        attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   912
        // fixed = boolean : false
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   913
        attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   914
        fEleAttrsMapL.put(SchemaSymbols.ELT_MAXINCLUSIVE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   915
        // for element "maxExclusive" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   916
        fEleAttrsMapL.put(SchemaSymbols.ELT_MAXEXCLUSIVE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   917
        // for element "minInclusive" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   918
        fEleAttrsMapL.put(SchemaSymbols.ELT_MININCLUSIVE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   919
        // for element "minExclusive" - local
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   920
        fEleAttrsMapL.put(SchemaSymbols.ELT_MINEXCLUSIVE, attrList);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   921
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   922
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   923
    // used to resolver namespace prefixes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   924
    protected XSDHandler fSchemaHandler = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   925
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   926
    // used to store symbols.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   927
    protected SymbolTable fSymbolTable = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   928
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   929
    // used to store the mapping from processed element to attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   930
    protected Map fNonSchemaAttrs = new HashMap();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   931
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   932
    // temprory vector, used to hold the namespace list
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   933
    protected Vector fNamespaceList = new Vector();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   934
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   935
    // whether this attribute appeared in the current element
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   936
    protected boolean[] fSeen = new boolean[ATTIDX_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   937
    private static boolean[] fSeenTemp = new boolean[ATTIDX_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   938
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   939
    // constructor. Sets fErrorReproter and get datatype validators
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   940
    public XSAttributeChecker(XSDHandler schemaHandler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   941
        fSchemaHandler = schemaHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   942
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   943
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   944
    public void reset(SymbolTable symbolTable) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   945
        fSymbolTable = symbolTable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   946
        fNonSchemaAttrs.clear();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   947
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   948
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   949
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   950
     * Check whether the specified element conforms to the attributes restriction
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   951
     * an array of attribute values is returned. the caller must call
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   952
     * <code>returnAttrArray</code> to return that array.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   953
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   954
     * @param element    which element to check
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   955
     * @param isGlobal   whether a child of &lt;schema&gt; or &lt;redefine&gt;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   956
     * @param schemaDoc  the document where the element lives in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   957
     * @return           an array containing attribute values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   958
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   959
    public Object[] checkAttributes(Element element, boolean isGlobal,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   960
                                    XSDocumentInfo schemaDoc) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   961
        return checkAttributes(element, isGlobal, schemaDoc, false);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   962
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   963
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   964
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   965
     * Check whether the specified element conforms to the attributes restriction
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   966
     * an array of attribute values is returned. the caller must call
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   967
     * <code>returnAttrArray</code> to return that array. This method also takes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   968
     * an extra parameter: if the element is "enumeration", whether to make a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   969
     * copy of the namespace context, so that the value can be resolved as a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   970
     * QName later.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   971
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   972
     * @param element      which element to check
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   973
     * @param isGlobal     whether a child of &lt;schema&gt; or &lt;redefine&gt;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   974
     * @param schemaDoc    the document where the element lives in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   975
     * @param enumAsQName  whether to tread enumeration value as QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   976
     * @return             an array containing attribute values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   977
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   978
    public Object[] checkAttributes(Element element, boolean isGlobal,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   979
                                    XSDocumentInfo schemaDoc, boolean enumAsQName) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   980
        if (element == null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   981
            return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   982
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   983
        // get all attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   984
        Attr[] attrs = DOMUtil.getAttrs(element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   985
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   986
        // update NamespaceSupport
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   987
        resolveNamespace(element, attrs, schemaDoc.fNamespaceSupport);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   988
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   989
        String uri = DOMUtil.getNamespaceURI(element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   990
        String elName = DOMUtil.getLocalName(element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   991
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   992
        if (!SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(uri)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   993
            reportSchemaError("s4s-elt-schema-ns", new Object[] {elName}, element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   994
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   995
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   996
        Map eleAttrsMap = fEleAttrsMapG;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   997
        String lookupName = elName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   998
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   999
        // REVISIT: only local element and attribute are different from others.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1000
        //          it's possible to have either name or ref. all the others
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1001
        //          are only allowed to have one of name or ref, or neither of them.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1002
        //          we'd better move such checking to the traverser.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1003
        if (!isGlobal) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1004
            eleAttrsMap = fEleAttrsMapL;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1005
            if (elName.equals(SchemaSymbols.ELT_ELEMENT)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1006
                if (DOMUtil.getAttr(element, SchemaSymbols.ATT_REF) != null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1007
                    lookupName = ELEMENT_R;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1008
                else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1009
                    lookupName = ELEMENT_N;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1010
            } else if (elName.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1011
                if (DOMUtil.getAttr(element, SchemaSymbols.ATT_REF) != null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1012
                    lookupName = ATTRIBUTE_R;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1013
                else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1014
                    lookupName = ATTRIBUTE_N;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1015
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1016
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1017
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1018
        // get desired attribute list of this element
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1019
        Container attrList = (Container)eleAttrsMap.get(lookupName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1020
        if (attrList == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1021
            // should never gets here.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1022
            // when this method is called, the call already knows that
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1023
            // the element can appear.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1024
            reportSchemaError ("s4s-elt-invalid", new Object[] {elName}, element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1025
            return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1026
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1027
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1028
        //Hashtable attrValues = new Hashtable();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1029
        Object[] attrValues = getAvailableArray();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1030
        //Hashtable otherValues = new Hashtable();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1031
        long fromDefault = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1032
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1033
        // clear the "seen" flag.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1034
        System.arraycopy(fSeenTemp, 0, fSeen, 0, ATTIDX_COUNT);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1035
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1036
        // traverse all attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1037
        int length = attrs.length;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1038
        Attr sattr = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1039
        for (int i = 0; i < length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1040
            sattr = attrs[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1041
            // get the attribute name/value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1042
            //String attrName = DOMUtil.getLocalName(sattr);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1043
            String attrName = sattr.getName();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1044
            String attrURI = DOMUtil.getNamespaceURI(sattr);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1045
            String attrVal = DOMUtil.getValue(sattr);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1046
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1047
            if (attrName.startsWith("xml")) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1048
                String attrPrefix = DOMUtil.getPrefix(sattr);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1049
                // we don't want to add namespace declarations to the non-schema attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1050
                if ("xmlns".equals(attrPrefix) || "xmlns".equals(attrName)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1051
                    continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1052
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1053
                // Both <schema> and <documentation> may have an xml:lang attribute.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1054
                // Set the URI for this attribute to null so that we process it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1055
                // like any other schema attribute.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1056
                else if (SchemaSymbols.ATT_XML_LANG.equals(attrName) &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1057
                        (SchemaSymbols.ELT_SCHEMA.equals(elName) ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1058
                                SchemaSymbols.ELT_DOCUMENTATION.equals(elName))) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1059
                    attrURI = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1060
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1061
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1062
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1063
            // for attributes with namespace prefix
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1064
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1065
            if (attrURI != null && attrURI.length() != 0) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1066
                // attributes with schema namespace are not allowed
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1067
                // and not allowed on "document" and "appInfo"
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1068
                if (attrURI.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1069
                    reportSchemaError ("s4s-att-not-allowed", new Object[] {elName, attrName}, element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1070
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1071
                else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1072
                    if(attrValues[ATTIDX_NONSCHEMA] == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1073
                        // these are usually small
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1074
                        attrValues[ATTIDX_NONSCHEMA] = new Vector(4,2);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1075
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1076
                    ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1077
                    ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrVal);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1078
                    // for attributes from other namespace
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1079
                    // store them in a list, and TRY to validate them after
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1080
                    // schema traversal (because it's "lax")
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1081
                    //otherValues.put(attrName, attrVal);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1082
                    // REVISIT:  actually use this some day...
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1083
                    // String attrRName = attrURI + "," + attrName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1084
                    // Vector values = (Vector)fNonSchemaAttrs.get(attrRName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1085
                    // if (values == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1086
                        // values = new Vector();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1087
                        // values.addElement(attrName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1088
                        // values.addElement(elName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1089
                        // values.addElement(attrVal);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1090
                        // fNonSchemaAttrs.put(attrRName, values);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1091
                    // }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1092
                    // else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1093
                        // values.addElement(elName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1094
                        // values.addElement(attrVal);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1095
                    // }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1096
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1097
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1098
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1099
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1100
            // check whether this attribute is allowed
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1101
            OneAttr oneAttr = attrList.get(attrName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1102
            if (oneAttr == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1103
                reportSchemaError ("s4s-att-not-allowed",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1104
                                   new Object[] {elName, attrName},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1105
                                   element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1106
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1107
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1108
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1109
            // we've seen this attribute
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1110
            fSeen[oneAttr.valueIndex] = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1111
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1112
            // check the value against the datatype
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1113
            try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1114
                // no checking on string needs to be done here.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1115
                // no checking on xpath needs to be done here.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1116
                // xpath values are validated in xpath parser
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1117
                if (oneAttr.dvIndex >= 0) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1118
                    if (oneAttr.dvIndex != DT_STRING &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1119
                        oneAttr.dvIndex != DT_XPATH &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1120
                        oneAttr.dvIndex != DT_XPATH1) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1121
                        XSSimpleType dv = fExtraDVs[oneAttr.dvIndex];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1122
                        Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1123
                        // kludge to handle chameleon includes/redefines...
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1124
                        if (oneAttr.dvIndex == DT_QNAME) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1125
                            QName qname = (QName)avalue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1126
                            if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1127
                                qname.uri = schemaDoc.fTargetNamespace;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1128
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1129
                        attrValues[oneAttr.valueIndex] = avalue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1130
                    } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1131
                        attrValues[oneAttr.valueIndex] = attrVal;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1132
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1133
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1134
                else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1135
                    attrValues[oneAttr.valueIndex] = validate(attrValues, attrName, attrVal, oneAttr.dvIndex, schemaDoc);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1136
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1137
            } catch (InvalidDatatypeValueException ide) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1138
                reportSchemaError ("s4s-att-invalid-value",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1139
                                   new Object[] {elName, attrName, ide.getMessage()},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1140
                                   element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1141
                if (oneAttr.dfltValue != null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1142
                    //attrValues.put(attrName, oneAttr.dfltValue);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1143
                    attrValues[oneAttr.valueIndex] = oneAttr.dfltValue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1144
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1145
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1146
            // For "enumeration", and type is possible to be a QName, we need
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1147
            // to return namespace context for later QName resolution.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1148
            if (elName.equals(SchemaSymbols.ELT_ENUMERATION) && enumAsQName) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1149
                attrValues[ATTIDX_ENUMNSDECLS] = new SchemaNamespaceSupport(schemaDoc.fNamespaceSupport);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1150
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1151
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1152
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1153
        // apply default values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1154
        OneAttr[] reqAttrs = attrList.values;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1155
        for (int i = 0; i < reqAttrs.length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1156
            OneAttr oneAttr = reqAttrs[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1157
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1158
            // if the attribute didn't apprear, and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1159
            // if the attribute is optional with default value, apply it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1160
            if (oneAttr.dfltValue != null && !fSeen[oneAttr.valueIndex]) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1161
                //attrValues.put(oneAttr.name, oneAttr.dfltValue);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1162
                attrValues[oneAttr.valueIndex] = oneAttr.dfltValue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1163
                fromDefault |= (1<<oneAttr.valueIndex);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1164
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1165
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1166
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1167
        attrValues[ATTIDX_FROMDEFAULT] = new Long(fromDefault);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1168
        //attrValues[ATTIDX_OTHERVALUES] = otherValues;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1169
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1170
        // Check that minOccurs isn't greater than maxOccurs.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1171
        // p-props-correct 2.1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1172
        if (attrValues[ATTIDX_MAXOCCURS] != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1173
            int min = ((XInt)attrValues[ATTIDX_MINOCCURS]).intValue();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1174
            int max = ((XInt)attrValues[ATTIDX_MAXOCCURS]).intValue();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1175
            if (max != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1176
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1177
                // maxOccurLimit is only check in secure mode
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1178
                if (fSchemaHandler.fSecureProcessing != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1179
                    String localName = element.getLocalName();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1180
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1181
                // The maxOccurs restriction no longer applies to elements
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1182
                    // and wildcards in a sequence in which they are the only
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1183
                    // particle. These are now validated using a constant
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1184
                    // space algorithm. The restriction still applies to all
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1185
                    // other cases.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1186
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1187
                    // Determine if constant-space algorithm can be applied
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1188
                    final boolean optimize =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1189
                            (localName.equals("element") || localName.equals("any")) &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1190
                            (element.getNextSibling() == null) &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1191
                            (element.getPreviousSibling() == null) &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1192
                            (element.getParentNode().getLocalName().equals("sequence"));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1193
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1194
                    if (!optimize) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1195
                    //Revisit :: IMO this is not right place to check
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1196
                    // maxOccurNodeLimit.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1197
                    int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getMaxOccurNodeLimit();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1198
                    if (max > maxOccurNodeLimit) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1199
                        reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1200
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1201
                        // reset max values in case processing continues on error
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1202
                        attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1203
                                                //new Integer(maxOccurNodeLimit);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1204
                        max = maxOccurNodeLimit;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1205
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1206
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1207
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1208
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1209
                if (min > max) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1210
                    reportSchemaError ("p-props-correct.2.1",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1211
                                       new Object[] {elName, attrValues[ATTIDX_MINOCCURS], attrValues[ATTIDX_MAXOCCURS]},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1212
                                       element);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1213
                    attrValues[ATTIDX_MINOCCURS] = attrValues[ATTIDX_MAXOCCURS];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1214
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1215
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1216
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1217
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1218
        return attrValues;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1219
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1220
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1221
    private Object validate(Object[] attrValues, String attr, String ivalue, int dvIndex,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1222
                            XSDocumentInfo schemaDoc) throws InvalidDatatypeValueException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1223
        if (ivalue == null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1224
            return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1225
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1226
        // To validate these types, we don't actually need to normalize the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1227
        // strings. We only need to remove the whitespace from both ends.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1228
        // In some special cases (list types), StringTokenizer can correctly
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1229
        // process the un-normalized whitespace.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1230
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1231
        String value = XMLChar.trim(ivalue);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1232
        Object retValue = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1233
        Vector memberType;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1234
        int choice;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1235
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1236
        switch (dvIndex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1237
        case DT_BOOLEAN:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1238
            if (value.equals(SchemaSymbols.ATTVAL_FALSE) ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1239
                value.equals(SchemaSymbols.ATTVAL_FALSE_0)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1240
                retValue = Boolean.FALSE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1241
            } else if (value.equals(SchemaSymbols.ATTVAL_TRUE) ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1242
                       value.equals(SchemaSymbols.ATTVAL_TRUE_1)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1243
                retValue = Boolean.TRUE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1244
            } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1245
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "boolean"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1246
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1247
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1248
        case DT_NONNEGINT:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1249
            try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1250
                if (value.length() > 0 && value.charAt(0) == '+')
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1251
                    value = value.substring(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1252
                retValue = fXIntPool.getXInt(Integer.parseInt(value));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1253
            } catch (NumberFormatException e) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1254
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "nonNegativeInteger"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1255
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1256
            if (((XInt)retValue).intValue() < 0)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1257
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "nonNegativeInteger"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1258
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1259
        case DT_POSINT:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1260
            try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1261
                if (value.length() > 0 && value.charAt(0) == '+')
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1262
                    value = value.substring(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1263
                retValue = fXIntPool.getXInt(Integer.parseInt(value));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1264
            } catch (NumberFormatException e) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1265
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "positiveInteger"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1266
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1267
            if (((XInt)retValue).intValue() <= 0)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1268
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "positiveInteger"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1269
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1270
        case DT_BLOCK:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1271
            // block = (#all | List of (extension | restriction | substitution))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1272
            choice = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1273
            if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1274
                choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1275
                         XSConstants.DERIVATION_RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1276
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1277
            else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1278
                StringTokenizer t = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1279
                while (t.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1280
                    String token = t.nextToken ();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1281
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1282
                    if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1283
                        choice |= XSConstants.DERIVATION_EXTENSION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1284
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1285
                    else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1286
                        choice |= XSConstants.DERIVATION_RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1287
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1288
                    else if (token.equals (SchemaSymbols.ATTVAL_SUBSTITUTION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1289
                        choice |= XSConstants.DERIVATION_SUBSTITUTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1290
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1291
                    else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1292
                        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction | substitution))"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1293
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1294
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1295
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1296
            retValue = fXIntPool.getXInt(choice);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1297
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1298
        case DT_BLOCK1:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1299
        case DT_FINAL:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1300
            // block = (#all | List of (extension | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1301
            // final = (#all | List of (extension | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1302
            choice = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1303
            if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1304
                //choice = SchemaSymbols.EXTENSION|SchemaSymbols.RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1305
                // REVISIT: if #all, then make the result the combination of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1306
                //          everything: substitution/externsion/restriction/list/union.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1307
                //          would this be a problem?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1308
                // the reason doing so is that when final/blockFinal on <schema>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1309
                // is #all, it's not always the same as the conbination of those
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1310
                // values allowed by final/blockFinal.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1311
                // for example, finalDefault="#all" is not always the same as
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1312
                // finalDefault="extension restriction".
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1313
                // if finalDefault="#all", final on any simple type would be
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1314
                // "extension restriction list union".
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1315
                choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1316
                         XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1317
                         XSConstants.DERIVATION_UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1318
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1319
            else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1320
                StringTokenizer t = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1321
                while (t.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1322
                    String token = t.nextToken ();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1323
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1324
                    if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1325
                        choice |= XSConstants.DERIVATION_EXTENSION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1326
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1327
                    else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1328
                        choice |= XSConstants.DERIVATION_RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1329
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1330
                    else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1331
                        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction))"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1332
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1333
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1334
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1335
            retValue = fXIntPool.getXInt(choice);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1336
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1337
        case DT_FINAL1:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1338
            // final = (#all | List of (list | union | restriction))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1339
            choice = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1340
            if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1341
                //choice = SchemaSymbols.RESTRICTION|SchemaSymbols.LIST|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1342
                //         SchemaSymbols.UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1343
                // REVISIT: if #all, then make the result the combination of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1344
                //          everything: substitution/externsion/restriction/list/union.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1345
                //          would this be a problem?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1346
                // same reason as above DT_BLOCK1/DT_FINAL
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1347
                choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1348
                         XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1349
                         XSConstants.DERIVATION_UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1350
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1351
            else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1352
                StringTokenizer t = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1353
                while (t.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1354
                    String token = t.nextToken ();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1355
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1356
                    if (token.equals (SchemaSymbols.ATTVAL_LIST)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1357
                        choice |= XSConstants.DERIVATION_LIST;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1358
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1359
                    else if (token.equals (SchemaSymbols.ATTVAL_UNION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1360
                        choice |= XSConstants.DERIVATION_UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1361
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1362
                    else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1363
                        choice |= XSConstants.DERIVATION_RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1364
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1365
                    else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1366
                        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (list | union | restriction))"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1367
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1368
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1369
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1370
            retValue = fXIntPool.getXInt(choice);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1371
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1372
        case DT_FINAL2:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1373
            // finalDefault = (#all | List of (extension | restriction | list | union))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1374
            choice = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1375
            if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1376
                //choice = SchemaSymbols.RESTRICTION|SchemaSymbols.LIST|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1377
                //         SchemaSymbols.UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1378
                // REVISIT: if #all, then make the result the combination of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1379
                //          everything: substitution/externsion/restriction/list/union.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1380
                //          would this be a problem?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1381
                // same reason as above DT_BLOCK1/DT_FINAL
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1382
                choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1383
                         XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1384
                         XSConstants.DERIVATION_UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1385
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1386
            else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1387
                StringTokenizer t = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1388
                while (t.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1389
                    String token = t.nextToken ();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1390
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1391
                    if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1392
                        choice |= XSConstants.DERIVATION_EXTENSION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1393
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1394
                    else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1395
                        choice |= XSConstants.DERIVATION_RESTRICTION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1396
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1397
                    else if (token.equals (SchemaSymbols.ATTVAL_LIST)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1398
                        choice |= XSConstants.DERIVATION_LIST;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1399
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1400
                    else if (token.equals (SchemaSymbols.ATTVAL_UNION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1401
                        choice |= XSConstants.DERIVATION_UNION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1402
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1403
                    else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1404
                        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction | list | union))"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1405
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1406
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1407
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1408
            retValue = fXIntPool.getXInt(choice);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1409
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1410
        case DT_FORM:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1411
            // form = (qualified | unqualified)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1412
            if (value.equals (SchemaSymbols.ATTVAL_QUALIFIED))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1413
                retValue = INT_QUALIFIED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1414
            else if (value.equals (SchemaSymbols.ATTVAL_UNQUALIFIED))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1415
                retValue = INT_UNQUALIFIED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1416
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1417
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1418
                                                        new Object[]{value, "(qualified | unqualified)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1419
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1420
        case DT_MAXOCCURS:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1421
            // maxOccurs = (nonNegativeInteger | unbounded)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1422
            if (value.equals(SchemaSymbols.ATTVAL_UNBOUNDED)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1423
                retValue = INT_UNBOUNDED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1424
            } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1425
                try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1426
                    retValue = validate(attrValues, attr, value, DT_NONNEGINT, schemaDoc);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1427
                } catch (NumberFormatException e) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1428
                    throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(nonNegativeInteger | unbounded)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1429
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1430
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1431
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1432
        case DT_MAXOCCURS1:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1433
            // maxOccurs = 1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1434
            if (value.equals("1"))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1435
                retValue = fXIntPool.getXInt(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1436
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1437
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1438
                                                        new Object[]{value, "(1)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1439
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1440
        case DT_MEMBERTYPES:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1441
            // memberTypes = List of QName
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1442
            memberType = new Vector();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1443
            try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1444
                StringTokenizer t = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1445
                while (t.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1446
                    String token = t.nextToken ();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1447
                    QName qname = (QName)fExtraDVs[DT_QNAME].validate(token, schemaDoc.fValidationContext, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1448
                    // kludge to handle chameleon includes/redefines...
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1449
                    if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1450
                        qname.uri = schemaDoc.fTargetNamespace;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1451
                    memberType.addElement(qname);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1452
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1453
                retValue = memberType;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1454
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1455
            catch (InvalidDatatypeValueException ide) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1456
                throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.2", new Object[]{value, "(List of QName)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1457
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1458
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1459
        case DT_MINOCCURS1:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1460
            // minOccurs = (0 | 1)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1461
            if (value.equals("0"))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1462
                retValue = fXIntPool.getXInt(0);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1463
            else if (value.equals("1"))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1464
                retValue = fXIntPool.getXInt(1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1465
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1466
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1467
                                                        new Object[]{value, "(0 | 1)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1468
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1469
        case DT_NAMESPACE:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1470
            // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1471
            if (value.equals(SchemaSymbols.ATTVAL_TWOPOUNDANY)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1472
                // ##any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1473
                retValue = INT_ANY_ANY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1474
            } else if (value.equals(SchemaSymbols.ATTVAL_TWOPOUNDOTHER)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1475
                // ##other
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1476
                retValue = INT_ANY_NOT;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1477
                String[] list = new String[2];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1478
                list[0] = schemaDoc.fTargetNamespace;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1479
                list[1] = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1480
                attrValues[ATTIDX_NAMESPACE_LIST] = list;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1481
            } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1482
                // list
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1483
                retValue = INT_ANY_LIST;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1484
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1485
                fNamespaceList.removeAllElements();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1486
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1487
                // tokenize
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1488
                StringTokenizer tokens = new StringTokenizer(value, " \n\t\r");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1489
                String token;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1490
                String tempNamespace;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1491
                try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1492
                    while (tokens.hasMoreTokens()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1493
                        token = tokens.nextToken();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1494
                        if (token.equals(SchemaSymbols.ATTVAL_TWOPOUNDLOCAL)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1495
                            tempNamespace = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1496
                        } else if (token.equals(SchemaSymbols.ATTVAL_TWOPOUNDTARGETNS)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1497
                            tempNamespace = schemaDoc.fTargetNamespace;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1498
                        } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1499
                            // we have found namespace URI here
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1500
                            // need to add it to the symbol table
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1501
                            fExtraDVs[DT_ANYURI].validate(token, schemaDoc.fValidationContext, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1502
                            tempNamespace = fSymbolTable.addSymbol(token);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1503
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1504
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1505
                        //check for duplicate namespaces in the list
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1506
                        if (!fNamespaceList.contains(tempNamespace)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1507
                            fNamespaceList.addElement(tempNamespace);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1508
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1509
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1510
                } catch (InvalidDatatypeValueException ide) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1511
                    throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1512
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1513
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1514
                // convert the vector to an array
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1515
                int num = fNamespaceList.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1516
                String[] list = new String[num];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1517
                fNamespaceList.copyInto(list);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1518
                attrValues[ATTIDX_NAMESPACE_LIST] = list;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1519
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1520
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1521
        case DT_PROCESSCONTENTS:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1522
            // processContents = (lax | skip | strict)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1523
            if (value.equals (SchemaSymbols.ATTVAL_STRICT))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1524
                retValue = INT_ANY_STRICT;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1525
            else if (value.equals (SchemaSymbols.ATTVAL_LAX))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1526
                retValue = INT_ANY_LAX;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1527
            else if (value.equals (SchemaSymbols.ATTVAL_SKIP))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1528
                retValue = INT_ANY_SKIP;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1529
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1530
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1531
                                                        new Object[]{value, "(lax | skip | strict)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1532
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1533
        case DT_USE:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1534
            // use = (optional | prohibited | required)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1535
            if (value.equals (SchemaSymbols.ATTVAL_OPTIONAL))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1536
                retValue = INT_USE_OPTIONAL;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1537
            else if (value.equals (SchemaSymbols.ATTVAL_REQUIRED))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1538
                retValue = INT_USE_REQUIRED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1539
            else if (value.equals (SchemaSymbols.ATTVAL_PROHIBITED))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1540
                retValue = INT_USE_PROHIBITED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1541
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1542
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1543
                                                        new Object[]{value, "(optional | prohibited | required)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1544
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1545
        case DT_WHITESPACE:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1546
            // value = preserve | replace | collapse
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1547
            if (value.equals (SchemaSymbols.ATTVAL_PRESERVE))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1548
                retValue = INT_WS_PRESERVE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1549
            else if (value.equals (SchemaSymbols.ATTVAL_REPLACE))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1550
                retValue = INT_WS_REPLACE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1551
            else if (value.equals (SchemaSymbols.ATTVAL_COLLAPSE))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1552
                retValue = INT_WS_COLLAPSE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1553
            else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1554
                throw new InvalidDatatypeValueException("cvc-enumeration-valid",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1555
                                                        new Object[]{value, "(preserve | replace | collapse)"});
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1556
            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1557
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1558
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1559
        return retValue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1560
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1561
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1562
    void reportSchemaFatalError (String key, Object[] args, Element ele) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1563
        fSchemaHandler.reportSchemaFatalError(key, args, ele);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1564
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1565
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1566
    void reportSchemaError (String key, Object[] args, Element ele) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1567
        fSchemaHandler.reportSchemaError(key, args, ele);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1568
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1569
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1570
    // validate attriubtes from non-schema namespaces
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1571
    // REVISIT: why we store the attributes in this way? why not just a list
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1572
    //          of structure {element node, attr name/qname, attr value)?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1573
    // REVISIT: pass the proper element node to reportSchemaError
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1574
    public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1575
        // for all attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1576
        Iterator entries = fNonSchemaAttrs.entrySet().iterator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1577
        XSAttributeDecl attrDecl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1578
        while (entries.hasNext()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1579
            Map.Entry entry = (Map.Entry) entries.next();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1580
            // get name, uri, localpart
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1581
            String attrRName = (String) entry.getKey();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1582
            String attrURI = attrRName.substring(0,attrRName.indexOf(','));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1583
            String attrLocal = attrRName.substring(attrRName.indexOf(',')+1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1584
            // find associated grammar
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1585
            SchemaGrammar sGrammar = grammarBucket.getGrammar(attrURI);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1586
            if (sGrammar == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1587
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1588
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1589
            // and get the datatype validator, if there is one
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1590
            attrDecl = sGrammar.getGlobalAttributeDecl(attrLocal);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1591
            if (attrDecl == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1592
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1593
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1594
            XSSimpleType dv = (XSSimpleType)attrDecl.getTypeDefinition();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1595
            if (dv == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1596
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1597
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1598
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1599
            // get all values appeared with this attribute name
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1600
            Vector values = (Vector) entry.getValue();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1601
            String elName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1602
            String attrName = (String)values.elementAt(0);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1603
            // for each of the values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1604
            int count = values.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1605
            for (int i = 1; i < count; i += 2) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1606
                elName = (String)values.elementAt(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1607
                try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1608
                    // and validate it using the XSSimpleType
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1609
                    // REVISIT: what would be the proper validation context?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1610
                    //          guess we need to save that in the vectors too.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1611
                    dv.validate((String)values.elementAt(i+1), null, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1612
                } catch(InvalidDatatypeValueException ide) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1613
                    reportSchemaError ("s4s-att-invalid-value",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1614
                                       new Object[] {elName, attrName, ide.getMessage()},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1615
                                       null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1616
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1617
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1618
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1619
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1620
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1621
    // normalize the string according to the whiteSpace facet
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1622
    public static String normalize(String content, short ws) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1623
        int len = content == null ? 0 : content.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1624
        if (len == 0 || ws == XSSimpleType.WS_PRESERVE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1625
            return content;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1626
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1627
        StringBuffer sb = new StringBuffer();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1628
        if (ws == XSSimpleType.WS_REPLACE) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1629
            char ch;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1630
            // when it's replace, just replace #x9, #xa, #xd by #x20
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1631
            for (int i = 0; i < len; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1632
                ch = content.charAt(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1633
                if (ch != 0x9 && ch != 0xa && ch != 0xd)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1634
                    sb.append(ch);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1635
                else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1636
                    sb.append((char)0x20);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1637
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1638
        } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1639
            char ch;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1640
            int i;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1641
            boolean isLeading = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1642
            // when it's collapse
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1643
            for (i = 0; i < len; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1644
                ch = content.charAt(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1645
                // append real characters, so we passed leading ws
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1646
                if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1647
                    sb.append(ch);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1648
                    isLeading = false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1649
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1650
                else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1651
                    // for whitespaces, we skip all following ws
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1652
                    for (; i < len-1; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1653
                        ch = content.charAt(i+1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1654
                        if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1655
                            break;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1656
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1657
                    // if it's not a leading or tailing ws, then append a space
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1658
                    if (i < len - 1 && !isLeading)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1659
                        sb.append((char)0x20);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1660
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1661
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1662
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1663
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1664
        return sb.toString();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1665
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1666
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1667
    // the following part implements an attribute-value-array pool.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1668
    // when checkAttribute is called, it calls getAvailableArray to get
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1669
    // an array from the pool; when the caller is done with the array,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1670
    // it calls returnAttrArray to return that array to the pool.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1671
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1672
    // initial size of the array pool. 10 is big enough
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1673
    static final int INIT_POOL_SIZE = 10;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1674
    // the incremental size of the array pool
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1675
    static final int INC_POOL_SIZE  = 10;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1676
    // the array pool
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1677
    Object[][] fArrayPool = new Object[INIT_POOL_SIZE][ATTIDX_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1678
    // used to clear the returned array
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1679
    // I think System.arrayCopy is more efficient than setting 35 fields to null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1680
    private static Object[] fTempArray = new Object[ATTIDX_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1681
    // current position of the array pool (# of arrays not returned)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1682
    int fPoolPos = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1683
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1684
    // get the next available array
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1685
    protected Object[] getAvailableArray() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1686
        // if no array left in the pool, increase the pool size
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1687
        if (fArrayPool.length == fPoolPos) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1688
            // increase size
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1689
            fArrayPool = new Object[fPoolPos+INC_POOL_SIZE][];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1690
            // initialize each *new* array
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1691
            for (int i = fPoolPos; i < fArrayPool.length; i++)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1692
                fArrayPool[i] = new Object[ATTIDX_COUNT];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1693
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1694
        // get the next available one
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1695
        Object[] retArray = fArrayPool[fPoolPos];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1696
        // clear it from the pool. this is for GC: if a caller forget to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1697
        // return the array, we want that array to be GCed.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1698
        fArrayPool[fPoolPos++] = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1699
        // to make sure that one array is not returned twice, we use
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1700
        // the last entry to indicate whether an array is already returned
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1701
        // now set it to false.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1702
        System.arraycopy(fTempArray, 0, retArray, 0, ATTIDX_COUNT-1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1703
        retArray[ATTIDX_ISRETURNED] = Boolean.FALSE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1704
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1705
        return retArray;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1706
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1707
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1708
    // return an array back to the pool
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1709
    public void returnAttrArray(Object[] attrArray, XSDocumentInfo schemaDoc) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1710
        // pop the namespace context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1711
        if (schemaDoc != null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1712
            schemaDoc.fNamespaceSupport.popContext();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1713
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1714
        // if 1. the pool is full; 2. the array is null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1715
        // 3. the array is of wrong size; 4. the array is already returned
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1716
        // then we can't accept this array to be returned
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1717
        if (fPoolPos == 0 ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1718
            attrArray == null ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1719
            attrArray.length != ATTIDX_COUNT ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1720
            ((Boolean)attrArray[ATTIDX_ISRETURNED]).booleanValue()) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1721
            return;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1722
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1723
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1724
        // mark this array as returned
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1725
        attrArray[ATTIDX_ISRETURNED] = Boolean.TRUE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1726
        // better clear nonschema vector
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1727
        if(attrArray[ATTIDX_NONSCHEMA] != null)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1728
            ((Vector)attrArray[ATTIDX_NONSCHEMA]).clear();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1729
        // and put it into the pool
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1730
        fArrayPool[--fPoolPos] = attrArray;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1731
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1732
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1733
    public void resolveNamespace(Element element, Attr[] attrs,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1734
                                 SchemaNamespaceSupport nsSupport) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1735
        // push the namespace context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1736
        nsSupport.pushContext();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1737
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1738
        // search for new namespace bindings
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1739
        int length = attrs.length;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1740
        Attr sattr = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1741
        String rawname, prefix, uri;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1742
        for (int i = 0; i < length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1743
            sattr = attrs[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1744
            rawname = DOMUtil.getName(sattr);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1745
            prefix = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1746
            if (rawname.equals(XMLSymbols.PREFIX_XMLNS))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1747
                prefix = XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1748
            else if (rawname.startsWith("xmlns:"))
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1749
                prefix = fSymbolTable.addSymbol(DOMUtil.getLocalName(sattr));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1750
            if (prefix != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1751
                uri = fSymbolTable.addSymbol(DOMUtil.getValue(sattr));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1752
                nsSupport.declarePrefix(prefix, uri.length()!=0 ? uri : null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1753
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1754
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1755
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1756
}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1757
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1758
class OneAttr {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1759
    // name of the attribute
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1760
    public String name;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1761
    // index of the datatype validator
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1762
    public int dvIndex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1763
    // whether it's optional, and has default value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1764
    public int valueIndex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1765
    // the default value of this attribute
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1766
    public Object dfltValue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1767
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1768
    public OneAttr(String name, int dvIndex, int valueIndex, Object dfltValue) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1769
        this.name = name;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1770
        this.dvIndex = dvIndex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1771
        this.valueIndex = valueIndex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1772
        this.dfltValue = dfltValue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1773
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1774
}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1775
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1776
abstract class Container {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1777
    static final int THRESHOLD = 5;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1778
    static Container getContainer(int size) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1779
        if (size > THRESHOLD)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1780
            return new LargeContainer(size);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1781
        else
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1782
            return new SmallContainer(size);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1783
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1784
    abstract void put(String key, OneAttr value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1785
    abstract OneAttr get(String key);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1786
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1787
    OneAttr[] values;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1788
    int pos = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1789
}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1790
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1791
class SmallContainer extends Container {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1792
    String[] keys;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1793
    SmallContainer(int size) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1794
        keys = new String[size];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1795
        values = new OneAttr[size];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1796
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1797
    void put(String key, OneAttr value) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1798
        keys[pos] = key;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1799
        values[pos++] = value;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1800
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1801
    OneAttr get(String key) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1802
        for (int i = 0; i < pos; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1803
            if (keys[i].equals(key)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1804
                return values[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1805
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1806
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1807
        return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1808
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1809
}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1810
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1811
class LargeContainer extends Container {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1812
    Map items;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1813
    LargeContainer(int size) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1814
        items = new HashMap(size*2+1);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1815
        values = new OneAttr[size];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1816
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1817
    void put(String key, OneAttr value) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1818
        items.put(key, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1819
        values[pos++] = value;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1820
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1821
    OneAttr get(String key) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1822
        OneAttr ret = (OneAttr)items.get(key);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1823
        return ret;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1824
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1825
}