Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | XML tag. |
||
character(len=*), | intent(in) | :: | name | Attribute name. |
Inquire result.
Return .true. it the queried attribute name is defined, .false. otherwise.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=I4P), | public | :: | a | Counter. |
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