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


001:        package net.sf.saxon.event;
002:
003:        import net.sf.saxon.charcode.UnicodeCharacterSet;
004:        import net.sf.saxon.trans.DynamicError;
005:        import net.sf.saxon.trans.XPathException;
006:
007:        import javax.xml.transform.OutputKeys;
008:
009:        /**
010:         * This class generates TEXT output
011:         * @author Michael H. Kay
012:         */
013:
014:        public class TEXTEmitter extends XMLEmitter {
015:
016:            /**
017:             * Start of the document.
018:             */
019:
020:            public void open() throws XPathException {
021:                // Prevent output of XML declaration
022:                declarationIsWritten = true;
023:
024:                empty = true;
025:
026:                // Write a BOM if requested
027:                String byteOrderMark = outputProperties
028:                        .getProperty(SaxonOutputKeys.BYTE_ORDER_MARK);
029:
030:                if ("yes".equals(byteOrderMark)
031:                        && "UTF-8".equalsIgnoreCase(outputProperties
032:                                .getProperty(OutputKeys.ENCODING))) {
033:                    try {
034:                        openDocument();
035:                        writer.write('\uFEFF');
036:                        empty = false;
037:                    } catch (java.io.IOException err) {
038:                        // Might be an encoding exception; just ignore it
039:                    }
040:                }
041:
042:                if (characterSet == null) {
043:                    characterSet = UnicodeCharacterSet.getInstance();
044:                }
045:            }
046:
047:            /**
048:             * Produce output using the current Writer. <BR>
049:             * Special characters are not escaped.
050:             * @param chars Character sequence to be output
051:             * @param properties bit fields holding special properties of the characters
052:             * @exception XPathException for any failure
053:             */
054:
055:            public void characters(CharSequence chars, int locationId,
056:                    int properties) throws XPathException {
057:                if (empty) {
058:                    openDocument();
059:                }
060:                if ((properties & ReceiverOptions.NO_SPECIAL_CHARS) == 0) {
061:                    int badchar = testCharacters(chars);
062:                    if (badchar != 0) {
063:                        throw new DynamicError(
064:                                "Output character not available in this encoding (decimal "
065:                                        + badchar + ")");
066:                    }
067:                }
068:                try {
069:                    writer.write(chars.toString());
070:                } catch (java.io.IOException err) {
071:                    throw new DynamicError(err);
072:                }
073:            }
074:
075:            /**
076:             * Output an element start tag. <br>
077:             * Does nothing with this output method.
078:             * @param nameCode The element name (tag)
079:             * @param typeCode The type annotation
080:             * @param properties Bit fields holding any special properties of the element
081:             */
082:
083:            public void startElement(int nameCode, int typeCode,
084:                    int locationId, int properties) {
085:                // no-op
086:            }
087:
088:            public void namespace(int namespaceCode, int properties) {
089:            }
090:
091:            public void attribute(int nameCode, int typeCode,
092:                    CharSequence value, int locationId, int properties) {
093:            }
094:
095:            /**
096:             * Output an element end tag. <br>
097:             * Does nothing  with this output method.
098:             */
099:
100:            public void endElement() {
101:                // no-op
102:            }
103:
104:            /**
105:             * Output a processing instruction. <br>
106:             * Does nothing  with this output method.
107:             */
108:
109:            public void processingInstruction(String name, CharSequence value,
110:                    int locationId, int properties) throws XPathException {
111:            }
112:
113:            /**
114:             * Output a comment. <br>
115:             * Does nothing with this output method.
116:             */
117:
118:            public void comment(CharSequence chars, int locationId,
119:                    int properties) throws XPathException {
120:            }
121:
122:        }
123:
124:        //
125:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
126:        // you may not use this file except in compliance with the License. You may obtain a copy of the
127:        // License at http://www.mozilla.org/MPL/
128:        //
129:        // Software distributed under the License is distributed on an "AS IS" basis,
130:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
131:        // See the License for the specific language governing rights and limitations under the License.
132:        //
133:        // The Original Code is: all this file.
134:        //
135:        // The Initial Developer of the Original Code is Michael H. Kay.
136:        //
137:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
138:        //
139:        // Contributor(s): none.
140:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.