!simple program just reads the first argument as xml program xmltest ! use xml ! use mock_type ! character *256 file ! call getarg(1,file) ! call xml_read(file) use FoX_DOM use mock_def use mock_xml type(Node), pointer :: doc, root type(Mock), pointer :: model => null() character *256 file call getarg(1, file) !parse the file into the document tree doc => parseFile(file) !get the root element of the document root => getDocumentElement(doc) model => parseMockNode(root) ! ! !get the model type, aka root element name ! model = getTagName(root) ! print*, "model:", model ! ! !get the format version ! formatVersion = parseModelVersion(root, "format") ! metaVersion = parseModelVersion(root, "meta") ! ! ! print*, "format:", formatVersion ! print*, "meta:", metaVersion ! ! !get the name call mock_print(model) call mock_destroy(model) !cleanup memory used to parse the xml call destroy(doc) !clean up memory used for the model object !exit with success stop 0 end program