Create a new instance based on the supplied HQMF entry
 @param [Nokogiri::XML::Element] entry the parsed HQMF entry
552363
def create_criteria(entry, id)
      @entry = entry

      type = attr_val('@datatype')
      name = attr_val('@name')
      instance = attr_val('@instance')

      @description = "#{type}: #{name}"
      @title = name
      @code_list_id = attr_val('@oid')

      @hqmf_id = attr_val('@uuid')

      parts = type.split(',')
      def_and_status = parse_definition_and_status(type)
      @definition = def_and_status[:definition]
      @status = def_and_status[:status]

      specifics_counter = nil
      if instance
        fix_description_for_hqmf_match()
        specifics_counter = HQMF::Counter.instance.next
        @specific_occurrence = instance.split[1]
        @specific_occurrence_const = DataCriteria.format_so_const(@description)
        @id = id || format_id("#{instance} #{@title}#{specifics_counter}")
      else
        @id = id || format_id("#{@description}")
      end

      handle_transfer() if (['transfer_from', 'transfer_to'].include? definition)


    end
1295869
def setup_derived_entry_elements(id_generator)
      @hqmf_id = attr_val('./*/cda:id/@root') || attr_val('./*/cda:typeId/@extension')
      @title = attr_val('./*/cda:code/cda:displayName/@value').try(:titleize)
      @type = attr_val('./*/cda:code/@code')
      @comments = @entry.xpath('./*/cda:text/cda:xml/cda:qdmUserComments/cda:item/text()', HQMF2::Document::NAMESPACES)
                  .map(&:content)
      handle_preconditions(id_generator)
      obs_test = attr_val('./cda:measureObservationDefinition/@classCode')
      # If there are no measure observations, or there is a title, then there are no aggregations to extract
      return unless !@title && obs_test.to_s == 'OBS'
      @title = attr_val('../cda:code/cda:displayName/@value')
      @aggregator = attr_val('./cda:measureObservationDefinition/cda:methodCode/cda:item/@code')
    end
1338002
def initialize_element(elem, element_id)
      if elem.is_a?(Class) && elem < TreeLayout
        layout = elem.new
        elem = layout.view
      elsif elem.is_a?(Class)
        elem = elem.new
      elsif elem.is_a?(TreeLayout)
        layout = elem
        elem = elem.view
      end

      if layout
        if element_id
          name_element(layout, element_id)
        end
        @child_layouts << layout
      elsif element_id
        name_element(elem, element_id)
      end

      return elem
    end
143161
def create(element, element_id=nil, &block)
      element = initialize_element(element, element_id)
      style_and_context(element, element_id, &block)

      element
    end
27102
def build_xml( result )
      xml = ::Builder::XmlMarkup.new
    
      xml.ProcessResponse do 
        xml.PxPayUserId ::Pxpay::Base.pxpay_user_id
        xml.PxPayKey ::Pxpay::Base.pxpay_key
        xml.Response result
      end
    end
566792
def _create_xml_node(cls):
        
        try:
            xml_map = cls._xml_map
        except AttributeError:
            raise ValueError("This model has no XML definition")

        return _create_xml_node(
            xml_map.get('name', cls.__name__),
            xml_map.get("prefix", None),
            xml_map.get("ns", None)
        )
917554
def init_many(hash)
    # generate single_parser
    pattern_element = PatternElement.new(hash[:many], @init_options.merge(name:hash[:as]))

    # generate delimiter_pattern_element
    many_delimiter_pattern_element = hash[:delimiter] && PatternElement.new(hash[:delimiter], @init_options.merge(name:hash[:delimiter_name]))

    # generate many-parser
    self.parser = lambda do |parent_node|
      parent_node.match_name_is_poly(pattern_element.name)

      # fail unless we can match at least one
      return unless parent_node.match pattern_element

      if many_delimiter_pattern_element
        parent_node.match_name_is_poly(many_delimiter_pattern_element.name)
        # delimited matching
        while (parent_node.attempt_match do
            parent_node.match_delimiter &&
            parent_node.match(many_delimiter_pattern_element).tap{|md|md&&md.many_delimiter=true} &&
            parent_node.match_delimiter &&
            parent_node.match(pattern_element)
          end)
        end
      else
        # not delimited matching
        while (parent_node.attempt_match do
            parent_node.match_delimiter &&
            parent_node.match(pattern_element)
          end)
        end
      end
      parent_node
    end
  end
829413
def StartElement(self, name, attributes):
        '''
        
        '''
        if name == 'hierarchy':
            pass
        elif name == 'node':
            # Instantiate an Element object
            attributes['uniqueId'] = 'id/no_id/%d' % self.idCount
            bounds = re.split('[\][,]', attributes['bounds'])
            attributes['bounds'] = ((int(bounds[1]), int(bounds[2])), (int(bounds[4]), int(bounds[5])))
            if DEBUG_BOUNDS:
                print >> sys.stderr, "bounds=", attributes['bounds']
            self.idCount += 1
            child = View.factory(attributes, self.device, version=self.version, uiAutomatorHelper=self.uiAutomatorHelper)
            self.views.append(child)
            # Push element onto the stack and make it a child of parent
            if not self.nodeStack:
                self.root = child
            else:
                self.parent = self.nodeStack[-1]
                self.parent.add(child)
            self.nodeStack.append(child)
