fast_xml icon indicating copy to clipboard operation
fast_xml copied to clipboard

xmlel vs xmerl records

Open aaronjensen opened this issue 9 years ago • 7 comments

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 avatar May 06 '16 02:05 aaronjensen

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?

aaronjensen avatar May 06 '16 20:05 aaronjensen

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.

prefiks avatar May 06 '16 21:05 prefiks

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

aaronjensen avatar May 06 '16 21:05 aaronjensen

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

prefiks avatar May 07 '16 07:05 prefiks

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

aaronjensen avatar May 07 '16 14:05 aaronjensen

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

9mm avatar Nov 23 '18 00:11 9mm

@9mm no.

zinid avatar Nov 23 '18 07:11 zinid