Source Code Cross Referenced for NamespaceConstant.java in  » XML » saxonb » net » sf » saxon » om » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » saxonb » net.sf.saxon.om 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.saxon.om;
002:
003:        /**
004:         * This class is not instantiated, it exists to hold a set of constants representing known
005:         * namespaces. For each of these, there is a constant for the namespace URI and for many of
006:         * them, there is a numeric constant used as the code for this namespace in the name pool.
007:         *
008:         * <p>This class also defines constant URIs for some objects other than namespaces -
009:         * for example, URIs that identify the various object models used in the JAXP XPath API,
010:         * and the Unicode codepoint collation URI.</p>
011:         *
012:         * @author Michael H. Kay
013:         */
014:
015:        public class NamespaceConstant {
016:
017:            /**
018:             * A URI representing the null namespace (actually, an empty string)
019:             */
020:
021:            public static final String NULL = "";
022:            /**
023:             * The numeric code representing the null namespace (actually, zero)
024:             */
025:            public static final short NULL_CODE = 0;
026:            /**
027:             * The namespace code for the null namespace
028:             */
029:            public static final int NULL_NAMESPACE_CODE = 0;
030:
031:            /**
032:             * Fixed namespace name for XML: "http://www.w3.org/XML/1998/namespace".
033:             */
034:            public static final String XML = "http://www.w3.org/XML/1998/namespace";
035:            /**
036:             * Numeric code representing the XML namespace
037:             */
038:            public static final short XML_CODE = 1;
039:            /**
040:             * The namespace code for the XML namespace
041:             */
042:            public static final int XML_NAMESPACE_CODE = 0x00010001;
043:
044:            /**
045:             * Fixed namespace name for XSLT: "http://www.w3.org/1999/XSL/Transform"
046:             */
047:            public static final String XSLT = "http://www.w3.org/1999/XSL/Transform";
048:            /**
049:             * Numeric code representing the XSLT namespace
050:             */
051:            public static final short XSLT_CODE = 2;
052:
053:            /**
054:             * Fixed namespace name for SAXON: "http://saxon.sf.net/"
055:             */
056:            public static final String SAXON = "http://saxon.sf.net/";
057:            /**
058:             * Numeric code representing the SAXON namespace
059:             */
060:            public static final short SAXON_CODE = 3;
061:
062:            /**
063:             * Namespace name for XML Schema: "http://www.w3.org/2001/XMLSchema"
064:             */
065:            public static final String SCHEMA = "http://www.w3.org/2001/XMLSchema";
066:            /**
067:             * Numeric code representing the schema namespace
068:             */
069:            public static final short SCHEMA_CODE = 4;
070:
071:            /**
072:             * Namespace for additional XPath-defined data types:
073:             * "http://www.w3.org/2005/04/xpath-datatypes"
074:             */
075:            public static final String XDT = "http://www.w3.org/2005/xpath-datatypes";
076:
077:            /**
078:             * Older versions of XDT namespace
079:             */
080:
081:            public static final String XDT200504 = "http://www.w3.org/2005/04/xpath-datatypes";
082:            public static final String XDT200502 = "http://www.w3.org/2005/02/xpath-datatypes";
083:            public static final String XDT200410 = "http://www.w3.org/2004/10/xpath-datatypes";
084:            public static final String XDT200407 = "http://www.w3.org/2004/07/xpath-datatypes";
085:
086:            /**
087:             * Test whether a namespace is the XDT namespace
088:             */
089:
090:            public static final boolean isXDTNamespace(String uri) {
091:                return uri.equals(XDT) || uri.equals(XDT200504)
092:                        || uri.equals(XDT200502) || uri.equals(XDT200410)
093:                        || uri.equals(XDT200407);
094:            }
095:
096:            /**
097:             * Numeric code representing the schema namespace
098:             */
099:            public static final short XDT_CODE = 5;
100:
101:            /**
102:             * XML-schema-defined namespace for use in instance documents ("xsi")
103:             */
104:            public static final String SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
105:
106:            public static final short XSI_CODE = 6;
107:
108:            /**
109:             * Fixed namespace name for EXSLT/Common: "http://exslt.org/common"
110:             */
111:            public static final String EXSLT_COMMON = "http://exslt.org/common";
112:
113:            /**
114:             * Fixed namespace name for EXSLT/math: "http://exslt.org/math"
115:             */
116:            public static final String EXSLT_MATH = "http://exslt.org/math";
117:
118:            /**
119:             * Fixed namespace name for EXSLT/sets: "http://exslt.org/sets"
120:             */
121:            public static final String EXSLT_SETS = "http://exslt.org/sets";
122:
123:            /**
124:             * Fixed namespace name for EXSLT/date: "http://exslt.org/dates-and-times"
125:             */
126:            public static final String EXSLT_DATES_AND_TIMES = "http://exslt.org/dates-and-times";
127:
128:            /**
129:             * Fixed namespace name for EXSLT/random: "http://exslt.org/random"
130:             */
131:            public static final String EXSLT_RANDOM = "http://exslt.org/random";
132:
133:            /**
134:             * The standard namespace for functions and operators
135:             */
136:            public static final String FN = "http://www.w3.org/2005/xpath-functions";
137:
138:            /**
139:             * The standard namespace for system error codes
140:             */
141:            public static final String ERR = "http://www.w3.org/2005/xqt-errors";
142:
143:            /**
144:             * Predefined XQuery namespace for local functions
145:             */
146:            public static final String LOCAL = "http://www.w3.org/2005/xquery-local-functions";
147:            /**
148:             * Recognize the Microsoft namespace so we can give a suitably sarcastic error message
149:             */
150:
151:            public static final String MICROSOFT_XSL = "http://www.w3.org/TR/WD-xsl";
152:
153:            /**
154:             * The XHTML namespace http://www.w3.org/1999/xhtml
155:             */
156:
157:            public static final String XHTML = "http://www.w3.org/1999/xhtml";
158:
159:            /**
160:             * Namespace for types representing external Java objects
161:             */
162:
163:            public static final String JAVA_TYPE = "http://saxon.sf.net/java-type";
164:
165:            /**
166:             * Namespace for names allocated to anonymous types. This exists so that
167:             * a name fingerprint can be allocated for use as a type annotation.
168:             */
169:
170:            public static final String ANONYMOUS = "http://ns.saxonica.com/anonymous-type";
171:
172:            /**
173:             * URI identifying the Saxon object model for use in the JAXP 1.3 XPath API
174:             */
175:
176:            public static final String OBJECT_MODEL_SAXON = "http://saxon.sf.net/jaxp/xpath/om";
177:
178:            /**
179:             * URI identifying the XOM object model for use in the JAXP 1.3 XPath API
180:             */
181:
182:            public static final String OBJECT_MODEL_XOM = "http://www.xom.nu/jaxp/xpath/xom";
183:
184:            /**
185:             * URI identifying the JDOM object model for use in the JAXP 1.3 XPath API
186:             */
187:
188:            public static final String OBJECT_MODEL_JDOM = "http://jdom.org/jaxp/xpath/jdom";
189:
190:            /**
191:             * URI identifying the Unicode codepoint collation
192:             */
193:
194:            public static final String CODEPOINT_COLLATION_URI = "http://www.w3.org/2005/xpath-functions/collation/codepoint";
195:
196:            /**
197:             * Private constructor: class is never instantiated
198:             */
199:
200:            private NamespaceConstant() {
201:            }
202:
203:            /**
204:             * Determine whether a namespace is a reserved namespace
205:             */
206:
207:            public static final boolean isReserved(String uri) {
208:                return uri.equals(XSLT) || uri.equals(FN) || uri.equals(XML)
209:                        || uri.equals(SCHEMA) || uri.equals(XDT)
210:                        || uri.equals(SCHEMA_INSTANCE);
211:            }
212:
213:            /**
214:             * Determine whether a namespace is a reserved namespace
215:             */
216:
217:            public static final boolean isSpecialURICode(short uriCode) {
218:                return uriCode <= 6;
219:            }
220:
221:            /**
222:             * Determine whether a namespace is a reserved namespace
223:             */
224:
225:            public static final boolean isReservedInQuery(String uri) {
226:                return uri.equals(FN) || uri.equals(XML) || uri.equals(SCHEMA)
227:                        || uri.equals(XDT) || uri.equals(SCHEMA_INSTANCE);
228:            }
229:        }
230:
231:        //
232:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
233:        // you may not use this file except in compliance with the License. You may obtain a copy of the
234:        // License at http://www.mozilla.org/MPL/
235:        //
236:        // Software distributed under the License is distributed on an "AS IS" basis,
237:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
238:        // See the License for the specific language governing rights and limitations under the License.
239:        //
240:        // The Original Code is: all this file.
241:        //
242:        // The Initial Developer of the Original Code is Michael H. Kay.
243:        //
244:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
245:        //
246:        // Contributor(s): none.
247:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.