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"
|
2008-11-05 02:33:28 +01:00
|
|
|
#include "../xslt_compiled_stylesheet.hpp"
|
2007-07-19 19:01:42 +02:00
|
|
|
#include "xslt_constants.hpp"
|
|
|
|
|
|
|
|
namespace Arabica
|
|
|
|
{
|
|
|
|
namespace XSLT
|
|
|
|
{
|
|
|
|
|
|
|
|
template<class Handler>
|
2012-11-02 22:01:15 +01:00
|
|
|
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
|
|
|
|
|
2007-09-05 14:57:07 +02:00
|
|
|
class NotImplementedYetHandler : public SAX::DefaultHandler<std::string>
|
2007-07-19 19:01:42 +02:00
|
|
|
{
|
|
|
|
public:
|
2012-11-02 22:01:15 +01:00
|
|
|
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
|
|
|
|
|
2012-11-02 22:01:15 +01:00
|
|
|
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
|
|
|
|
|