Source Code Cross Referenced for DummyNamespaceResolver.java in  » XML » saxonb » net » sf » saxon » instruct » 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.instruct 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package net.sf.saxon.instruct;
02:
03:        import net.sf.saxon.om.NamespaceConstant;
04:        import net.sf.saxon.om.NamespaceResolver;
05:
06:        import java.io.Serializable;
07:        import java.util.ArrayList;
08:        import java.util.Iterator;
09:        import java.util.List;
10:
11:        /**
12:         * A dummy namespace resolver used when validating QName-valued attributes written to
13:         * the result tree. The namespace node might be created after the initial validation
14:         * of the attribute, so in the first round of validation we only check the lexical form
15:         * of the value, and we defer prefix checks until later.
16:         */
17:
18:        public final class DummyNamespaceResolver implements  Serializable,
19:                NamespaceResolver {
20:
21:            private static DummyNamespaceResolver theInstance = new DummyNamespaceResolver();
22:
23:            /**
24:             * Return the singular instance of this class
25:             * @return the singular instance
26:             */
27:
28:            public static DummyNamespaceResolver getInstance() {
29:                return theInstance;
30:            }
31:
32:            private DummyNamespaceResolver() {
33:            };
34:
35:            /**
36:             * Get the namespace URI corresponding to a given prefix.
37:             * @param prefix the namespace prefix
38:             * @param useDefault true if the default namespace is to be used when the
39:             * prefix is ""
40:             * @return the uri for the namespace, or null if the prefix is not in scope
41:             */
42:
43:            public String getURIForPrefix(String prefix, boolean useDefault) {
44:                if ("".equals(prefix)) {
45:                    return "";
46:                } else if ("xml".equals(prefix)) {
47:                    return NamespaceConstant.XML;
48:                } else {
49:                    // this is a dummy namespace resolver, we don't actually know the URI
50:                    return "";
51:                }
52:            }
53:
54:            /**
55:             * Get an iterator over all the prefixes declared in this namespace context. This will include
56:             * the default namespace (prefix="") and the XML namespace where appropriate
57:             */
58:
59:            public Iterator iteratePrefixes() {
60:                List list = new ArrayList(2);
61:                list.add("");
62:                list.add("xml");
63:                return list.iterator();
64:            }
65:        }
66:
67:        //
68:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
69:        // you may not use this file except in compliance with the License. You may obtain a copy of the
70:        // License at http://www.mozilla.org/MPL/
71:        //
72:        // Software distributed under the License is distributed on an "AS IS" basis,
73:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
74:        // See the License for the specific language governing rights and limitations under the License.
75:        //
76:        // The Original Code is: all this file.
77:        //
78:        // The Initial Developer of the Original Code is Michael H. Kay
79:        //
80:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
81:        //
82:        // Contributor(s): none.
83:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.