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

38 lines
1.3 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
{
class ProcessingInstructionHandler : public ItemContainerHandler<ProcessingInstruction>
{
public:
ProcessingInstructionHandler(CompilationContext<std::string>& context) :
2007-07-19 19:01:42 +02:00
ItemContainerHandler<ProcessingInstruction>(context)
{
} // ProcessingInstructionHandler
2010-01-10 23:02:43 +01:00
virtual ProcessingInstruction* createContainer(const std::string& /* namespaceURI */,
const std::string& /* localName */,
2007-07-19 19:01:42 +02:00
const std::string& qName,
const SAX::Attributes<std::string>& atts)
2007-07-19 19:01:42 +02:00
{
2010-01-10 23:02:43 +01:00
static const ValueRule rules[] = { { "name", true, 0, 0 },
{ 0, false, 0, 0} };
2007-07-19 19:01:42 +02:00
std::string name = gatherAttributes(qName, atts, rules)["name"];
return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath_attribute_value_template(name));
2007-07-19 19:01:42 +02:00
} // createContainer
}; // class ProcessingInstructionHandler
} // namespace XSLT
} // namespace Arabica
#endif