コード例 #1
0
  virtual void startElement(const string_type& namespaceURI,
                            const string_type& localName,
                            const string_type& qName,
                            const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    if(callTemplate_ == 0)
    {
      static const AV rules = AV::rule(SC::name, true);

      std::map<string_type, string_type> attrs = rules.gather(qName, atts);

      string_type name = context_.processInternalQName(attrs[SC::name]).clarkName();

      callTemplate_ = new CallTemplate<string_type, string_adaptor>(name);
      return;
    } // if(callTemplate_ == 0)

    if((namespaceURI == StylesheetConstant<string_type, string_adaptor>::NamespaceURI) && (localName == SC::with_param))
    {
      context_.push(0,
                    new WithParamHandler<string_type, string_adaptor>(context_, *callTemplate_),
                    namespaceURI, 
                    localName, 
                    qName, 
                    atts);
       return;
    } // if(localName == "with-param")
  
    throw SAX::SAXException("xsl:call-template can only contain xsl:sort and xsl:with-param elements.");
  } // startElement
コード例 #2
0
 string_type validate_href(const string_type& qName, const SAX::Attributes<string_type, string_adaptor>& atts)
 {
   static const AV rules = AV::rule(SC::href, true);
   string_type href = rules.gather(qName, atts)[SC::href];
   no_content_ = true;
   // std::cout << "Base : "  << context_->currentBase() << ", href : " << href << "\n";
   return context_->makeAbsolute(href);
 } // validate_href
コード例 #3
0
  virtual Copy<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 AV rules = AV::rule(SC::use_attribute_sets, false);
    string_type sets = rules.gather(qName, atts)[SC::use_attribute_sets];

    return new Copy<string_type, string_adaptor>(sets);
  } // createContainer
コード例 #4
0
  virtual void startElement(const string_type& /* namespaceURI */,
                            const string_type& /* localName */,
                            const string_type& qName,
                            const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    if(copyOf_ == 0)
    {
      static const AV rules = AV::rule(SC::select, true);
      string_type select = rules.gather(qName, atts)[SC::select];

      copyOf_ = new CopyOf<string_type, string_adaptor>(context_.xpath_expression(select));

      return;
    } // if(copyOf_ == 0)

    throw SAX::SAXException(string_adaptor::asStdString(qName) + " can not contain elements");
  } // startElement
コード例 #5
0
  virtual void startElement(const string_type& /* namespaceURI */,
                            const string_type& /* localName */,
                            const string_type& qName,
                            const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    if(valueOf_ == 0)
    {
      static const AV rules = AV::rule(SC::select, true)
                                 .rule(SC::disable_output_escaping, false, SC::no, AllowedValues<string_type>(SC::yes, SC::no));

      std::map<string_type, string_type> attrs = rules.gather(qName, atts);
      valueOf_ = new ValueOf<string_type, string_adaptor>(context_.xpath_expression(attrs[SC::select]), 
			                                               attrs[SC::disable_output_escaping] == SC::yes);
      return;
    } // if(valueOf_ == 0)

    throw SAX::SAXException(string_adaptor::asStdString(qName) + " can not contain elements");
  } // startElement