erlang - Parsing and accessing untrusted XML -


i have kind of xml transformation gateway , accepts xml in 1 format , produces other sources rather not trust to. now, transformations can either trivial, in changing couple of attrs here , there, or quite complex, need disassemble entire input , build output scratch. so, have 2 problems:

  1. parsing xml. needs fast ( preferably ) , work without blowing atoms table ( looking @ you, xmerl ) since sources not reliable.

  2. easily accessing nested elements retrieve information required rebuild.

while there few options parsing xml, fast_xml , erlsom libraries, generate structures rather hard access since not comparatible xmerl_xpath , far that's sane way have found nested data.

so question whether there way achieve goals without spending lots of time on creating own solution?

p.s. seriously? trying close question? not asking library use out of 100 available, asking how solve problem may occur of people decide use erlang xml handling.

i not able find ready solution problem ended doing following:

1) use erlsom or fast xml erlang packages parsing xml string what's called simple format, following: {"tag", [{"attr", "value"}], ["text node"]} children can list 1 string, in example, or list of nested elements.

2) implement own function nested elements according given path, basic usage doesn't take more 50 loc

3) implement own xml builder since xmerl cannot used again because of atoms problem. now, part rather controversial because there chance has number of bugs , not support comments, cdata , whatnot testing proper data, able make stable enough. choice have anyway?!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -