write_start_tag Subroutine

private subroutine write_start_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


Source Code

   subroutine write_start_tag(self, name, attributes)
   !< Write `<tag_name...>` start 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)
   if (.not.self%is_volatile) then
      call self%tag%write(unit=self%xml, iostat=self%error, is_indented=.true., end_record=end_rec, only_start=.true.)
   else
      self%xml_volatile = self%xml_volatile//self%tag%stringify(is_indented=.true., only_start=.true.)//end_rec
   endif
   self%indent = self%indent + 2
   endsubroutine write_start_tag