Build XML by appending to builder
427381
def build(self, builder):
        """"""
        params = dict(LabelOID=self.oid, OrderNumber=str(self.order_number))

        builder.start("mdsol:LabelRef", params)
        builder.end("mdsol:LabelRef")
44649
def build(self, builder):
        
        builder.start("ReasonForChange", {})
        builder.data(self.reason)
        builder.end("ReasonForChange")
1103692
def build_xml( id, price, options )
      xml = ::Builder::XmlMarkup.new
      xml.GenerateRequest do
        xml.PxPayUserId       ::Pxpay::Base.pxpay_user_id
        xml.PxPayKey          ::Pxpay::Base.pxpay_key
        xml.AmountInput       sprintf("%.2f", price)
        xml.TxnId             id
        xml.TxnType           options[:txn_type]            ? options[:txn_type].to_s.capitalize : "Purchase"
        xml.CurrencyInput     options[:currency_input]      || "NZD"
        xml.MerchantReference options[:merchant_reference]  || options[:reference]       || id.to_s ## Backwards compatibility
        xml.UrlSuccess        options[:url_success]         || ::Pxpay::Base.url_success 
        xml.UrlFail           options[:url_failure]         || ::Pxpay::Base.url_failure
        xml.EmailAddress      options[:email_address]       if options[:email_address]
        xml.TxnData1          options[:txn_data1]           if options[:txn_data1]
        xml.TxnData2          options[:txn_data2]           if options[:txn_data2]
        xml.TxnData3          options[:txn_data3]           if options[:txn_data3]
        xml.TxnData4          options[:txn_data4]           if options[:txn_data4]
        xml.Opt               options[:opt]                 if options[:opt]
        xml.EnableAddBillCard 1                             if options[:token_billing]
        xml.BillingId         options[:billing_id]          if options[:token_billing]
      end
    end
743504
def build(self, builder, formname=None):
        """"""

        params = dict(ItemGroupOID=formname if formname else self.itemgroupoid)

        if self.transaction_type is not None:
            params["TransactionType"] = self.transaction_type

        if self.item_group_repeat_key is not None:
            params["ItemGroupRepeatKey"] = str(
                self.item_group_repeat_key)  # may be @context for transaction type upsert or context

        params["mdsol:Submission"] = "WholeItemGroup" if self.whole_item_group else "SpecifiedItemsOnly"

        # mixins
        self.mixin()
        self.mixin_params(params)

        builder.start("ItemGroupData", params)

        # Ask children
        for item in self.items.values():
            item.build(builder)

        # Add annotations
        for annotation in self.annotations:
            annotation.build(builder)

        # Add the signature if it exists
        if self.signature is not None:
            self.signature.build(builder)
        builder.end("ItemGroupData")
222057
def to_xml(options = {})
      xml = options[:builder] ||= Builder::XmlMarkup.new
      xml.instruct! unless options[:skip_instruct]
      xml.osm do
        xml.changeset(attributes) do
          tags.each do |k,v|
            xml.tag(:k => k, :v => v)
          end unless tags.empty?
        end
      end
    end
300795
def build(self, builder):
        """"""
        params = dict(
            OID=self.oid, Name=self.name, Repeating=bool_to_yes_no(self.repeating)
        )

        if self.order_number is not None:
            params["mdsol:OrderNumber"] = str(self.order_number)

        if self.active is not None:
            params["mdsol:Active"] = bool_to_yes_no(self.active)

        params["mdsol:Template"] = bool_to_yes_no(self.template)
        params["mdsol:SignatureRequired"] = bool_to_yes_no(self.signature_required)
        params["mdsol:LogDirection"] = self.log_direction
        params["mdsol:DoubleDataEntry"] = self.double_data_entry
        params["mdsol:ConfirmationStyle"] = self.confirmation_style

        if self.link_study_event_oid:
            params["mdsol:LinkStudyEventOID"] = self.link_study_event_oid

        if self.link_form_oid:
            params["mdsol:LinkFormOID"] = self.link_form_oid

        builder.start("FormDef", params)
        for itemgroup_ref in self.itemgroup_refs:
            itemgroup_ref.build(builder)

        for helptext in self.helptexts:
            helptext.build(builder)

        for view_restriction in self.view_restrictions:
            view_restriction.build(builder)

        for entry_restriction in self.entry_restrictions:
            entry_restriction.build(builder)

        for alias in self.aliases:
            alias.build(builder)

        builder.end("FormDef")
