22 #ifndef _EVENTHANDLER_HPP
23 #define _EVENTHANDLER_HPP
25 #include <xqilla/framework/XQillaExport.hpp>
29 #include <xercesc/util/XercesDefs.hpp>
41 virtual void startDocumentEvent(
const XMLCh *documentURI,
const XMLCh *encoding) = 0;
43 virtual void endDocumentEvent() = 0;
45 virtual void startElementEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname) = 0;
47 virtual void endElementEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname,
48 const XMLCh *typeURI,
const XMLCh *typeName) = 0;
50 virtual void piEvent(
const XMLCh *target,
const XMLCh *value) = 0;
52 virtual void textEvent(
const XMLCh *value) = 0;
54 virtual void textEvent(
const XMLCh *chars,
unsigned int length) = 0;
56 virtual void commentEvent(
const XMLCh *value) = 0;
58 virtual void attributeEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname,
const XMLCh *value,
59 const XMLCh *typeURI,
const XMLCh *typeName) = 0;
61 virtual void namespaceEvent(
const XMLCh *prefix,
const XMLCh *uri) = 0;
64 const XMLCh *typeURI,
const XMLCh *typeName) {}
66 virtual void endEvent() = 0;
84 next_->setLocationInfo(location);
89 next_->startDocumentEvent(documentURI, encoding);
94 next_->endDocumentEvent();
97 virtual void startElementEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname)
99 next_->startElementEvent(prefix, uri, localname);
102 virtual void endElementEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname,
103 const XMLCh *typeURI,
const XMLCh *typeName)
105 next_->endElementEvent(prefix, uri, localname, typeURI, typeName);
108 virtual void piEvent(
const XMLCh *target,
const XMLCh *value)
110 next_->piEvent(target, value);
115 next_->textEvent(value);
118 virtual void textEvent(
const XMLCh *chars,
unsigned int length)
120 next_->textEvent(chars, length);
125 next_->commentEvent(value);
128 virtual void attributeEvent(
const XMLCh *prefix,
const XMLCh *uri,
const XMLCh *localname,
const XMLCh *value,
129 const XMLCh *typeURI,
const XMLCh *typeName)
131 next_->attributeEvent(prefix, uri, localname, value, typeURI, typeName);
136 next_->namespaceEvent(prefix, uri);
140 const XMLCh *typeName)
142 next_->atomicItemEvent(type, value, typeURI, typeName);
156 return (in == 0 || *in == 0) ? 0 : in;
Definition: EventHandler.hpp:69
virtual void startElementEvent(const XMLCh *prefix, const XMLCh *uri, const XMLCh *localname)
Handles the start of an element node as an event.
Definition: EventHandler.hpp:97
EventFilter(EventHandler *next)
Definition: EventHandler.hpp:72
Definition: EventHandler.hpp:31
virtual ~EventHandler()
Definition: EventHandler.hpp:34
virtual void endDocumentEvent()
Handles a document node as an event.
Definition: EventHandler.hpp:92
virtual void textEvent(const XMLCh *chars, unsigned int length)
Handles a text node as an event.
Definition: EventHandler.hpp:118
AtomicObjectType
Definition: AnyAtomicType.hpp:36
static const XMLCh * emptyToNull(const XMLCh *const in)
Definition: EventHandler.hpp:154
virtual void namespaceEvent(const XMLCh *prefix, const XMLCh *uri)
Handles a namespace binding as an event.
Definition: EventHandler.hpp:134
virtual void setLocationInfo(const LocationInfo *location)
Recieves a LocationInfo object that is owned by the caller, and will be updated with the current loca...
Definition: EventHandler.hpp:82
virtual void startDocumentEvent(const XMLCh *documentURI, const XMLCh *encoding)
Handles a document node as an event.
Definition: EventHandler.hpp:87
virtual void atomicItemEvent(AnyAtomicType::AtomicObjectType type, const XMLCh *value, const XMLCh *typeURI, const XMLCh *typeName)
Handles an atomic item as an event.
Definition: EventHandler.hpp:63
virtual void attributeEvent(const XMLCh *prefix, const XMLCh *uri, const XMLCh *localname, const XMLCh *value, const XMLCh *typeURI, const XMLCh *typeName)
Handles an attribute node as an event.
Definition: EventHandler.hpp:128
virtual void setLocationInfo(const LocationInfo *location)
Recieves a LocationInfo object that is owned by the caller, and will be updated with the current loca...
Definition: EventHandler.hpp:38
virtual void endEvent()
Called when all events have been reported.
Definition: EventHandler.hpp:145
EventHandler * next_
Definition: EventHandler.hpp:151
virtual void endElementEvent(const XMLCh *prefix, const XMLCh *uri, const XMLCh *localname, const XMLCh *typeURI, const XMLCh *typeName)
Handles the end of an element node as an event.
Definition: EventHandler.hpp:102
virtual void piEvent(const XMLCh *target, const XMLCh *value)
Handles a processing instruction node as an event.
Definition: EventHandler.hpp:108
A class that gives records a location in the query.
Definition: LocationInfo.hpp:31
virtual void commentEvent(const XMLCh *value)
Handles a comment node as an event.
Definition: EventHandler.hpp:123
virtual void atomicItemEvent(AnyAtomicType::AtomicObjectType type, const XMLCh *value, const XMLCh *typeURI, const XMLCh *typeName)
Handles an atomic item as an event.
Definition: EventHandler.hpp:139
virtual void textEvent(const XMLCh *value)
Handles a text node as an event.
Definition: EventHandler.hpp:113
void setNextEventHandler(EventHandler *next)
Definition: EventHandler.hpp:77