Skip to content

Commit

Permalink
dom: test parseString
Browse files Browse the repository at this point in the history
A single simple test of this function.
  • Loading branch information
andreww committed Jul 6, 2013
1 parent c17beb5 commit 8f1e4c0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dom/test/test_dom_parseString.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -e

for t in ${0%.sh}_*.f90
do
TEST=${t%.f90}
./test.sh $TEST
done
24 changes: 24 additions & 0 deletions dom/test/test_dom_parseString_1.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
program dom
use FoX_dom
implicit none

integer :: i
type(Node), pointer :: doc, name
type(NodeList), pointer :: nameList
character(200) :: name_text

doc => parseString('<?xml version="1.0" encoding="ISO-8859-1"?> <name>[_tmp]:=somecommand(data, 0, 1)</name>')

nameList => getElementsByTagname(doc, "name")

do i = 0, getLength(nameList) - 1
name_text = ''
name => item(nameList,i)

name_text = getTextContent(name)

write(*,*) trim(name_text)
enddo

call destroy(doc)
end program dom
1 change: 1 addition & 0 deletions dom/test/test_dom_parseString_1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[_tmp]:=somecommand(data, 0, 1)

0 comments on commit 8f1e4c0

Please sign in to comment.