Source Code Cross Referenced for ElemText.java in  » XML » xalan » org » apache » xalan » templates » 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 » xalan » org.apache.xalan.templates 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: ElemText.java,v 1.10 2004/08/17 18:35:33 jycli Exp $
018:         */
019:        package org.apache.xalan.templates;
020:
021:        import org.apache.xalan.res.XSLTErrorResources;
022:
023:        /**
024:         * Implement xsl:template.
025:         * This primarily acts as a marker on the element
026:         * stack to signal that whitespace should be preserved.
027:         * <pre>
028:         * <!ELEMENT xsl:text (#PCDATA)>
029:         * <!ATTLIST xsl:text
030:         *   disable-output-escaping (yes|no) "no"
031:         * >
032:         * </pre>
033:         * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a>
034:         * @xsl.usage advanced
035:         */
036:        public class ElemText extends ElemTemplateElement {
037:            static final long serialVersionUID = 1383140876182316711L;
038:
039:            /**
040:             * Tells if this element should disable escaping.
041:             * @serial
042:             */
043:            private boolean m_disableOutputEscaping = false;
044:
045:            /**
046:             * Set the "disable-output-escaping" attribute.
047:             * Normally, the xml output method escapes & and < (and
048:             * possibly other characters) when outputting text nodes.
049:             * This ensures that the output is well-formed XML. However,
050:             * it is sometimes convenient to be able to produce output
051:             * that is almost, but not quite well-formed XML; for
052:             * example, the output may include ill-formed sections
053:             * which are intended to be transformed into well-formed
054:             * XML by a subsequent non-XML aware process. For this reason,
055:             * XSLT provides a mechanism for disabling output escaping.
056:             * An xsl:value-of or xsl:text element may have a
057:             * disable-output-escaping attribute; the allowed values
058:             * are yes or no; the default is no; if the value is yes,
059:             * then a text node generated by instantiating the xsl:value-of
060:             * or xsl:text element should be output without any escaping.
061:             * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
062:             *
063:             * @param v Boolean flag indicating whether this element should disable escaping
064:             */
065:            public void setDisableOutputEscaping(boolean v) {
066:                m_disableOutputEscaping = v;
067:            }
068:
069:            /**
070:             * Get the "disable-output-escaping" attribute.
071:             * Normally, the xml output method escapes & and < (and
072:             * possibly other characters) when outputting text nodes.
073:             * This ensures that the output is well-formed XML. However,
074:             * it is sometimes convenient to be able to produce output
075:             * that is almost, but not quite well-formed XML; for
076:             * example, the output may include ill-formed sections
077:             * which are intended to be transformed into well-formed
078:             * XML by a subsequent non-XML aware process. For this reason,
079:             * XSLT provides a mechanism for disabling output escaping.
080:             * An xsl:value-of or xsl:text element may have a
081:             * disable-output-escaping attribute; the allowed values
082:             * are yes or no; the default is no; if the value is yes,
083:             * then a text node generated by instantiating the xsl:value-of
084:             * or xsl:text element should be output without any escaping.
085:             * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
086:             *
087:             * @return Boolean flag indicating whether this element should disable escaping
088:             */
089:            public boolean getDisableOutputEscaping() {
090:                return m_disableOutputEscaping;
091:            }
092:
093:            /**
094:             * Get an integer representation of the element type.
095:             *
096:             * @return An integer representation of the element, defined in the
097:             *     Constants class.
098:             * @see org.apache.xalan.templates.Constants
099:             */
100:            public int getXSLToken() {
101:                return Constants.ELEMNAME_TEXT;
102:            }
103:
104:            /**
105:             * Return the node name.
106:             *
107:             * @return The element's name
108:             */
109:            public String getNodeName() {
110:                return Constants.ELEMNAME_TEXT_STRING;
111:            }
112:
113:            /**
114:             * Add a child to the child list.
115:             *
116:             * @param newChild Child to add to children list
117:             *
118:             * @return Child added to children list
119:             *
120:             * @throws DOMException
121:             */
122:            public ElemTemplateElement appendChild(ElemTemplateElement newChild) {
123:
124:                int type = ((ElemTemplateElement) newChild).getXSLToken();
125:
126:                switch (type) {
127:                case Constants.ELEMNAME_TEXTLITERALRESULT:
128:                    break;
129:                default:
130:                    error(XSLTErrorResources.ER_CANNOT_ADD, new Object[] {
131:                            newChild.getNodeName(), this .getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
132:
133:                    //" to " + this.m_elemName);
134:                }
135:
136:                return super.appendChild(newChild);
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.