Source Code Cross Referenced for ColumnScanEmitter.java in  » Database-DBMS » Ozone-1.1 » com » nwalsh » saxon » 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 » Database DBMS » Ozone 1.1 » com.nwalsh.saxon 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.nwalsh.saxon;
002:
003:        import org.xml.sax.*;
004:        import javax.xml.transform.TransformerException;
005:        import com.icl.saxon.output.*;
006:        import com.icl.saxon.om.*;
007:        import com.icl.saxon.expr.FragmentValue;
008:
009:        /**
010:         * <p>Saxon extension to scan the column widthsin a result tree fragment.</p>
011:         *
012:         * <p>$Id: ColumnScanEmitter.java,v 1.1 2001/07/16 21:23:57 nwalsh Exp $</p>
013:         *
014:         * <p>Copyright (C) 2000 Norman Walsh.</p>
015:         *
016:         * <p>This class provides a
017:         * <a href="http://users.iclway.co.uk/mhkay/saxon/">Saxon 6.*</a>
018:         * implementation to scan the column widths in a result tree
019:         * fragment.</p>
020:         *
021:         * <p>The general design is this: the stylesheets construct a result tree
022:         * fragment for some colgroup environment. That result tree fragment
023:         * is "replayed" through the ColumnScanEmitter; the ColumnScanEmitter watches
024:         * the cols go by and extracts the column widths that it sees. These
025:         * widths are then made available.</p>
026:         *
027:         * <p><b>Change Log:</b></p>
028:         * <dl>
029:         * <dt>1.0</dt>
030:         * <dd><p>Initial release.</p></dd>
031:         * </dl>
032:         *
033:         * @author Norman Walsh
034:         * <a href="mailto:ndw@nwalsh.com">ndw@nwalsh.com</a>
035:         *
036:         * @version $Id: ColumnScanEmitter.java,v 1.1 2001/07/16 21:23:57 nwalsh Exp $
037:         *
038:         */
039:        public class ColumnScanEmitter extends com.icl.saxon.output.Emitter {
040:            /** The number of columns seen. */
041:            protected int numColumns = 0;
042:            protected String width[] = new String[5];
043:            protected NamePool namePool = null;
044:
045:            /** The FO namespace name. */
046:            protected static String foURI = "http://www.w3.org/1999/XSL/Format";
047:
048:            /** Construct a new ColumnScanEmitter. */
049:            public ColumnScanEmitter(NamePool namePool) {
050:                numColumns = 0;
051:                this .namePool = namePool;
052:            }
053:
054:            /** Return the number of columns. */
055:            public int columnCount() {
056:                return numColumns;
057:            }
058:
059:            /** Return the number of columns. */
060:            public String[] columnWidths() {
061:                return width;
062:            }
063:
064:            /** Discarded. */
065:            public void characters(char[] chars, int start, int len)
066:                    throws TransformerException {
067:                // nop
068:            }
069:
070:            /** Discarded. */
071:            public void comment(char[] chars, int start, int length)
072:                    throws TransformerException {
073:                // nop
074:            }
075:
076:            /** Discarded. */
077:            public void endDocument() throws TransformerException {
078:                // nop
079:            }
080:
081:            /** Discarded. */
082:            public void endElement(int nameCode) throws TransformerException {
083:                // nop
084:            }
085:
086:            /** Discarded. */
087:            public void processingInstruction(java.lang.String name,
088:                    java.lang.String data) throws TransformerException {
089:                // nop
090:            }
091:
092:            /** Discarded. */
093:            public void setDocumentLocator(org.xml.sax.Locator locator) {
094:                // nop
095:            }
096:
097:            /** Discarded. */
098:            public void setEscaping(boolean escaping)
099:                    throws TransformerException {
100:                // nop
101:            }
102:
103:            /** Discarded. */
104:            public void setNamePool(NamePool namePool) {
105:                // nop
106:            }
107:
108:            /** Discarded. */
109:            public void setUnparsedEntity(java.lang.String name,
110:                    java.lang.String uri) throws TransformerException {
111:                // nop
112:            }
113:
114:            /** Discarded. */
115:            public void setWriter(java.io.Writer writer) {
116:                // nop
117:            }
118:
119:            /** Discarded. */
120:            public void startDocument() throws TransformerException {
121:                // nop
122:            }
123:
124:            /** Examine for column info. */
125:            public void startElement(int nameCode,
126:                    org.xml.sax.Attributes attributes, int[] namespaces,
127:                    int nscount) throws TransformerException {
128:
129:                int this Fingerprint = namePool.getFingerprint(nameCode);
130:                int colFingerprint = namePool.getFingerprint("", "col");
131:                int foColFingerprint = namePool.getFingerprint(foURI,
132:                        "table-column");
133:
134:                if (this Fingerprint == colFingerprint
135:                        || this Fingerprint == foColFingerprint) {
136:                    if (numColumns >= width.length) {
137:                        String newWidth[] = new String[width.length + 10];
138:                        for (int count = 0; count < width.length; count++) {
139:                            newWidth[count] = width[count];
140:                        }
141:                        width = newWidth;
142:                    }
143:
144:                    if (this Fingerprint == colFingerprint) {
145:                        if (attributes.getValue("width") == null) {
146:                            width[numColumns++] = "1*";
147:                        } else {
148:                            width[numColumns++] = attributes.getValue("width");
149:                        }
150:                    } else {
151:                        if (attributes.getValue("column-width") == null) {
152:                            width[numColumns++] = "1*";
153:                        } else {
154:                            width[numColumns++] = attributes
155:                                    .getValue("column-width");
156:                        }
157:                    }
158:                }
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.