1360581
def build(self, builder):
        """"""

        params = dict(
            OID=self.oid,
            Name=self.name,
            Repeating=bool_to_yes_no(self.repeating),
            IsReferenceData=bool_to_yes_no(self.is_reference_data),
        )

        if self.sas_dataset_name is not None:
            params["SASDatasetName"] = self.sas_dataset_name

        if self.domain is not None:
            params["Domain"] = self.domain

        if self.origin is not None:
            params["Origin"] = self.origin

        if self.role is not None:
            params["Role"] = self.role

        if self.purpose is not None:
            params["Purpose"] = self.purpose

        if self.comment is not None:
            params["Comment"] = self.comment

        builder.start("ItemGroupDef", params)

        for itemref in self.item_refs:
            itemref.build(builder)

        # Extensions always listed AFTER core elements
        for labelref in self.label_refs:
            labelref.build(builder)

        for alias in self.aliases:
            alias.build(builder)

        builder.end("ItemGroupDef")
834703
protected void generateIElementBuilder() {
		final List<TopElementDescription> topElements = generateTopElements(true, false);
		for (final TopElementDescription element : topElements) {
			final StringConcatenationClient content = new StringConcatenationClient() {
				@Override
				protected void appendTo(TargetStringConcatenation it) {
					it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
							+ " " + element.getElementDescription().getElementType().getSimpleName() //$NON-NLS-1$
							+ "."); //$NON-NLS-1$
					it.newLine();
					it.append(" */"); //$NON-NLS-1$
					it.newLine();
					it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
					it.newLine();
					it.append("public interface "); //$NON-NLS-1$
					it.append(element.getElementDescription().getBuilderInterfaceType().getSimpleName());
					it.append(" {"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
					it.append(element.getContent());
					for (final StringConcatenationClient cons : generateMembers(element.getConstructors(),
							element, true, false, true)) {
						it.append(cons);
					}
					for (final StringConcatenationClient mbr : generateMembers(element.getNamedMembers(),
							element, true, false, true)) {
						it.append(mbr);
					}
					for (final StringConcatenationClient mbr : generateMembers(element.getUnnamedMembers(),
							element, true, false, false)) {
						it.append(mbr);
					}
					it.append("}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
				}
			};
			final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(
					element.getElementDescription().getBuilderInterfaceType(), content);
			javaFile.writeTo(getSrcGen());
		}
	}
676162
def build(self, builder):
        
        builder.start("SignatureRef", dict(SignatureOID=self.oid))
        builder.end("SignatureRef")
777426
def to_xml
      xml = Builder::XmlMarkup.new
      case
      when @self_closing && @content_type == 'container'
        xml.tag!(@name, @attributes)
      when @value.nil?
        xml.tag!(@name, @attributes.merge!("xsi:nil" => "true"))
      when ::Hash === @value
        xml.tag!(@name, @attributes) { xml << XmlFu::Hash.to_xml(@value) }
      when ::Array === @value
        case @content_type
        when "collection"
          xml << XmlFu::Array.to_xml(@value.flatten, {
            :key => (@self_closing ? "#{@name}/" : @name),
            :attributes => @attributes,
            :content_type => "collection"
          })
        when "container"
          xml.tag!(@name, @attributes) { xml << XmlFu::Array.to_xml(@value) }
        else
          # Shouldn't be anything else
        end
      else
        xml.tag!(@name, @attributes) { xml << self.value.to_s }
      end
      xml.target!
    end
988228
def build(self, builder):
        """"""
        params = dict(ODMVersion="1.3",
                      FileType=self.filetype,
                      CreationDateTime=self.creationdatetime,
                      Originator=self.originator,
                      FileOID=self.fileoid,
                      xmlns="http://www.cdisc.org/ns/odm/v1.3",
                      )
        if self.granularity_type:
            params['Granularity'] = self.granularity_type.value
        if self.source_system:
            params['SourceSystem'] = self.source_system

        if self.source_system_version:
            params['SourceSystemVersion'] = self.source_system_version
        params['xmlns:mdsol'] = "http://www.mdsol.com/ns/odm/metadata"

        if self.description:
            params['Description'] = self.description

        builder.start("ODM", params)

        # Ask the children
        if self.study is not None:
            self.study.build(builder)

        if self.clinical_data:
            for clinical_data in self.clinical_data:
                clinical_data.build(builder)

        if self.admindata is not None:
            self.admindata.build(builder)

        builder.end("ODM")
        return builder.close()
198029
def build(self, builder):
        
        params = dict(FormOID=self.formoid)

        if self.transaction_type is not None:
            params["TransactionType"] = self.transaction_type

        if self.form_repeat_key is not None:
            params["FormRepeatKey"] = str(self.form_repeat_key)

        # mixins
        self.mixin()
        self.mixin_params(params)

        builder.start("FormData", params)

        # Ask children
        for itemgroup in self.itemgroups:
            itemgroup.build(builder, self.formoid)

        if self.signature is not None:
            self.signature.build(builder)

        for annotation in self.annotations:
            annotation.build(builder)

        builder.end("FormData")
148846
def to_xml
      builder = Builder::XmlMarkup.new
      builder.instruct!
      xml = builder.notice(:version => Airbrake::API_VERSION) do |notice|
        notice.tag!("api-key", api_key)
        notice.notifier do |notifier|
          notifier.name(notifier_name)
          notifier.version(notifier_version)
          notifier.url(notifier_url)
        end
        notice.error do |error|
          error.tag!('class', error_class)
          error.message(error_message)
          error.backtrace do |backtrace|
            self.backtrace.lines.each do |line|
              backtrace.line(:number => line.number,
                             :file   => line.file,
                             :method => line.method)
            end
          end
        end
        if url ||
            controller ||
            action ||
            !parameters.blank? ||
            !cgi_data.blank? ||
            !session_data.blank?
          notice.request do |request|
            request.url(url)
            request.component(controller)
            request.action(action)
            unless parameters.nil? || parameters.empty?
              request.params do |params|
                xml_vars_for(params, parameters)
              end
            end
            unless session_data.nil? || session_data.empty?
              request.session do |session|
                xml_vars_for(session, session_data)
              end
            end
            unless cgi_data.nil? || cgi_data.empty?
              request.tag!("cgi-data") do |cgi_datum|
                xml_vars_for(cgi_datum, cgi_data)
              end
            end
          end
        end
        notice.tag!("server-environment") do |env|
          env.tag!("project-root", project_root)
          env.tag!("environment-name", environment_name)
          env.tag!("hostname", hostname)
        end
      end
      xml.to_s
    end
323804
def populate_tree(self, master, parent, element,from_file=False):
        """"""

        data = WidgetDescr(None, None)
        data.from_xml_node(element)
        cname = data.get_class()
        uniqueid = self.get_unique_id(cname, data.get_id())
        data.set_property('id', uniqueid)

        if cname in builder.CLASS_MAP:
            pwidget = self._insert_item(master, data,from_file=from_file)
            xpath = "./child"
            children = element.findall(xpath)
            for child in children:
                child_object = child.find('./object')
                cwidget = self.populate_tree(pwidget, child, child_object,from_file=from_file)

            return pwidget
        else:
            raise Exception('Class "{0}" not mapped'.format(cname))
1128875
def build(self, field: Field) -> Mapping[str, Any]:
        
        builder_types = self.builder_types() + [
            # put default last
            self.default_builder_type()
        ]

        builders: List[ParameterBuilder] = [
            builder_type(
                build_parameter=self.build,
            )
            for builder_type in builder_types
        ]

        builder = next(
            builder
            for builder in builders
            if builder.supports_field(field)
        )

        return builder.build(field)
108415
def build(self, builder):
        """"""
        builder.start("CheckValue", {})
        builder.data(str(self.value))
        builder.end("CheckValue")
95130
def build(self, builder):
        
        builder.start("UserRef", dict(UserOID=self.oid))
        builder.end("UserRef")