00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALAN_GenerateEvent_HEADER_GUARD) 00019 #define XALAN_GenerateEvent_HEADER_GUARD 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/XSLT/XSLTDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00029 00030 00031 00032 XALAN_DECLARE_XERCES_CLASS(AttributeList) 00033 00034 00035 00036 XALAN_CPP_NAMESPACE_BEGIN 00037 00038 00039 00040 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType; 00041 00042 00043 00044 /** 00045 * This is the class for events generated by the XSL processor 00046 * after it generates a new node in the result tree. It responds 00047 * to, and so is modeled from, the SAX events that are sent to the 00048 * FormatterListener classes. 00049 * 00050 * @see org.apache.xml.xpath4j.xml.FormatterListener 00051 */ 00052 class XALAN_XSLT_EXPORT GenerateEvent 00053 { 00054 public: 00055 00056 enum EventType 00057 { 00058 /** 00059 * Event type generated when a document begins. 00060 * 00061 */ 00062 EVENTTYPE_STARTDOCUMENT = 1, 00063 00064 /** 00065 * Event type generated when a document ends. 00066 */ 00067 EVENTTYPE_ENDDOCUMENT = 2, 00068 00069 /** 00070 * Event type generated when an element begins (after the attributes have been processed but before the children have been added). 00071 */ 00072 EVENTTYPE_STARTELEMENT = 3, 00073 00074 /** 00075 * Event type generated when an element ends, after it's children have been added. 00076 */ 00077 EVENTTYPE_ENDELEMENT = 4, 00078 00079 /** 00080 * Event type generated for character data (CDATA and Ignorable Whitespace have their own events). 00081 */ 00082 EVENTTYPE_CHARACTERS = 5, 00083 00084 /** 00085 * Event type generated for ignorable whitespace (I'm not sure how much this is actually called. 00086 */ 00087 EVENTTYPE_IGNORABLEWHITESPACE = 6, 00088 00089 /** 00090 * Event type generated for processing instructions. 00091 */ 00092 EVENTTYPE_PI = 7, 00093 00094 /** 00095 * Event type generated after a comment has been added. 00096 */ 00097 EVENTTYPE_COMMENT = 8, 00098 00099 /** 00100 * Event type generate after an entity ref is created. 00101 */ 00102 EVENTTYPE_ENTITYREF = 9, 00103 00104 /** 00105 * Event type generated after CDATA is generated. 00106 */ 00107 EVENTTYPE_CDATA = 10 00108 }; 00109 00110 00111 /** 00112 * Constructor for startDocument, endDocument events. 00113 * 00114 * @param eventType one of the EVENTTYPE_XXX constants 00115 */ 00116 GenerateEvent(EventType eventType, 00117 MemoryManager& theManager); 00118 00119 /** 00120 * Constructor for startElement, endElement events. 00121 * 00122 * @param eventType one of the EVENTTYPE_XXX constants 00123 * @param name name of the element 00124 * @param atts SAX attribute list 00125 */ 00126 GenerateEvent( 00127 EventType eventType, 00128 MemoryManager& theManager, 00129 const XalanDOMChar* name, 00130 AttributeListType* atts); 00131 00132 /** 00133 * Constructor for startElement, endElement events. 00134 * 00135 * @param eventType one of the EVENTTYPE_XXX constants 00136 * @param name name of the element 00137 * @param atts SAX attribute list 00138 */ 00139 GenerateEvent( 00140 EventType eventType, 00141 MemoryManager& theManager, 00142 const XalanDOMString& name, 00143 const AttributeListType* atts = 0); 00144 00145 /** 00146 * Constructor for characters, cdate events. 00147 * 00148 * @param eventType one of the EVENTTYPE_XXX constants 00149 * @param ch char array from the SAX event 00150 * @param start start offset to be used in the char array 00151 * @param length end offset to be used in the chara array 00152 */ 00153 GenerateEvent( 00154 EventType eventType, 00155 MemoryManager& theManager, 00156 const XalanDOMChar* ch, 00157 XalanDOMString::size_type start, 00158 XalanDOMString::size_type length); 00159 00160 /** 00161 * Constructor for processingInstruction events. 00162 * 00163 * @param eventType one of the EVENTTYPE_XXX constants 00164 * @param name name of the processing instruction 00165 * @param data processing instruction data 00166 */ 00167 GenerateEvent( 00168 EventType eventType, 00169 MemoryManager& theManager, 00170 const XalanDOMChar* name, 00171 const XalanDOMChar* data); 00172 00173 /** 00174 * Constructor for comment and entity ref events. 00175 * 00176 * @param processor XSLT processor instance 00177 * @param eventType one of the EVENTTYPE_XXX constants 00178 * @param data comment or entity ref data 00179 */ 00180 GenerateEvent( 00181 EventType eventType, 00182 MemoryManager& theManager, 00183 const XalanDOMChar* data); 00184 00185 /** 00186 * The type of SAX event that was generated, as enumerated in the 00187 * EVENTTYPE_XXX constants above. 00188 */ 00189 EventType m_eventType; 00190 00191 /** 00192 * Character data from a character or cdata event. 00193 */ 00194 XalanDOMString m_characters; 00195 00196 /** 00197 * The start position of the current data in m_characters. 00198 */ 00199 XalanDOMString::size_type m_start; 00200 00201 /** 00202 * The length of the current data in m_characters. 00203 */ 00204 XalanDOMString::size_type m_length; 00205 00206 /** 00207 * The name of the element or PI. 00208 */ 00209 XalanDOMString m_name; 00210 00211 /** 00212 * The string data in the element (comments and PIs). 00213 */ 00214 XalanDOMString m_data; 00215 00216 /** 00217 * The current attribute list. 00218 */ 00219 const AttributeListType* m_pAtts; 00220 private: 00221 // not imlplemented 00222 GenerateEvent(); 00223 GenerateEvent(const GenerateEvent&); 00224 }; 00225 00226 00227 00228 XALAN_CPP_NAMESPACE_END 00229 00230 00231 00232 #endif //XALAN_GenerateEvent_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|