Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_file), | intent(in) | :: | self | XML file. |
Output string containing the whole xml file.
Convert the whole file data into a string.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | tag_string | Output string containing the current tag. |
||
integer(kind=I4P), | public | :: | t | Counter. |
pure function stringify(self) result(string)
!---------------------------------------------------------------------------------------------------------------------------------
!< Convert the whole file data into a string.
!---------------------------------------------------------------------------------------------------------------------------------
class(xml_file), intent(in) :: self !< XML file.
character(len=:), allocatable :: string !< Output string containing the whole xml file.
character(len=:), allocatable :: tag_string !< Output string containing the current tag.
integer(I4P) :: t !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
string = ''
if (self%Nt>0) then
do t=1, self%Nt - 1
tag_string = self%tag(t)%stringify()
string = string//tag_string//new_line('a')
enddo
tag_string = self%tag(self%Nt)%stringify()
string = string//tag_string
endif
!---------------------------------------------------------------------------------------------------------------------------------
endfunction stringify