assign_tag Subroutine

private elemental subroutine assign_tag(lhs, rhs)

Assignment between two tags.

Type Bound

xml_tag

Arguments

Type IntentOptional Attributes Name
class(xml_tag), intent(inout) :: lhs

Left hand side.

type(xml_tag), intent(in) :: rhs

Right hand side.


Calls

proc~~assign_tag~~CallsGraph proc~assign_tag xml_tag%assign_tag is_allocated is_allocated proc~assign_tag->is_allocated

Source Code

   elemental subroutine assign_tag(lhs, rhs)
   !< Assignment between two tags.
   class(xml_tag), intent(inout) :: lhs !< Left hand side.
   type(xml_tag),  intent(in)    :: rhs !< Right hand side.
   integer(I4P)                  :: a   !< Counter.

   call lhs%free
   if (rhs%tag_name%is_allocated()) lhs%tag_name = rhs%tag_name
   if (rhs%tag_content%is_allocated()) lhs%tag_content = rhs%tag_content
   lhs%pos = rhs%pos
   if (rhs%attributes_number>0) then
      allocate(lhs%attribute(1:2, 1:rhs%attributes_number))
      do a=1, rhs%attributes_number
         lhs%attribute(1:2, a) = rhs%attribute(1:2, a)
      enddo
   endif
   lhs%attributes_number = rhs%attributes_number
   lhs%indent = rhs%indent
   lhs%is_self_closing = rhs%is_self_closing
   lhs%level = rhs%level
   lhs%id = rhs%id
   lhs%parent_id = rhs%parent_id
   lhs%children_number = rhs%children_number
   if (allocated(rhs%child_ID)) lhs%child_ID = rhs%child_ID
   endsubroutine assign_tag