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
|
|
|
|
{
|
|
|
|
|
2012-11-04 23:34:40 +01:00
|
|
|
template<class Handler, class string_type, class string_adaptor>
|
|
|
|
SAX::DefaultHandler<string_type, string_adaptor>* CreateHandler(CompilationContext<string_type, string_adaptor>& context)
|
2007-07-19 19:01:42 +02:00
|
|
|
{
|
|
|
|
return new Handler(context);
|
|
|
|
} // create
|
|
|
|
|
2012-11-04 09:41:53 +01:00
|
|
|
template<class string_type, class string_adaptor>
|
|
|
|
class NotImplementedYetHandler : public SAX::DefaultHandler<string_type, string_adaptor>
|
2007-07-19 19:01:42 +02:00
|
|
|
{
|
|
|
|
public:
|
2012-11-04 09:41:53 +01:00
|
|
|
NotImplementedYetHandler(CompilationContext<string_type, string_adaptor>& /* context */) { }
|
2007-07-19 19:01:42 +02:00
|
|
|
|
2012-11-04 09:41:53 +01:00
|
|
|
virtual void startElement(const string_type& /* namespaceURI */,
|
|
|
|
const string_type& /* localName */,
|
|
|
|
const string_type& qName,
|
|
|
|
const SAX::Attributes<string_type, string_adaptor>& /* atts */)
|
2007-07-19 19:01:42 +02:00
|
|
|
{
|
|
|
|
throw SAX::SAXException("Haven't implemented " + qName + " yet");
|
|
|
|
} // startElement
|
|
|
|
}; // NotImplementedYetHandler
|
|
|
|
|
2012-11-04 23:34:40 +01:00
|
|
|
template<class string_type, class string_adaptor>
|
2007-07-19 19:01:42 +02:00
|
|
|
struct ChildElement
|
|
|
|
{
|
2012-11-04 23:34:40 +01:00
|
|
|
typedef SAX::DefaultHandler<string_type, string_adaptor>* (*CreateHandlerPtr)(CompilationContext<string_type, string_adaptor>&);
|
|
|
|
|
2007-07-19 19:01:42 +02:00
|
|
|
const char* const name;
|
|
|
|
CreateHandlerPtr createHandler;
|
|
|
|
}; // struct ChildElement
|
|
|
|
|
|
|
|
} // namespace XSLT
|
|
|
|
} // namespace Arabica
|
|
|
|
|
|
|
|
#endif // ARABICA_XSLT_CONSTANTS_HPP
|
|
|
|
|