stringify_recursive Subroutine

private pure recursive subroutine stringify_recursive(self, tag, is_done, tag_string)

Convert recursively tags with children into a string.

Type Bound

xml_file

Arguments

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

XML file.

type(xml_tag), intent(in) :: tag

XML tag with children.

logical, intent(inout) :: is_done(:)

List of stringified tags.

character(len=:), intent(inout), allocatable :: tag_string

Output string containing the current tag.


Calls

proc~~stringify_recursive~~CallsGraph proc~stringify_recursive xml_file%stringify_recursive proc~stringify_recursive->proc~stringify_recursive proc~stringify xml_tag%stringify proc~stringify_recursive->proc~stringify chars chars proc~stringify->chars is_allocated is_allocated proc~stringify->is_allocated proc~end_tag xml_tag%end_tag proc~stringify->proc~end_tag proc~self_closing_tag xml_tag%self_closing_tag proc~stringify->proc~self_closing_tag proc~start_tag xml_tag%start_tag proc~stringify->proc~start_tag

Called by

proc~~stringify_recursive~~CalledByGraph proc~stringify_recursive xml_file%stringify_recursive proc~stringify_recursive->proc~stringify_recursive proc~stringify~2 xml_file%stringify proc~stringify~2->proc~stringify_recursive program~foxy_test_add_tag foxy_test_add_tag program~foxy_test_add_tag->proc~stringify~2 program~foxy_test_delete_tag foxy_test_delete_tag program~foxy_test_delete_tag->proc~stringify~2 program~foxy_test_parse_file_simple foxy_test_parse_file_simple program~foxy_test_parse_file_simple->proc~stringify~2 program~foxy_test_parse_string_nested_tags foxy_test_parse_string_nested_tags program~foxy_test_parse_string_nested_tags->proc~stringify~2 program~foxy_test_parse_string_simple foxy_test_parse_string_simple program~foxy_test_parse_string_simple->proc~stringify~2 program~foxy_test_write_tag foxy_test_write_tag program~foxy_test_write_tag->proc~stringify~2

Source Code

   recursive pure subroutine stringify_recursive(self, tag, is_done, tag_string)
   !< Convert recursively tags with children into a string.
   class(xml_file),               intent(in)    :: self       !< XML file.
   type(xml_tag),                 intent(in)    :: tag        !< XML tag with children.
   logical,                       intent(inout) :: is_done(:) !< List of stringified tags.
   character(len=:), allocatable, intent(inout) :: tag_string !< Output string containing the current tag.
   integer(I4P)                                 :: t          !< Counter.

   if (tag%children_number>0) then
      tag_string = tag_string//new_line('a')//tag%stringify(is_indented=.true., only_start=.true.)
      do t=1, tag%children_number
         call self%stringify_recursive(tag=self%tag(tag%child_id(t)), is_done=is_done, tag_string=tag_string)
         is_done(tag%child_id(t)) = .true.
      enddo
      tag_string = tag_string//new_line('a')//tag%stringify(is_indented=.true., only_end=.true.)
   else
      tag_string = tag_string//new_line('a')//tag%stringify(is_indented=.true.)
   endif
   endsubroutine stringify_recursive