start_tag Function

private pure function start_tag(self, is_indented) result(tag_)

Return <tag_name...> start tag.

Type Bound

xml_tag

Arguments

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

XML tag.

logical, intent(in), optional :: is_indented

Flag to check if tag is indented.

Return Value character(len=:), allocatable

The start tag string.


Called by

proc~~start_tag~~CalledByGraph proc~start_tag xml_tag%start_tag proc~stringify xml_tag%stringify proc~stringify->proc~start_tag proc~create_tag_nested create_tag_nested proc~create_tag_nested->proc~stringify proc~stringify_recursive xml_file%stringify_recursive proc~stringify_recursive->proc~stringify proc~stringify_recursive->proc~stringify_recursive proc~stringify~2 xml_file%stringify proc~stringify~2->proc~stringify proc~stringify~2->proc~stringify_recursive proc~write_tag xml_tag%write_tag proc~write_tag->proc~stringify program~foxy_test_add_attributes foxy_test_add_attributes program~foxy_test_add_attributes->proc~stringify program~foxy_test_create_tag foxy_test_create_tag program~foxy_test_create_tag->proc~stringify program~foxy_test_delete_attributes foxy_test_delete_attributes program~foxy_test_delete_attributes->proc~stringify program~foxy_test_delete_content foxy_test_delete_content program~foxy_test_delete_content->proc~stringify program~foxy_test_indent_tag foxy_test_indent_tag program~foxy_test_indent_tag->proc~stringify interface~xml_tag xml_tag interface~xml_tag->proc~create_tag_nested 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

   pure function start_tag(self, is_indented) result(tag_)
   !< Return `<tag_name...>` start tag.
   class(xml_tag), intent(in)           :: self        !< XML tag.
   logical,        intent(in), optional :: is_indented !< Flag to check if tag is indented.
   character(len=:), allocatable        :: tag_        !< The start tag string.

   tag_ = '<'//self%tag_name
   if (self%attributes_number>0) tag_ = tag_//' '//self%attributes()
   tag_ = tag_//'>'
   if (present(is_indented)) then
      if (is_indented) tag_ = repeat(' ', self%indent)//tag_
   endif
   endfunction start_tag