source:
vendors/XMLF90/current/doc/Examples/sax/features/README
@
1963
Last change on this file since 1963 was 1963, checked in by flavoni, 14 years ago | |
---|---|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[1963] | 1 | This directory contains a very simple but complete example of the use |
2 | of the XML parser. | |
3 | ||
4 | The program, in file "example.f90", uses the module "m_handlers", which | |
5 | contains the handlers for the basic events: begin_element, end_element, and | |
6 | pcdata_chunk, as well as for the other, less useful events: XML and SGML | |
7 | declarations, and comments. | |
8 | ||
9 | The program opens the XML file, obtaining a file object, and calls | |
10 | xml_parse with the above handlers. | |
11 | ||
12 | In this particular case, the handler action is just to print out | |
13 | element/attribute information, and to dump any PCDATA sections, comments, and | |
14 | declarations, but "test.xml" shows all the constructs that the parser | |
15 | recognizes: standard and character entities, CDATA sections, etc. | |
16 | ||
17 | Turning on the 'verbose' flag in the call to xml_parse will result in a | |
18 | more detailed look at the workings of the parser. | |
19 | ||
20 | Type 'make' to compile, and 'example' to execute. | |
21 | ||
22 | ** | |
23 | ||
24 | As a trivial example, the program xmlcheck will just check for | |
25 | well-formedness and print a count of characters processed. The | |
26 | name of the input file is hardwired to "INP" (one should of course | |
27 | pick it from the command line, perhaps using the f2kcli module). | |
28 |
Note: See TracBrowser
for help on using the repository browser.