Xalan-C++ API Reference  1.12.0
GenerateEvent.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALAN_GenerateEvent_HEADER_GUARD)
19 #define XALAN_GenerateEvent_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
32 namespace XERCES_CPP_NAMESPACE
33 {
34  class AttributeList;
35 }
36 
37 
38 
39 namespace XALAN_CPP_NAMESPACE {
40 
41 
42 
43 typedef xercesc::AttributeList AttributeListType;
44 
45 
46 
47 /**
48  * This is the class for events generated by the XSL processor
49  * after it generates a new node in the result tree. It responds
50  * to, and so is modeled from, the SAX events that are sent to the
51  * FormatterListener classes.
52  *
53  * @see org.apache.xml.xpath4j.xml.FormatterListener
54  */
56 {
57 public:
58 
59  enum EventType
60  {
61  /**
62  * Event type generated when a document begins.
63  *
64  */
65  EVENTTYPE_STARTDOCUMENT = 1,
66 
67  /**
68  * Event type generated when a document ends.
69  */
70  EVENTTYPE_ENDDOCUMENT = 2,
71 
72  /**
73  * Event type generated when an element begins (after the attributes have been processed but before the children have been added).
74  */
75  EVENTTYPE_STARTELEMENT = 3,
76 
77  /**
78  * Event type generated when an element ends, after it's children have been added.
79  */
80  EVENTTYPE_ENDELEMENT = 4,
81 
82  /**
83  * Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
84  */
85  EVENTTYPE_CHARACTERS = 5,
86 
87  /**
88  * Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
89  */
90  EVENTTYPE_IGNORABLEWHITESPACE = 6,
91 
92  /**
93  * Event type generated for processing instructions.
94  */
95  EVENTTYPE_PI = 7,
96 
97  /**
98  * Event type generated after a comment has been added.
99  */
100  EVENTTYPE_COMMENT = 8,
101 
102  /**
103  * Event type generate after an entity ref is created.
104  */
105  EVENTTYPE_ENTITYREF = 9,
106 
107  /**
108  * Event type generated after CDATA is generated.
109  */
110  EVENTTYPE_CDATA = 10
111  };
112 
113 
114  /**
115  * Constructor for startDocument, endDocument events.
116  *
117  * @param eventType one of the EVENTTYPE_XXX constants
118  */
119  GenerateEvent(EventType eventType,
120  MemoryManager& theManager);
121 
122  /**
123  * Constructor for startElement, endElement events.
124  *
125  * @param eventType one of the EVENTTYPE_XXX constants
126  * @param name name of the element
127  * @param atts SAX attribute list
128  */
130  EventType eventType,
131  MemoryManager& theManager,
132  const XalanDOMChar* name,
133  AttributeListType* atts);
134 
135  /**
136  * Constructor for startElement, endElement events.
137  *
138  * @param eventType one of the EVENTTYPE_XXX constants
139  * @param name name of the element
140  * @param atts SAX attribute list
141  */
143  EventType eventType,
144  MemoryManager& theManager,
145  const XalanDOMString& name,
146  const AttributeListType* atts = 0);
147 
148  /**
149  * Constructor for characters, cdate events.
150  *
151  * @param eventType one of the EVENTTYPE_XXX constants
152  * @param ch char array from the SAX event
153  * @param start start offset to be used in the char array
154  * @param length end offset to be used in the chara array
155  */
157  EventType eventType,
158  MemoryManager& theManager,
159  const XalanDOMChar* ch,
162 
163  /**
164  * Constructor for processingInstruction events.
165  *
166  * @param eventType one of the EVENTTYPE_XXX constants
167  * @param name name of the processing instruction
168  * @param data processing instruction data
169  */
171  EventType eventType,
172  MemoryManager& theManager,
173  const XalanDOMChar* name,
174  const XalanDOMChar* data);
175 
176  /**
177  * Constructor for comment and entity ref events.
178  *
179  * @param processor XSLT processor instance
180  * @param eventType one of the EVENTTYPE_XXX constants
181  * @param data comment or entity ref data
182  */
184  EventType eventType,
185  MemoryManager& theManager,
186  const XalanDOMChar* data);
187 
188  /**
189  * The type of SAX event that was generated, as enumerated in the
190  * EVENTTYPE_XXX constants above.
191  */
193 
194  /**
195  * Character data from a character or cdata event.
196  */
198 
199  /**
200  * The start position of the current data in m_characters.
201  */
203 
204  /**
205  * The length of the current data in m_characters.
206  */
208 
209  /**
210  * The name of the element or PI.
211  */
213 
214  /**
215  * The string data in the element (comments and PIs).
216  */
218 
219  /**
220  * The current attribute list.
221  */
223 private:
224  // not imlplemented
225  GenerateEvent();
227 };
228 
229 
230 
231 }
232 
233 
234 
235 #endif //XALAN_GenerateEvent_HEADER_GUARD
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::AttributeListType
xercesc::AttributeList AttributeListType
Definition: AttributeListImpl.hpp:41
XalanDOMString.hpp
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::GenerateEvent::m_name
XalanDOMString m_name
The name of the element or PI.
Definition: GenerateEvent.hpp:212
xalanc::GenerateEvent::m_characters
XalanDOMString m_characters
Character data from a character or cdata event.
Definition: GenerateEvent.hpp:197
xalanc::GenerateEvent::m_start
XalanDOMString::size_type m_start
The start position of the current data in m_characters.
Definition: GenerateEvent.hpp:202
xalanc::GenerateEvent::m_eventType
EventType m_eventType
The type of SAX event that was generated, as enumerated in the EVENTTYPE_XXX constants above.
Definition: GenerateEvent.hpp:192
xalanc::GenerateEvent::m_pAtts
const AttributeListType * m_pAtts
The current attribute list.
Definition: GenerateEvent.hpp:222
xalanc::length
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:235
xalanc::GenerateEvent::EventType
EventType
Definition: GenerateEvent.hpp:59
XSLTDefinitions.hpp
xalanc::GenerateEvent
This is the class for events generated by the XSL processor after it generates a new node in the resu...
Definition: GenerateEvent.hpp:55
xalanc::XalanDOMString::size_type
XalanSize_t size_type
Definition: XalanDOMString.hpp:57
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::GenerateEvent::m_length
XalanDOMString::size_type m_length
The length of the current data in m_characters.
Definition: GenerateEvent.hpp:207
xalanc::GenerateEvent::m_data
XalanDOMString m_data
The string data in the element (comments and PIs).
Definition: GenerateEvent.hpp:217