2
* The Apache Software License, Version 1.1
5
* Copyright (c) 2002 The Apache Software Foundation.
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
12
* 1. Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
15
* 2. Redistributions in binary form must reproduce the above copyright
16
* notice, this list of conditions and the following disclaimer in
17
* the documentation and/or other materials provided with the
20
* 3. The end-user documentation included with the redistribution,
21
* if any, must include the following acknowledgment:
22
* "This product includes software developed by the
23
* Apache Software Foundation (http://www.apache.org/)."
24
* Alternately, this acknowledgment may appear in the software itself,
25
* if and wherever such third-party acknowledgments normally appear.
27
* 4. The names "Xerces" and "Apache Software Foundation" must
28
* not be used to endorse or promote products derived from this
29
* software without prior written permission. For written
30
* permission, please contact apache@apache.org.
32
* 5. Products derived from this software may not be called "Apache",
33
* nor may "Apache" appear in their name, without prior written
34
* permission of the Apache Software Foundation.
36
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48
* ====================================================================
50
* This software consists of voluntary contributions made by many
51
* individuals on behalf of the Apache Software Foundation and was
52
* originally based on software copyright (c) 1999, International
53
* Business Machines, Inc., http://www.apache.org. For more
54
* information on the Apache Software Foundation, please see
55
* <http://www.apache.org/>.
58
package org.apache.xerces.xni.grammars;
60
import org.apache.xerces.xni.QName;
61
import org.apache.xerces.xni.XMLAttributes;
64
* All information specific to XML Schema grammars.
66
* @author Sandy Gao, IBM
68
* @version $Id: XMLSchemaDescription.java,v 1.2 2003/11/14 16:54:05 mrglavas Exp $
70
public interface XMLSchemaDescription extends XMLGrammarDescription {
72
// used to indicate what triggered the call
74
* Indicate that the current schema document is <include>d by another
77
public final static short CONTEXT_INCLUDE = 0;
79
* Indicate that the current schema document is <redefine>d by another
82
public final static short CONTEXT_REDEFINE = 1;
84
* Indicate that the current schema document is <import>ed by another
87
public final static short CONTEXT_IMPORT = 2;
89
* Indicate that the current schema document is being preparsed.
91
public final static short CONTEXT_PREPARSE = 3;
93
* Indicate that the parse of the current schema document is triggered
94
* by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
95
* instance document. This value is only used if we don't defer the loading
96
* of schema documents.
98
public final static short CONTEXT_INSTANCE = 4;
100
* Indicate that the parse of the current schema document is triggered by
101
* the occurrence of an element whose namespace is the target namespace
102
* of this schema document. This value is only used if we do defer the
103
* loading of schema documents until a component from that namespace is
104
* referenced from the instance.
106
public final static short CONTEXT_ELEMENT = 5;
108
* Indicate that the parse of the current schema document is triggered by
109
* the occurrence of an attribute whose namespace is the target namespace
110
* of this schema document. This value is only used if we do defer the
111
* loading of schema documents until a component from that namespace is
112
* referenced from the instance.
114
public final static short CONTEXT_ATTRIBUTE = 6;
116
* Indicate that the parse of the current schema document is triggered by
117
* the occurrence of an "xsi:type" attribute, whose value (a QName) has
118
* the target namespace of this schema document as its namespace.
119
* This value is only used if we do defer the loading of schema documents
120
* until a component from that namespace is referenced from the instance.
122
public final static short CONTEXT_XSITYPE = 7;
125
* Get the context. The returned value is one of the pre-defined
126
* CONTEXT_xxx constants.
128
* @return the value indicating the context
130
public short getContextType();
133
* If the context is "include" or "redefine", then return the target
134
* namespace of the enclosing schema document; otherwise, the expected
135
* target namespace of this document.
137
* @return the expected/enclosing target namespace
139
public String getTargetNamespace();
142
* For import and references from the instance document, it's possible to
143
* have multiple hints for one namespace. So this method returns an array,
144
* which contains all location hints.
146
* @return an array of all location hints associated to the expected
149
public String[] getLocationHints();
152
* If a call is triggered by an element/attribute/xsi:type in the instance,
153
* this call returns the name of such triggering component: the name of
154
* the element/attribute, or the value of the xsi:type.
156
* @return the name of the triggering component
158
public QName getTriggeringComponent();
161
* If a call is triggered by an attribute or xsi:type, then this mehtod
162
* returns the enclosing element of such element.
164
* @return the name of the enclosing element
166
public QName getEnclosingElementName();
169
* If a call is triggered by an element/attribute/xsi:type in the instance,
170
* this call returns all attribute of such element (or enclosing element).
172
* @return all attributes of the tiggering/enclosing element
174
public XMLAttributes getAttributes();