Project

Profile

Help

How to connect?
Download (9.77 KB) Statistics
| Branch: | Revision:

he / src / main / csharp / api / Saxon.Api / NamespaceConstant.cs @ 2cd2299c

1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using JNamespaceConstant = net.sf.saxon.lib.NamespaceConstant;
5

    
6
namespace Saxon.Api
7
{
8

    
9
	/// <summary> 
10
	/// Holds a set of constants representing known namespaces.
11
	/// </summary>
12
    public class NamespaceConstant
13
    {
14

    
15
		/// <summary>
16
		/// A URI representing the null namespace (actually, an empty string)
17
		/// </summary>
18

    
19
	public static readonly String NULL = "";
20

    
21
		/// <summary>
22
		/// Fixed namespace name for XML: "http://www.w3.org/XML/1998/namespace".
23
		/// </summary>
24
    public static readonly String XML = "http://www.w3.org/XML/1998/namespace";
25

    
26
		/// <summary>
27
		/// Fixed namespace name for XSLT: "http://www.w3.org/1999/XSL/Transform"
28
		/// </summary>
29
    public static readonly String XSLT = "http://www.w3.org/1999/XSL/Transform";
30

    
31
		/// <summary>
32
		/// Fixed namespace name for Saxon: "http://saxon.sf.net/"
33
		/// </summary>
34
    public static readonly String SAXON = "http://saxon.sf.net/";
35

    
36
		/// <summary>
37
		/// Fixed namespace name for the export of a Saxon stylesheet package: "http://ns.saxonica.com/xslt/export"
38
		/// </summary>
39
    public static readonly String SAXON_XSLT_EXPORT = "http://ns.saxonica.com/xslt/export";
40

    
41
		/// <summary>
42
		/// Namespace name for XML Schema: "http://www.w3.org/2001/XMLSchema"
43
		/// </summary>
44
    public static readonly String SCHEMA = "http://www.w3.org/2001/XMLSchema";
45

    
46
		/// <summary>
47
		/// XML-schema-defined namespace for use in instance documents ("xsi"): "http://www.w3.org/2001/XMLSchema-instance"
48
		/// </summary>
49
    public static readonly String SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
50

    
51
		/// <summary>
52
		/// Namespace defined in XSD 1.1 for schema versioning: "http://www.w3.org/2007/XMLSchema-versioning"
53
		/// </summary>
54
    public static readonly String SCHEMA_VERSIONING = "http://www.w3.org/2007/XMLSchema-versioning";
55

    
56
		/// <summary>
57
		/// Fixed namespace name for Saxon SQL extension: "http://saxon.sf.net/sql"
58
		/// </summary>
59
    public static readonly String SQL = "http://saxon.sf.net/sql";
60

    
61
		/// <summary>
62
		/// Fixed namespace name for EXSLT/Common: "http://exslt.org/common"
63
		/// </summary>
64
    public static readonly String EXSLT_COMMON = "http://exslt.org/common";
65

    
66
		/// <summary>
67
		/// Fixed namespace name for EXSLT/math: "http://exslt.org/math"
68
		/// </summary>
69
    public static readonly String EXSLT_MATH = "http://exslt.org/math";
70

    
71
		/// <summary>
72
		/// Fixed namespace name for EXSLT/sets: "http://exslt.org/sets"
73
		/// </summary>
74
    public static readonly String EXSLT_SETS = "http://exslt.org/sets";
75

    
76
		/// <summary>
77
		/// Fixed namespace name for EXSLT/date: "http://exslt.org/dates-and-times"
78
		/// </summary>
79
    public static readonly String EXSLT_DATES_AND_TIMES = "http://exslt.org/dates-and-times";
80

    
81
		/// <summary>
82
		/// Fixed namespace name for EXSLT/random: "http://exslt.org/random"
83
		/// </summary>
84
    public static readonly String EXSLT_RANDOM = "http://exslt.org/random";
85

    
86
		/// <summary>
87
		/// The standard namespace for functions and operators: "http://www.w3.org/2005/xpath-functions"
88
		/// </summary>
89
    public static readonly String FN = "http://www.w3.org/2005/xpath-functions";
90

    
91
		/// <summary>
92
		/// The standard namespace for XQuery output declarations: "http://www.w3.org/2010/xslt-xquery-serialization"
93
		/// </summary>
94
    public static readonly String OUTPUT = "http://www.w3.org/2010/xslt-xquery-serialization";
95

    
96

    
97
		/// <summary>
98
		/// The standard namespace for system error codes: "http://www.w3.org/2005/xqt-errors"
99
		/// </summary>
100
    public static readonly String ERR = "http://www.w3.org/2005/xqt-errors";
101

    
102
		/// <summary>
103
		/// Predefined XQuery namespace for local functions: "http://www.w3.org/2005/xquery-local-functions"
104
		/// </summary>
105
    public static readonly String LOCAL = "http://www.w3.org/2005/xquery-local-functions";
106
    
107
		/// <summary>
108
		/// Namespace name for the XPath 3.0 math functions: "http://www.w3.org/2005/xpath-functions/math"
109
		/// </summary>
110
    public static readonly String MATH = "http://www.w3.org/2005/xpath-functions/math";
111

    
112
		/// <summary>
113
		/// Namespace name for XPath 3.0 functions associated with maps: "http://www.w3.org/2005/xpath-functions/map"
114
		/// </summary>
115
    public readonly static String MAP_FUNCTIONS = "http://www.w3.org/2005/xpath-functions/map";
116

    
117
		/// <summary>
118
		/// Namespace name for XPath 3.0 functions associated with arrays: "http://www.w3.org/2005/xpath-functions/array"
119
		/// </summary>
120
    public readonly static String ARRAY_FUNCTIONS = "http://www.w3.org/2005/xpath-functions/array";
121

    
122
		/// <summary>
123
		/// The XHTML namespace: "http://www.w3.org/1999/xhtml"
124
		/// </summary>
125
    public static readonly String XHTML = "http://www.w3.org/1999/xhtml";
126

    
127
		/// <summary>
128
		/// The SVG namespace: "http://www.w3.org/2000/svg"
129
		/// </summary>
130
    public static readonly String SVG = "http://www.w3.org/2000/svg";
131

    
132
		/// <summary>
133
		/// The MathML namespace: "http://www.w3.org/1998/Math/MathML"
134
		/// </summary>
135
    public static readonly String MATHML = "http://www.w3.org/1998/Math/MathML";
136

    
137
		/// <summary>
138
		/// The XMLNS namespace (used in DOM): "http://www.w3.org/2000/xmlns/"
139
		/// </summary>
140
    public static readonly String XMLNS = "http://www.w3.org/2000/xmlns/";
141

    
142
		/// <summary>
143
		/// The XLink namespace: "http://www.w3.org/1999/xlink"
144
		/// </summary>
145
    public static readonly String XLINK = "http://www.w3.org/1999/xlink";
146

    
147
		/// <summary>
148
		/// The xquery-option namespace for the XQuery 3.0 feature names: "http://www.w3.org/2011/xquery-options"
149
		/// </summary>
150
    public static readonly String XQUERY_OPTIONS = "http://www.w3.org/2011/xquery-options";
151

    
152
		/// <summary>
153
		/// The xquery namespace for the XQuery 3.0 declare option: "http://www.w3.org/2012/xquery"
154
		/// </summary>
155
    public static readonly String XQUERY = "http://www.w3.org/2012/xquery";
156

    
157
		/// <summary>
158
		/// Namespace for types representing external Java objects: "http://saxon.sf.net/java-type"
159
		/// </summary>
160
    public static readonly String JAVA_TYPE = "http://saxon.sf.net/java-type";
161

    
162
		/// <summary>
163
		/// Namespace for types representing external .NET objects: "http://saxon.sf.net/clitype"
164
		/// </summary>
165
    public static readonly String DOT_NET_TYPE = "http://saxon.sf.net/clitype";    
166

    
167
		/// <summary>
168
		/// Namespace for names allocated to anonymous types: "http://ns.saxonica.com/anonymous-type". 
169
		/// This exists so that a name fingerprint can be allocated for use as a type annotation.
170
		/// </summary>
171
    public static readonly String ANONYMOUS = "http://ns.saxonica.com/anonymous-type";
172

    
173
		/// <summary>
174
		/// Namespace for the Saxon serialization of the schema component model: "http://ns.saxonica.com/schema-component-model"
175
		/// </summary>
176
    public static readonly String SCM = "http://ns.saxonica.com/schema-component-model";
177

    
178
		/// <summary>
179
		/// URI identifying the Saxon object model for use in the JAXP 1.3 XPath API: "http://saxon.sf.net/jaxp/xpath/om"
180
		/// </summary>
181
    public static readonly String OBJECT_MODEL_SAXON = "http://saxon.sf.net/jaxp/xpath/om";
182

    
183
		/// <summary>
184
		/// URI identifying the Unicode codepoint collation
185
		/// </summary>
186
    public static readonly String CODEPOINT_COLLATION_URI = "http://www.w3.org/2005/xpath-functions/collation/codepoint";
187

    
188
		/// <summary>
189
		/// URI identifying the HML5 ascii-case-blind collation
190
		/// </summary>
191
    public static readonly String HTML5_CASE_BLIND_COLLATION_URI = "http://www.w3.org/2005/xpath-functions/collation/html5-ascii-case-insensitive";
192

    
193
		/// <summary>
194
		/// Namespace for the names of generated global variables: "http://saxon.sf.net/generated-global-variable"
195
		/// </summary>
196
    public static readonly String SAXON_GENERATED_GLOBAL = SAXON + "generated-global-variable";
197

    
198
		/// <summary>
199
		/// Namespace for the Saxon configuration file: "http://saxon.sf.net/ns/configuration"
200
		/// </summary>
201
    public static readonly String SAXON_CONFIGURATION = "http://saxon.sf.net/ns/configuration";
202

    
203
		/// <summary>
204
		/// Namespace for the EXPath zip module: "http://expath.org/ns/zip" 
205
		/// </summary>
206
    public static readonly String EXPATH_ZIP = "http://expath.org/ns/zip";
207

    
208

    
209
		/// <summary>
210
		/// Determine whether a namespace is a reserved namespace
211
		/// </summary>
212
		/// <returns><c>true</c>, if this namespace URI is a reserved namespace, <c>false</c> otherwise.</returns>
213
		/// <param name="uri">the namespace URI to be tested</param>
214
        public static bool isReserved(/*@Nullable*/ String uri) {
215

    
216
            return JNamespaceConstant.isReserved(uri);    
217
        }
218

    
219

    
220

    
221
		/// <summary>
222
		/// Determine whether a namespace is a reserved namespace in XQuery 3.1
223
		/// </summary>
224
		/// <returns><c>true</c>, if this namespace URI is reserved in XQuery 3.1, <c>false</c> otherwise.</returns>
225
		/// <param name="uri">the namespace URI to be tested</param>
226
        public static bool isReservedInQuery31(String uri)
227
        {
228
            return JNamespaceConstant.isReservedInQuery31(uri);
229
        }
230

    
231
		/// <summary>
232
		/// Find a similar namespace to one that is a possible mis-spelling
233
		/// </summary>
234
		/// <returns>the correct spelling of the namespace</returns>
235
		/// <param name="candidate">the possibly mis-spelt namespace</param>
236
        public static String findSimilarNamespace(String candidate) {
237
            return JNamespaceConstant.findSimilarNamespace(candidate);
238
        }
239
    }
240
}
241

    
242
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
243
// Copyright (c) 2020 Saxonica Limited.
244
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
245
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
246
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
247
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
(6-6/11)