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

42 lines
1.7 KiB
C++
Raw Normal View History

2007-07-19 19:01:42 +02:00
#ifndef ARABICA_XSLT_PROCESSING_INSTRUCTION_HANDLER_HPP
#define ARABICA_XSLT_PROCESSING_INSTRUCTION_HANDLER_HPP
#include "../xslt_processing_instruction.hpp"
#include "xslt_item_container_handler.hpp"
namespace Arabica
{
namespace XSLT
{
2012-11-04 14:04:08 +01:00
template<class string_type, class string_adaptor>
class ProcessingInstructionHandler : public ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> >
2007-07-19 19:01:42 +02:00
{
2012-11-04 14:04:08 +01:00
typedef ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> > baseT;
typedef StylesheetConstant<string_type, string_adaptor> SC;
2012-11-04 14:04:08 +01:00
2007-07-19 19:01:42 +02:00
public:
2012-11-04 14:04:08 +01:00
ProcessingInstructionHandler(CompilationContext<string_type, string_adaptor>& context) :
ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> >(context)
2007-07-19 19:01:42 +02:00
{
} // ProcessingInstructionHandler
2012-11-04 14:04:08 +01:00
virtual ProcessingInstruction<string_type, string_adaptor>* createContainer(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
{
static const ValueRule<string_type> rules[] = { { SC::name, true, 0, 0 },
{ string_adaptor::empty_string(), false, 0, 0} };
string_type name = gatherAttributes(qName, atts, rules)[SC::name];
2007-07-19 19:01:42 +02:00
2012-11-04 14:04:08 +01:00
return new ProcessingInstruction<string_type, string_adaptor>(baseT::context().xpath_attribute_value_template(name));
2007-07-19 19:01:42 +02:00
} // createContainer
}; // class ProcessingInstructionHandler
} // namespace XSLT
} // namespace Arabica
#endif