content Function

private pure function content(self, name)

Type Bound

xml_file

Arguments

Type IntentOptional Attributes Name
class(xml_file), intent(in) :: self
character(len=*), intent(in) :: name

Return Value character(len=:), allocatable


Calls

proc~~content~~CallsGraph proc~content xml_file%content proc~get_content xml_tag%get_content proc~content->proc~get_content proc~chars string%chars proc~get_content->proc~chars proc~is_allocated string%is_allocated proc~get_content->proc~is_allocated proc~search xml_tag%search proc~get_content->proc~search proc~search->proc~is_allocated proc~parse xml_tag%parse proc~search->proc~parse proc~parse->proc~is_allocated proc~get xml_tag%get proc~parse->proc~get proc~parse_attributes_names xml_tag%parse_attributes_names proc~parse->proc~parse_attributes_names proc~parse_tag_name xml_tag%parse_tag_name proc~parse->proc~parse_tag_name proc~get_attributes xml_tag%get_attributes proc~get->proc~get_attributes proc~get_value xml_tag%get_value proc~get->proc~get_value proc~alloc_attributes xml_tag%alloc_attributes proc~parse_attributes_names->proc~alloc_attributes

Source Code

  pure function content(self, name)
  !< Return tag content of tag named *name*.
  !<
  !< @note If there is no value, the *tag_content* string is returned empty, but allocated.
  class(xml_file), intent(in)   :: self    !< XML file.
  character(*),    intent(in)   :: name    !< Tag name.
  character(len=:), allocatable :: content !< Tag content.
  integer(I4P)                  :: t       !< Counter.

  if (allocated(content)) deallocate(content)
  if (self%Nt>0) then
    do t=1, self%Nt
      call self%tag(t)%get_content(name=name, content=content)
      if (allocated(content)) exit
    enddo
  endif
  if (.not.allocated(content)) content = ''
  endfunction content