write_self_closing_tag Subroutine

private subroutine write_self_closing_tag(self, name, attributes)

Arguments

TypeIntentOptionalAttributesName
class(xml_writer_abstract), intent(inout) :: self
character, intent(in) :: name
character, intent(in), optional :: attributes

Contents


Source Code

   subroutine write_self_closing_tag(self, name, attributes)
   !< Write `<tag_name.../>` self closing tag.
   class(xml_writer_abstract), intent(inout)        :: self       !< Writer.
   character(*),               intent(in)           :: name       !< Tag name.
   character(*),               intent(in), optional :: attributes !< Tag attributes.

   self%tag = xml_tag(name=name, attributes_stream=attributes, sanitize_attributes_value=.true., indent=self%indent, &
                      is_self_closing=.true.)
   if (.not.self%is_volatile) then
      call self%tag%write(unit=self%xml, iostat=self%error, is_indented=.true., end_record=end_rec)
   else
      self%xml_volatile = self%xml_volatile//self%tag%stringify(is_indented=.true.)//end_rec
   endif
   endsubroutine write_self_closing_tag