2009-04-24 20:02:14 +02:00
|
|
|
#ifndef ARABICA_XSLT_FOREIGN_ELEMENT_HPP
|
|
|
|
#define ARABICA_XSLT_FOREIGN_ELEMENT_HPP
|
|
|
|
|
|
|
|
namespace Arabica
|
|
|
|
{
|
|
|
|
namespace XSLT
|
|
|
|
{
|
|
|
|
|
|
|
|
class ForeignElementHandler : public SAX::DefaultHandler<std::string>
|
|
|
|
{
|
|
|
|
public:
|
2012-11-02 22:01:15 +01:00
|
|
|
ForeignElementHandler(CompilationContext<std::string>& context) :
|
2009-04-24 20:02:14 +02:00
|
|
|
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 */)
|
2009-04-24 20:02:14 +02:00
|
|
|
{
|
|
|
|
++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 */)
|
2009-04-24 20:02:14 +02:00
|
|
|
{
|
|
|
|
if(--depth_ == 0)
|
|
|
|
context_.pop();
|
|
|
|
} // endElement
|
|
|
|
|
|
|
|
private:
|
2012-11-02 22:01:15 +01:00
|
|
|
CompilationContext<std::string>& context_;
|
2009-04-24 20:02:14 +02:00
|
|
|
unsigned int depth_;
|
|
|
|
}; // class ForeignElementHandler
|
|
|
|
|
|
|
|
} // namespace XSLT
|
|
|
|
} // namespace Arabica
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|