Copyright © 2024, Fred Youhanaie
Behaviours: gen_xml
.
Authors: Fred Youhanaie (fyrlang@anydata.co.uk
).
A simple gen_xml
callback module that produces the XML paths in
the document. This similar to the xmlstarlet el
command, see
https://xmlstar.sourceforge.net/docs.php.
/
separated paths,
showing the structure of the document.
handle_begin/3 | The callback function for begin tags. |
handle_end/2 | The callback function for end tags. |
handle_text/2 | The callback function for text elements. |
print/1 | Helper function to scan an entire XML document. |
handle_begin(Tag::atom(), Attr::list(), Tags::list()) -> list()
The callback function for begin tags.
Each call prints the paths collected so far.
The attributes are ignored.handle_end(Tag::atom(), Tags::list()) -> list()
The callback function for end tags.
We remove the first (inner tag) from the list.handle_text(Text::string(), Tags::list()) -> list()
The callback function for text elements.
No action is performed with these elements.print(File::file:filename()) -> gen_xml:read_ret()
Helper function to scan an entire XML document.
Generated by EDoc