New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
get_item_info.f90 in vendors/XMLF90/current/doc/Tutorial/xpath – NEMO

source: vendors/XMLF90/current/doc/Tutorial/xpath/get_item_info.f90 @ 1967

Last change on this file since 1967 was 1967, checked in by flavoni, 14 years ago

importing XMLF90 vendor

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.