source: XMLF90/doc/Tutorial/xpath/get_item_info.f90 @ 6

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

Import des sources XMLF90

File size: 771 bytes
Line 
1subroutine get_item_info(context,what,price,currency)
2type(xml_t), intent(in)       :: contex
3character(len=*), intent(out) :: what, price, currency
4
5!
6! Local variables
7!
8type(xml_t)        :: ff
9integer            :: status
10type(dictionary_t) :: attributes
11
12  !
13  ! context is read-only, so make a copy and sync just in case
14  !
15  ff = context
16  call sync_xmlfile(ff) 
17  !
18  call get_node(ff,path="price", &
19                attributes=attributes,pcdata=price,status=status)
20  call get_value(attributes,"currency",currency,status)
21  if (status /= 0) stop "missing currency attribute!"
22  !
23  ! Rewind to beginning of context
24  !
25  ff = context
26  call sync_xmlfile(ff) 
27  !
28  call get_node(ff,path="description",pcdata=what,status=status)
29
30end subroutine get_item_info
Note: See TracBrowser for help on using the repository browser.