source:
vendors/XMLF90/current/doc/Tutorial/xpath/get_item_info.f90
@
1960
Last change on this file since 1960 was 1960, checked in by flavoni, 14 years ago | |
---|---|
File size: 771 bytes |
Line | |
---|---|
1 | subroutine get_item_info(context,what,price,currency) |
2 | type(xml_t), intent(in) :: contex |
3 | character(len=*), intent(out) :: what, price, currency |
4 | |
5 | ! |
6 | ! Local variables |
7 | ! |
8 | type(xml_t) :: ff |
9 | integer :: status |
10 | type(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 | |
30 | end subroutine get_item_info |
Note: See TracBrowser
for help on using the repository browser.