write_tag Subroutine

private subroutine write_tag(self, name, attributes, content)

Arguments

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

Contents

Source Code


Source Code

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

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