[erlang-questions] xmerl/xpath alternatives?

Adam Rutkowski <>
Tue Apr 2 21:34:16 CEST 2013


Hi List,

I need to provide a configurable set of validation rules for arbitrary 
user-generated XML documents. XPath would be just fine.

i.e. {"/foo/bar[1]/baz", 'in', [1,2,3], 'accept'}

But there's a catch - xmerl produces atoms so malicious user could take my VM down 
without trying too hard.

I'm thinking of two ugly hacks as I need to ship soon:

1) Bootstrapping a separate Erlang VM with heart enabled only 
   for the sake of dealing with XPath predicates.
2) Forking the simple parser found here [1] and making it compatible with jsonpath [2],
   as I'm already using the latter for arbitrary JSON documents, which I need to handle as well.

Solutions above are far from being right... Suggestions appreciated. 

[1] https://github.com/maxlapshin/parsexml
[2] https://github.com/GeneStevens/jsonpath

--
Adam












More information about the erlang-questions mailing list