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

50 lines
1.5 KiB
C++
Raw Normal View History

2007-07-19 19:01:42 +02:00
#ifndef ARABICA_XSLT_CREATE_HANDLER_HPP
#define ARABICA_XSLT_CREATE_HANDLER_HPP
2007-09-05 00:55:47 +02:00
#include <SAX/XMLReader.hpp>
#include <SAX/helpers/DefaultHandler.hpp>
2007-07-19 19:01:42 +02:00
#include <XPath/XPath.hpp>
#include "../xslt_compilation_context.hpp"
#include "../xslt_compiled_stylesheet.hpp"
2007-07-19 19:01:42 +02:00
#include "xslt_constants.hpp"
namespace Arabica
{
namespace XSLT
{
template<class Handler>
SAX::DefaultHandler<std::string>* CreateHandler(CompilationContext<std::string, Arabica::default_string_adaptor<std::string> >& context)
2007-07-19 19:01:42 +02:00
{
return new Handler(context);
} // create
class NotImplementedYetHandler : public SAX::DefaultHandler<std::string>
2007-07-19 19:01:42 +02:00
{
public:
NotImplementedYetHandler(CompilationContext<std::string, Arabica::default_string_adaptor<std::string> >& /* context */) { }
2007-07-19 19:01:42 +02:00
2010-01-10 22:25:35 +01:00
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
2007-07-19 19:01:42 +02:00
const std::string& qName,
2010-01-10 22:25:35 +01:00
const SAX::Attributes<std::string>& /* atts */)
2007-07-19 19:01:42 +02:00
{
throw SAX::SAXException("Haven't implemented " + qName + " yet");
} // startElement
}; // NotImplementedYetHandler
typedef SAX::DefaultHandler<std::string>* (*CreateHandlerPtr)(CompilationContext<std::string, Arabica::default_string_adaptor<std::string> >&);
2007-07-19 19:01:42 +02:00
struct ChildElement
{
const char* const name;
CreateHandlerPtr createHandler;
}; // struct ChildElement
} // namespace XSLT
} // namespace Arabica
#endif // ARABICA_XSLT_CONSTANTS_HPP