foxy_test_delete_tag Program

Uses

  • program~~foxy_test_delete_tag~~UsesGraph program~foxy_test_delete_tag foxy_test_delete_tag module~foxy foxy program~foxy_test_delete_tag->module~foxy module~foxy_xml_file foxy_xml_file module~foxy->module~foxy_xml_file module~foxy_xml_tag foxy_xml_tag module~foxy->module~foxy_xml_tag module~penf~6 penf module~foxy->module~penf~6 module~foxy_xml_file->module~foxy_xml_tag module~foxy_xml_file->module~penf~6 module~foxy_xml_tag->module~penf~6 module~stringifor stringifor module~foxy_xml_tag->module~stringifor module~penf_allocatable_memory~2 penf_allocatable_memory module~penf~6->module~penf_allocatable_memory~2 module~penf_b_size~2 penf_b_size module~penf~6->module~penf_b_size~2 module~penf_global_parameters_variables~3 penf_global_parameters_variables module~penf~6->module~penf_global_parameters_variables~3 module~penf_stringify~4 penf_stringify module~penf~6->module~penf_stringify~4 module~penf_allocatable_memory~2->module~penf_global_parameters_variables~3 module~penf_allocatable_memory~2->module~penf_stringify~4 iso_fortran_env iso_fortran_env module~penf_allocatable_memory~2->iso_fortran_env module~penf_b_size~2->module~penf_global_parameters_variables~3 module~penf_stringify~4->module~penf_b_size~2 module~penf_stringify~4->module~penf_global_parameters_variables~3 module~penf_stringify~4->iso_fortran_env module~stringifor->module~penf~6 module~stringifor_string_t~2 stringifor_string_t module~stringifor->module~stringifor_string_t~2 module~stringifor_string_t~2->module~penf~6 module~stringifor_string_t~2->iso_fortran_env module~befor64~3 befor64 module~stringifor_string_t~2->module~befor64~3 module~face~3 face module~stringifor_string_t~2->module~face~3 module~befor64~3->module~penf~6 module~befor64_pack_data_m befor64_pack_data_m module~befor64~3->module~befor64_pack_data_m module~face~3->iso_fortran_env module~befor64_pack_data_m->module~penf~6

Calls

