set Subroutine

private pure subroutine set(self, name, attribute, attributes, attributes_stream, sanitize_attributes_value, content, indent, is_content_indented, is_self_closing)

Type Bound

xml_tag

Arguments

Type IntentOptional Attributes Name
class(xml_tag), intent(inout) :: self
character(len=*), intent(in), optional :: name
character(len=*), intent(in), optional :: attribute(1:)
character(len=*), intent(in), optional :: attributes(1:,1:)
character(len=*), intent(in), optional :: attributes_stream
logical, intent(in), optional :: sanitize_attributes_value
character(len=*), intent(in), optional :: content
integer(kind=I4P), intent(in), optional :: indent
logical, intent(in), optional :: is_content_indented
logical, intent(in), optional :: is_self_closing

Calls

proc~~set~~CallsGraph proc~set xml_tag%set proc~add_multiple_attributes xml_tag%add_multiple_attributes proc~set->proc~add_multiple_attributes proc~add_single_attribute xml_tag%add_single_attribute proc~set->proc~add_single_attribute proc~add_stream_attributes xml_tag%add_stream_attributes proc~set->proc~add_stream_attributes proc~add_multiple_attributes->proc~add_single_attribute proc~alloc_attributes xml_tag%alloc_attributes proc~add_single_attribute->proc~alloc_attributes proc~add_stream_attributes->proc~add_single_attribute proc~fill string%fill proc~add_stream_attributes->proc~fill proc~partition string%partition proc~add_stream_attributes->proc~partition proc~slice string%slice proc~add_stream_attributes->proc~slice

Called by

proc~~set~~CalledByGraph proc~set xml_tag%set proc~create_tag_flat create_tag_flat proc~create_tag_flat->proc~set proc~create_tag_nested create_tag_nested proc~create_tag_nested->proc~set program~create_tag create_tag program~create_tag->proc~set interface~xml_tag xml_tag interface~xml_tag->proc~create_tag_flat interface~xml_tag->proc~create_tag_nested

Source Code

  pure subroutine set(self, name, attribute, attributes, attributes_stream, sanitize_attributes_value, content, &
                      indent, is_content_indented, is_self_closing)
  !< Set tag data.
  class(xml_tag), intent(inout)        :: self                      !< XML tag.
  character(*),   intent(in), optional :: name                      !< Tag name.
  character(*),   intent(in), optional :: attribute(1:)             !< Attribute name/value pair [1:2].
  character(*),   intent(in), optional :: attributes(1:,1:)         !< Attributes list of name/value pairs [1:2,1:].
  character(*),   intent(in), optional :: attributes_stream         !< Attributes list of name/value pairs as single stream.
  logical,        intent(in), optional :: sanitize_attributes_value !< Sanitize attributes value.
  character(*),   intent(in), optional :: content                   !< Tag value.
  integer(I4P),   intent(in), optional :: indent                    !< Number of indent-white-spaces.
  logical,        intent(in), optional :: is_content_indented       !< Activate value indentation.
  logical,        intent(in), optional :: is_self_closing           !< The tag is self closing.
  logical                              :: is_content_indented_      !< Activate value indentation.

  if (present(name)) self%tag_name = name
  if (present(attribute)) call self%add_single_attribute(attribute=attribute, sanitize_value=sanitize_attributes_value)
  if (present(attributes)) call self%add_multiple_attributes(attributes=attributes, sanitize_values=sanitize_attributes_value)
  if (present(attributes_stream)) call self%add_stream_attributes(attributes_stream=attributes_stream, &
                                                                  sanitize_values=sanitize_attributes_value)
  if (present(indent)) self%indent = indent
  if (present(content)) then
    is_content_indented_ = .false. ; if (present(is_content_indented)) is_content_indented_ = is_content_indented
    if (is_content_indented_) then
      self%tag_content = new_line('a')//repeat(' ', self%indent+2)//content//new_line('a')
    else
      self%tag_content = content
    endif
  endif
  if (present(is_self_closing)) self%is_self_closing = is_self_closing
  endsubroutine set