[erlang-questions] Rant: I hate parsing XML with Erlang
Willem de Jong
Wed Oct 24 08:14:21 CEST 2007
On 10/23/07, Zvi <> wrote:
> There are two major types of XML:
> 1. Document-oriented (also Unstructured)
> 2. Data-oriented (also Structured)
> To support document-oriented XML, you need generic XML parser with
> namespaces, CDATA, PI, UTF-8 and XPath/XQuery support.
> For data-oriented XML, you do not need generic parser, but XML Data
> tool, like XSD to Erlang compiler (xsd2erl) (like XMLBeans for Java, or
> RogueWave LIEF for C++, etc.), i.e. you giving employee.xsd and it's
> compiled into employee.erl module, which you then use in your application
> parse and generate XML instances, conforming to employee.xsd schema.
Erlsom is an XML Data Binding Tool written in Erlang.
It doesn't generate code (except for a header file with record definitions),
but the effect is the same: When you parse employee.xml, it uses (a
'compiled' version of) employee.xsd to translate it to a structure of
records that correspond to the types defined in the XSD. Or the other way
around: given such a structure, it can generate the XML.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions