content Function

private 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.

Type Bound

xml_file

Arguments

Type IntentOptional Attributes Name
class(xml_file), intent(in) :: self

XML file.

character(len=*), intent(in) :: name

Tag name.

Return Value character(len=:), allocatable

Tag content.


Calls

proc~~content~~CallsGraph proc~content xml_file%content proc~get_content xml_tag%get_content proc~content->proc~get_content chars chars proc~get_content->chars is_allocated is_allocated proc~get_content->is_allocated proc~search xml_tag%search proc~get_content->proc~search proc~search->is_allocated proc~parse xml_tag%parse proc~search->proc~parse proc~parse->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