arabica/include/XSLT/impl/handler/xslt_foreign_element_handler.hpp

44 lines
1.1 KiB
C++
Raw Normal View History

#ifndef ARABICA_XSLT_FOREIGN_ELEMENT_HPP
#define ARABICA_XSLT_FOREIGN_ELEMENT_HPP
namespace Arabica
{
namespace XSLT
{
class ForeignElementHandler : public SAX::DefaultHandler<std::string>
{
public:
ForeignElementHandler(CompilationContext<std::string>& context) :
context_(context),
depth_(0)
{
} // ForeignElementHandler
2010-01-10 23:02:43 +01:00
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */,
const SAX::Attributes<std::string>& /* atts */)
{
++depth_;
} // startElement
2010-01-10 23:02:43 +01:00
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
if(--depth_ == 0)
context_.pop();
} // endElement
private:
CompilationContext<std::string>& context_;
unsigned int depth_;
}; // class ForeignElementHandler
} // namespace XSLT
} // namespace Arabica
#endif