processone / fast_xml

Fast Expat based Erlang XML parsing library
Apache License 2.0
132 stars 46 forks source link

xmlel vs xmerl records #5

Open aaronjensen opened 8 years ago

aaronjensen commented 8 years ago

Hi there, I apologize if I'm missing something obvious, but it looks like fast_xml puts out records that are incompatible with things like xmerl_xpath. Is that intentional? I wasn't able to find anything about xmlel. It'd be great if I could use it as a drop in replacement for xmerl's scan but still be able to use its xpath querying. Thanks!

aaronjensen commented 8 years ago

It occurred to me that maybe xmerl was using these other record forms in the past, but isn't now, is that what is going on? Would you be opposed to moving fast_xml to the new record forms for a major version update?

prefiks commented 8 years ago

This library was developed for ejabberd, and i think it was using #xmlel even before xmerl was a thing, so pretty much it's like that for historical reasons.

aaronjensen commented 8 years ago

Gotcha, would it be worth moving to xmerl records types for forwards compat? It'd be nice to be able to use it with SweetXml, for example

prefiks commented 8 years ago

I will probably add option to parser functions to change output that would generate xmerl compatible output.

aaronjensen commented 8 years ago

That would be great. We use fxml_stream:parse_element/1 so it'd be great if we could pass options to that.

9mm commented 5 years ago

is there any way i can do xpath with what fast_xml returns?

zinid commented 5 years ago

@9mm no.