source: XMLF90/doc/Examples/wxml/i.simple.f90 @ 6

Last change on this file since 6 was 6, checked in by ymipsl, 13 years ago

Import des sources XMLF90

File size: 1012 bytes
Line 
1program simple
2
3use flib_wxml
4
5type(xmlf_t) :: xf
6
7integer :: age = 34
8real, dimension(20)  :: x
9real, dimension(20,20)  :: y
10
11call xml_OpenFile("simple.xml",xf, indent=.true.)
12
13call xml_AddXMLDeclaration(xf,"UTF-8")
14call xml_NewElement(xf,"john")
15call xml_AddAttribute(xf,"age",str(age))
16call xml_NewElement(xf,"peter")
17call xml_NewElement(xf,"tim")
18call xml_AddAttribute(xf,"age","37")
19call xml_AddAttribute(xf,"weight",str(123.45,"(f7.3)"))
20call xml_AddAttribute(xf,"cholesterol",str(167.0,format="(f8.0)"))
21call xml_EndElement(xf,"tim")
22call xml_AddPcdata(xf,"Ping-pong")
23call xml_AddPcdata(xf,"champion", line_feed=.false.)
24call xml_AddPcdata(xf," in 2004", space=.false., line_feed=.false.)
25call xml_NewElement(xf,"data")
26call xml_AddAttribute(xf,"units","eV")
27call random_number(x)
28call random_number(y)
29call xml_AddArray(xf,x)
30call xml_AddArray(xf,reshape(y,(/ 400 /)))
31call xml_EndElement(xf,"data")
32call xml_EndElement(xf,"peter")
33call xml_EndElement(xf,"john")
34
35call xml_Close(xf)
36
37end program simple
Note: See TracBrowser for help on using the repository browser.