mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-28 22:23:21 +01:00
40 lines
1.6 KiB
C++
40 lines
1.6 KiB
C++
#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
|
|
{
|
|
|
|
template<class string_type, class string_adaptor>
|
|
class ProcessingInstructionHandler : public ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> >
|
|
{
|
|
typedef ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> > baseT;
|
|
|
|
public:
|
|
ProcessingInstructionHandler(CompilationContext<string_type, string_adaptor>& context) :
|
|
ItemContainerHandler<ProcessingInstruction<string_type, string_adaptor> >(context)
|
|
{
|
|
} // ProcessingInstructionHandler
|
|
|
|
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)
|
|
{
|
|
static const ValueRule rules[] = { { "name", true, 0, 0 },
|
|
{ 0, false, 0, 0} };
|
|
string_type name = gatherAttributes(qName, atts, rules)["name"];
|
|
|
|
return new ProcessingInstruction<string_type, string_adaptor>(baseT::context().xpath_attribute_value_template(name));
|
|
} // createContainer
|
|
}; // class ProcessingInstructionHandler
|
|
|
|
} // namespace XSLT
|
|
} // namespace Arabica
|
|
|
|
#endif
|
|
|