is_attribute_present Function

private pure function is_attribute_present(self, name) result(is_present)

Arguments

TypeIntentOptionalAttributesName
class(xml_tag), intent(in) :: self
character, intent(in) :: name

Return Value logical


Contents

Source Code


Source Code

  pure function is_attribute_present(self, name) result(is_present)
  !< Return .true. it the queried attribute name is defined, .false. otherwise.
  class(xml_tag), intent(in) :: self       !< XML tag.
  character(*),   intent(in) :: name       !< Attribute name.
  logical                    :: is_present !< Inquire result.
  integer(I4P)               :: a          !< Counter.

  is_present = .false.
  if (self%attributes_number>0) then
    do a=1, self%attributes_number
      if (self%attribute(1, a)==name) then
        is_present = .true.
        exit
      endif
    enddo
  endif
  endfunction is_attribute_present