#ifndef ARABICA_XSLT_FOREIGN_ELEMENT_HPP #define ARABICA_XSLT_FOREIGN_ELEMENT_HPP namespace Arabica { namespace XSLT { template class ForeignElementHandler : public SAX::DefaultHandler { public: ForeignElementHandler(CompilationContext& context) : context_(context), depth_(0) { } // ForeignElementHandler virtual void startElement(const string_type& /* namespaceURI */, const string_type& /* localName */, const string_type& /* qName */, const SAX::Attributes& /* atts */) { ++depth_; } // startElement virtual void endElement(const string_type& /* namespaceURI */, const string_type& /* localName */, const string_type& /* qName */) { if(--depth_ == 0) context_.pop(); } // endElement private: CompilationContext& context_; unsigned int depth_; }; // class ForeignElementHandler } // namespace XSLT } // namespace Arabica #endif