View Source xmltree (util v1.1.5)

Parse XML into a hierarchical Erlang term
   % Example xml:
  
    <?xml version="1.0" encoding="UTF-8" ?>
    <root id="1">
      <ele id="2"/>
      <ele id="3">vvv\nxxx\n</ele>
    </root>
  
  
   # Usage example
   1> xmltree:file(L).
   {root,[{id,<<"1">>}],
        [{ele,[{id,<<"2">>}],[]},
         {ele,[{id,<<"3">>}],<<"vvv\nxxx\n">>}]}
  
   2> Rules = {root, [{id,integer}], [{ele, [{id,integer}], string}]},
   2> xmltree:string(L, Rules).
   {root,[{id,1}],
      [{ele,[{id,2}],[]},{ele,[{id,3}],"vvv\nxxx\n"}]}

Link to this section Summary

Link to this section Functions