Exemplo n.º 1
0
 virtual void execute(const DOM::Node<string_type, string_adaptor>& node, 
                      ExecutionContext<string_type, string_adaptor>& context) const
 {
   ChainStackFrame<string_type, string_adaptor> frame(context);
   if(test_->evaluateAsBool(node, context.xpathContext()))
     execute_children(node, context);
 } // execute
Exemplo n.º 2
0
  virtual void execute(const DOM::Node<std::string>& node, ExecutionContext& context) const
  {
    std::string name = name_->evaluateAsString(node, context.xpathContext());
    if(name.empty())
      throw SAX::SAXException("xsl:attribute name attribute must evaluate to a valid element name");

    std::string namesp;

    if(namespace_ != 0)
      namesp = namespace_->evaluateAsString(node, context.xpathContext());
    else
    { 
      QName qn = QName::create(name);
      if(!qn.prefix.empty())
      {
        std::map<std::string, std::string>::const_iterator ns = namespaces_.find(qn.prefix);
        if(ns == namespaces_.end())
          throw SAX::SAXException("xsl:attribute Runtime Error - Undeclared prefix " + qn.prefix);
        namesp = ns->second;
      } // if(!qn.prefix.empty())
    } // if ...

    context.sink().start_attribute(name, namesp);
    ChainStackFrame frame(context);
    execute_children(node, context);
    context.sink().end_attribute();
  } // execute
Exemplo n.º 3
0
  virtual XPathValue value(const DOMNode& node, 
                           ExecutionContext<string_type, string_adaptor>& context,
	                         DOMSink<string_type, string_adaptor>& sink) const
  {
    if(select_)
      return select_->evaluate(node, context.xpathContext());

    execute_children(node, context);

    if(sink.node() == 0)
      return StringValue::createValue(string_adaptor::empty_string());

    NodeSet nodeset;
    for(DOMNode n = sink.node().getFirstChild(); n != 0; n = n.getNextSibling())
      nodeset.push_back(n);

    return NodeSetValue::createValue(nodeset);
  } // value
Exemplo n.º 4
0
 virtual void execute(const DOM::Node<std::string>& node, ExecutionContext& context) const
 {
   execute_children(node, context);
 } // execute
Exemplo n.º 5
0
 virtual void execute(const DOM::Node<string_type, string_adaptor>& node, 
                      ExecutionContext<string_type, string_adaptor>& context) const
 {
   execute_children(node, context);
 } // execute
Exemplo n.º 6
0
 virtual void process_content(const DOM::Node<std::string>& node, ExecutionContext& context) const
 {
   execute_children(node, context);
 } // process_content