program~~foxy_test_delete_tag~~CallsGraph program~foxy_test_delete_tag foxy_test_delete_tag proc~delete_tag xml_file%delete_tag program~foxy_test_delete_tag->proc~delete_tag proc~parse~2 xml_file%parse program~foxy_test_delete_tag->proc~parse~2 proc~stringify~2 xml_file%stringify program~foxy_test_delete_tag->proc~stringify~2 proc~name xml_tag%name proc~delete_tag->proc~name proc~load_file_as_stream load_file_as_stream proc~parse~2->proc~load_file_as_stream proc~parse_from_string xml_file%parse_from_string proc~parse~2->proc~parse_from_string proc~stringify xml_tag%stringify proc~stringify~2->proc~stringify proc~stringify_recursive xml_file%stringify_recursive proc~stringify~2->proc~stringify_recursive proc~chars string%chars proc~name->proc~chars proc~add_child xml_file%add_child proc~parse_from_string->proc~add_child proc~add_tag xml_file%add_tag proc~parse_from_string->proc~add_tag proc~get_tag_content get_tag_content proc~parse_from_string->proc~get_tag_content proc~parse_tag_name~2 parse_tag_name proc~parse_from_string->proc~parse_tag_name~2 proc~set xml_tag%set proc~parse_from_string->proc~set interface~str str proc~stringify->interface~str proc~attributes xml_tag%attributes proc~stringify->proc~attributes proc~stringify->proc~chars proc~end_tag xml_tag%end_tag proc~stringify->proc~end_tag proc~is_allocated string%is_allocated proc~stringify->proc~is_allocated proc~self_closing_tag xml_tag%self_closing_tag proc~stringify->proc~self_closing_tag proc~start_tag xml_tag%start_tag proc~stringify->proc~start_tag proc~stringify_recursive->proc~stringify proc~stringify_recursive->proc~stringify_recursive proc~str_a_i1p str_a_I1P interface~str->proc~str_a_i1p proc~str_a_i2p str_a_I2P interface~str->proc~str_a_i2p proc~str_a_i4p str_a_I4P interface~str->proc~str_a_i4p proc~str_a_i8p str_a_I8P interface~str->proc~str_a_i8p proc~str_a_r4p str_a_R4P interface~str->proc~str_a_r4p proc~str_a_r8p str_a_R8P interface~str->proc~str_a_r8p proc~str_bol str_bol interface~str->proc~str_bol proc~str_i1p str_I1P interface~str->proc~str_i1p proc~str_i2p str_I2P interface~str->proc~str_i2p proc~str_i4p str_I4P interface~str->proc~str_i4p proc~str_i8p str_I8P interface~str->proc~str_i8p proc~str_r4p str_R4P interface~str->proc~str_r4p proc~str_r8p str_R8P interface~str->proc~str_r8p proc~strf_i1p strf_I1P interface~str->proc~strf_i1p proc~strf_i2p strf_I2P interface~str->proc~strf_i2p proc~strf_i4p strf_I4P interface~str->proc~strf_i4p proc~strf_i8p strf_I8P interface~str->proc~strf_i8p proc~strf_r4p strf_R4P interface~str->proc~strf_r4p proc~strf_r8p strf_R8P interface~str->proc~strf_r8p proc~add_child_id xml_tag%add_child_id proc~add_child->proc~add_child_id proc~find_matching_end_tag find_matching_end_tag proc~get_tag_content->proc~find_matching_end_tag proc~self_closing_tag->proc~attributes proc~add_multiple_attributes xml_tag%add_multiple_attributes proc~set->proc~add_multiple_attributes proc~add_single_attribute xml_tag%add_single_attribute proc~set->proc~add_single_attribute proc~add_stream_attributes xml_tag%add_stream_attributes proc~set->proc~add_stream_attributes proc~start_tag->proc~attributes proc~add_multiple_attributes->proc~add_single_attribute proc~alloc_attributes xml_tag%alloc_attributes proc~add_single_attribute->proc~alloc_attributes proc~add_stream_attributes->proc~add_single_attribute proc~fill string%fill proc~add_stream_attributes->proc~fill proc~partition string%partition proc~add_stream_attributes->proc~partition proc~slice string%slice proc~add_stream_attributes->proc~slice proc~str_a_i1p->proc~str_i1p proc~str_a_i2p->proc~str_i2p proc~str_a_i4p->proc~str_i4p proc~str_a_i8p->proc~str_i8p proc~str_a_r4p->proc~str_r4p proc~str_a_r8p->proc~str_r8p proc~compact_real_string compact_real_string proc~str_r4p->proc~compact_real_string proc~str_r8p->proc~compact_real_string

Variables

Type Attributes Name Initial
character(len=:), allocatable :: source
character(len=:), allocatable :: parsed
type(xml_file) :: a_file
type(xml_tag) :: a_tag
type(xml_tag) :: another_tag
logical :: test_passed(2)

Source Code

program foxy_test_delete_tag
!< FoXy test.
use foxy, only: xml_file, xml_tag

implicit none
character(len=:), allocatable :: source         !< String containing the source XML data.
character(len=:), allocatable :: parsed         !< String containing the parsed XML data.
type(xml_file)                :: a_file         !< XML tag handler.
type(xml_tag)                 :: a_tag          !< XML tag handler.
type(xml_tag)                 :: another_tag    !< XML tag handler.
logical                       :: test_passed(2) !< List of passed tests.

test_passed = .false.

print "(A)", 'source'
source = '<first x="1" y="c" z="2">lorem ipsum...</first>'//new_line('a')//&
         '<third>bye</third>'//new_line('a')//&
         '<fourth a="3">bye bye Mrs. Robinson</fourth>'
print "(A)", source
print "(A)", 'parsed'
call a_file%parse(string=source)
print "(A)", 'remove "third" tag'
source = '<first x="1" y="c" z="2">lorem ipsum...</first>'//new_line('a')//&
         '<fourth a="3">bye bye Mrs. Robinson</fourth>'
call a_file%delete_tag(name="third")
parsed = a_file%stringify()
test_passed(1) = trim(adjustl(source))==trim(adjustl(parsed))
print "(A,L1)", parsed//' Is correct? ', test_passed(1)

print "(A)", 'remove "first" tag'
source = '<fourth a="3">bye bye Mrs. Robinson</fourth>'
call a_file%delete_tag(name="first")
parsed = a_file%stringify()
test_passed(2) = trim(adjustl(source))==trim(adjustl(parsed))
print "(A,L1)", parsed//' Is correct? ', test_passed(2)

print "(A,L1)", new_line('a')//'Are all tests passed? ', all(test_passed)
endprogram foxy_test_delete_tag