[erlang-questions] xmerl documentation
Tue Jan 6 07:17:18 CET 2009
I am having a hard time working my way through some simple xml
processing because I cannot understand the documentation.
Q. From the xmerl reference, one of the exports is
callbacks(M::atom()) -> [atom()]
Find the list of inherited callback modules for a given module.
What does the double colon notation mean : M::atom() in the above?
What is the purpose of the function - what is an example of its usage.
I tried this:
** exception error: undefined function xmerl:'#xml-inheritance#'/0
in function xmerl:check_inheritance/2
in call from xmerl:callbacks/1
So what is the point?
export_simple(Data::Content, Callback, RootAttrs::RootAttributes) ->
Content = [Element]
Callback = atom()
RootAttributes = [XmlAttributes]
Exports "simple-form" XML content, using the specified callback-module.
Q: What are the atoms that can be used as the Callback. They are not
defined in the reference manual. From reading the tutorial and list
messages I know about xmerl_xml, and xmerl_html but have not seen any
definitions of the effect of these on the content.
Q: What is ExportedFormat ? AFAICT it is not defined in the reference manual.
28> xmerl:export_simple_content([Data], xmerl_xml).
29> lists:flatten(xmerl:export_simple_content([Data], xmerl_xml)).
export_simple_content(Data, Callback) -> term()
Exports simple XML content directly, without further context.
Comment: A term() is any erlang data structure -- but a list is returned.
Comment: I would not call the output from this function 'simple XML
content', I was expecting a string.
Q. What is the 'context' that this and many other functions in xmerl
can do without?
Sorry for so many questions in total frustration ....
More information about the erlang-questions