free Subroutine

private elemental subroutine free(self)

Free (reset) tag.

Type Bound

xml_tag

Arguments

Type IntentOptional Attributes Name
class(xml_tag), intent(inout) :: self

XML tag.


Source Code

   elemental subroutine free(self)
   !< Free (reset) tag.
   class(xml_tag), intent(inout) :: self !< XML tag.
   integer(I4P)                  :: i,j  !< Counter.

   call self%tag_name%free
   call self%tag_content%free
   self%pos = 0_I4P
   if (allocated(self%attribute)) then
      do j=1, size(self%attribute, dim=2)
         do i=1, size(self%attribute, dim=1)
            call self%attribute(i,j)%free
         enddo
      enddo
      deallocate(self%attribute)
      self%attributes_number = 0_I4P
   endif
   self%indent = 0_I4P
   self%is_self_closing = .false.
   self%level = 0_I4P
   self%id = 0_I4P
   self%parent_id = 0_I4P
   self%children_number = 0_I4P
   if (allocated(self%child_ID)) deallocate(self%child_ID)
   endsubroutine free