144675
protected String getInnerXmlForEntry(CmsXmlSitemapUrlBean entry) {

        StringBuffer buffer = new StringBuffer();
        entry.writeElement(buffer, "loc", entry.getUrl());
        entry.writeLastmod(buffer);
        entry.writeChangefreq(buffer);
        entry.writePriority(buffer);
        return buffer.toString();
    }
270291
function aaRecreateElementFromEntry(p, elementEntry) {
    const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
    const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);

    p.openElements.replace(elementEntry.element, newElement);
    elementEntry.element = newElement;

    return newElement;
}
224741
def insert(index, value)
      index = validate_index_range(index)

      if index < @entry_counter
        # Insert in between existing elements
        @store.transaction do
          @root.insert(index, value)
          self.entry_counter += 1
        end
      else
        self[index] = value
      end
    end
1253601
def _make_instance(cls, element_class, webelement):
        
        if isinstance(webelement, FirefoxWebElement):
            element_class = copy.deepcopy(element_class)
            element_class.__bases__ = tuple(
                FirefoxWebElement if base is WebElement else base
                for base in element_class.__bases__
            )
        return element_class(webelement)
779564
def entry_to_class(entry)
    # Retrieve the class name from the fully qualified name (the last string after the last dot)
    klass_name = entry.xpath("./atom:category/@term", @ds_namespaces).to_s.split('.')[-1]

    # Is the category missing? See if there is a title that we can use to build the class
    if klass_name.nil?
      title = entry.xpath("./atom:title", @ds_namespaces).first
      return nil if title.nil?
      klass_name = title.content.to_s
    end

    return nil if klass_name.nil?

    properties = entry.xpath("./atom:content/m:properties/*", @ds_namespaces)

    klass = @classes[qualify_class_name(klass_name)].new

    # Fill metadata
    meta_id = entry.xpath("./atom:id", @ds_namespaces)[0].content
    klass.send :__metadata=, { :uri => meta_id }

    # Fill properties
    for prop in properties
      prop_name = prop.name
      klass.send "#{prop_name}=", parse_value_xml(prop)
    end

    # Fill properties represented outside of the properties collection
    @class_metadata[qualify_class_name(klass_name)].select { |k,v| v.fc_keep_in_content == false }.each do |k, meta|
      if meta.fc_target_path == "SyndicationTitle"
        title = entry.xpath("./atom:title", @ds_namespaces).first
        klass.send "#{meta.name}=", title.content
      elsif meta.fc_target_path == "SyndicationSummary"
        summary = entry.xpath("./atom:summary", @ds_namespaces).first
        klass.send "#{meta.name}=", summary.content
      end
    end

    inline_links = entry.xpath("./atom:link[m:inline]", @ds_namespaces)

    for link in inline_links
      # TODO: Use the metadata's associations to determine the multiplicity instead of this "hack"
      property_name = link.attributes['title'].to_s
      if singular?(property_name)
        inline_entry = link.xpath("./m:inline/atom:entry", @ds_namespaces).first
        inline_klass = build_inline_class(klass, inline_entry, property_name)
        klass.send "#{property_name}=", inline_klass
      else
        inline_classes, inline_entries = [], link.xpath("./m:inline/atom:feed/atom:entry", @ds_namespaces)
        for inline_entry in inline_entries
          # Build the class
          inline_klass = entry_to_class(inline_entry)

          # Add the property to the temp collection
          inline_classes << inline_klass
        end

        # Assign the array of classes to the property
        property_name = link.xpath("@title", @ds_namespaces)
        klass.send "#{property_name}=", inline_classes
      end
    end

    klass
  end
82285
def []=(key, value)
      new_entry = entry_to_modify(key, value)
      new_entry[:key] = key
      new_entry[:value] = value
    end
234538
def create(element, changeset)
      element.changeset = changeset.id
      put("/#{element.type.downcase}/create", :body => element.to_xml)
    end
643832
@VisibleForTesting
  ReferenceEntry<K, V> newEntry(K key, int hash, @Nullable ReferenceEntry<K, V> next) {
    return segmentFor(hash).newEntry(key, hash, next);
  }
311928
def create
      @keyword = Cmtool::Keyword.new(keyword_params)

      respond_to do |format|
        if @keyword.save
          format.html { redirect_to(cmtool.keywords_path, :notice => I18n.t('cmtool.action.create.successful', :model => Cmtool::Keyword.model_name.human)) }
          format.xml  { render :xml => @keyword, :status => :created, :location => @keyword }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @keyword.errors, :status => :unprocessable_entity }
        end
      end
    end