1 | /*
|
---|
2 | * Copyright 2003,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: XSConstants.hpp,v $
|
---|
19 | * Revision 1.5 2004/09/08 13:56:08 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.4 2004/07/06 14:58:15 cargilld
|
---|
23 | * Rename VALUE_CONSTRAINT enumeration names to avoid naming conflict with AIX system header which already uses VC_DEFAULT as a macro. Will need to document that this fix breaks source code compatibility.
|
---|
24 | *
|
---|
25 | * Revision 1.3 2004/01/29 11:46:30 cargilld
|
---|
26 | * Code cleanup changes to get rid of various compiler diagnostic messages.
|
---|
27 | *
|
---|
28 | * Revision 1.2 2003/11/06 15:30:04 neilg
|
---|
29 | * first part of PSVI/schema component model implementation, thanks to David Cargill. This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
|
---|
30 | *
|
---|
31 | * Revision 1.1 2003/09/16 14:33:36 neilg
|
---|
32 | * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
|
---|
33 | *
|
---|
34 | */
|
---|
35 |
|
---|
36 | #if !defined(XSCONSTANTS_HPP)
|
---|
37 | #define XSCONSTANTS_HPP
|
---|
38 |
|
---|
39 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
40 | #include <xercesc/util/RefArrayVectorOf.hpp>
|
---|
41 |
|
---|
42 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
43 |
|
---|
44 | /**
|
---|
45 | * This contains constants needed in the schema component model.
|
---|
46 | */
|
---|
47 |
|
---|
48 | // forward definitions for typedefs
|
---|
49 | class XSAnnotation;
|
---|
50 | class XSAttributeUse;
|
---|
51 | class XSFacet;
|
---|
52 | class XSMultiValueFacet;
|
---|
53 | class XSNamespaceItem;
|
---|
54 | class XSParticle;
|
---|
55 | class XSSimpleTypeDefinition;
|
---|
56 |
|
---|
57 | // these typedefs are intended to help hide dependence on utility
|
---|
58 | // classes, as well as to define more intuitive names for commonly
|
---|
59 | // used concepts.
|
---|
60 |
|
---|
61 | typedef RefVectorOf <XSAnnotation> XSAnnotationList;
|
---|
62 | typedef RefVectorOf <XSAttributeUse> XSAttributeUseList;
|
---|
63 | typedef RefVectorOf <XSFacet> XSFacetList;
|
---|
64 | typedef RefVectorOf <XSMultiValueFacet> XSMultiValueFacetList;
|
---|
65 | typedef RefVectorOf <XSNamespaceItem> XSNamespaceItemList;
|
---|
66 | typedef RefVectorOf <XSParticle> XSParticleList;
|
---|
67 | typedef RefVectorOf <XSSimpleTypeDefinition> XSSimpleTypeDefinitionList;
|
---|
68 | typedef RefArrayVectorOf <XMLCh> StringList;
|
---|
69 |
|
---|
70 | class XMLPARSER_EXPORT XSConstants
|
---|
71 | {
|
---|
72 | public:
|
---|
73 |
|
---|
74 | // XML Schema Components
|
---|
75 | enum COMPONENT_TYPE {
|
---|
76 | /**
|
---|
77 | * The object describes an attribute declaration.
|
---|
78 | */
|
---|
79 | ATTRIBUTE_DECLARATION = 1,
|
---|
80 | /**
|
---|
81 | * The object describes an element declaration.
|
---|
82 | */
|
---|
83 | ELEMENT_DECLARATION = 2,
|
---|
84 | /**
|
---|
85 | * The object describes a complex type or simple type definition.
|
---|
86 | */
|
---|
87 | TYPE_DEFINITION = 3,
|
---|
88 | /**
|
---|
89 | * The object describes an attribute use definition.
|
---|
90 | */
|
---|
91 | ATTRIBUTE_USE = 4,
|
---|
92 | /**
|
---|
93 | * The object describes an attribute group definition.
|
---|
94 | */
|
---|
95 | ATTRIBUTE_GROUP_DEFINITION= 5,
|
---|
96 | /**
|
---|
97 | * The object describes a model group definition.
|
---|
98 | */
|
---|
99 | MODEL_GROUP_DEFINITION = 6,
|
---|
100 | /**
|
---|
101 | * A model group.
|
---|
102 | */
|
---|
103 | MODEL_GROUP = 7,
|
---|
104 | /**
|
---|
105 | * The object describes a particle.
|
---|
106 | */
|
---|
107 | PARTICLE = 8,
|
---|
108 | /**
|
---|
109 | * The object describes a wildcard.
|
---|
110 | */
|
---|
111 | WILDCARD = 9,
|
---|
112 | /**
|
---|
113 | * The object describes an identity constraint definition.
|
---|
114 | */
|
---|
115 | IDENTITY_CONSTRAINT = 10,
|
---|
116 | /**
|
---|
117 | * The object describes a notation declaration.
|
---|
118 | */
|
---|
119 | NOTATION_DECLARATION = 11,
|
---|
120 | /**
|
---|
121 | * The object describes an annotation.
|
---|
122 | */
|
---|
123 | ANNOTATION = 12,
|
---|
124 | /**
|
---|
125 | * The object describes a constraining facet.
|
---|
126 | */
|
---|
127 | FACET = 13,
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * The object describes enumeration/pattern facets.
|
---|
131 | */
|
---|
132 | MULTIVALUE_FACET = 14
|
---|
133 | };
|
---|
134 |
|
---|
135 | // Derivation constants
|
---|
136 | enum DERIVATION_TYPE {
|
---|
137 | /**
|
---|
138 | * No constraint is available.
|
---|
139 | */
|
---|
140 | DERIVATION_NONE = 0,
|
---|
141 | /**
|
---|
142 | * <code>XSTypeDefinition</code> final set or
|
---|
143 | * <code>XSElementDeclaration</code> disallowed substitution group.
|
---|
144 | */
|
---|
145 | DERIVATION_EXTENSION = 1,
|
---|
146 | /**
|
---|
147 | * <code>XSTypeDefinition</code> final set or
|
---|
148 | * <code>XSElementDeclaration</code> disallowed substitution group.
|
---|
149 | */
|
---|
150 | DERIVATION_RESTRICTION = 2,
|
---|
151 | /**
|
---|
152 | * <code>XSTypeDefinition</code> final set.
|
---|
153 | */
|
---|
154 | DERIVATION_SUBSTITUTION = 4,
|
---|
155 | /**
|
---|
156 | * <code>XSTypeDefinition</code> final set.
|
---|
157 | */
|
---|
158 | DERIVATION_UNION = 8,
|
---|
159 | /**
|
---|
160 | * <code>XSTypeDefinition</code> final set.
|
---|
161 | */
|
---|
162 | DERIVATION_LIST = 16
|
---|
163 | };
|
---|
164 |
|
---|
165 | // Scope
|
---|
166 | enum SCOPE {
|
---|
167 | /**
|
---|
168 | * The scope of a declaration within named model groups or attribute
|
---|
169 | * groups is <code>absent</code>. The scope of such declaration is
|
---|
170 | * determined when it is used in the construction of complex type
|
---|
171 | * definitions.
|
---|
172 | */
|
---|
173 | SCOPE_ABSENT = 0,
|
---|
174 | /**
|
---|
175 | * A scope of <code>global</code> identifies top-level declarations.
|
---|
176 | */
|
---|
177 | SCOPE_GLOBAL = 1,
|
---|
178 | /**
|
---|
179 | * <code>Locally scoped</code> declarations are available for use only
|
---|
180 | * within the complex type.
|
---|
181 | */
|
---|
182 | SCOPE_LOCAL = 2
|
---|
183 | };
|
---|
184 |
|
---|
185 | // Value Constraint
|
---|
186 | enum VALUE_CONSTRAINT {
|
---|
187 | /**
|
---|
188 | * Indicates that the component does not have any value constraint.
|
---|
189 | */
|
---|
190 | VALUE_CONSTRAINT_NONE = 0,
|
---|
191 | /**
|
---|
192 | * Indicates that there is a default value constraint.
|
---|
193 | */
|
---|
194 | VALUE_CONSTRAINT_DEFAULT = 1,
|
---|
195 | /**
|
---|
196 | * Indicates that there is a fixed value constraint for this attribute.
|
---|
197 | */
|
---|
198 | VALUE_CONSTRAINT_FIXED = 2
|
---|
199 | };
|
---|
200 |
|
---|
201 | private:
|
---|
202 | // -----------------------------------------------------------------------
|
---|
203 | // Unimplemented constructors and operators
|
---|
204 | // -----------------------------------------------------------------------
|
---|
205 | XSConstants();
|
---|
206 | };
|
---|
207 |
|
---|
208 | XERCES_CPP_NAMESPACE_END
|
---|
209 |
|
---|
210 | #endif
|
---|