Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_file), | intent(in) | :: | self | XML file. |
||
character(len=*), | intent(in) | :: | name | Tag name. |
Tag content.
Return tag content of tag named name.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=I4P), | public | :: | t | Counter. |
pure function content(self, name)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return tag content of tag named *name*.
!<
!< @note If there is no value, the *tag_content* string is returned deallocated.
!---------------------------------------------------------------------------------------------------------------------------------
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 (self%Nt>0) then
do t=1, self%Nt
content = self%tag(t)%content(name=name)
if (allocated(content)) exit
enddo
endif
!---------------------------------------------------------------------------------------------------------------------------------
endfunction content