hyperboreean
hyperboreean

Reputation: 8343

Erlang xml parsing with bit syntax

I am trying to write a specific xml parser for some kind of API and I was wondering if I can get it working without the existing xml parsers like xmerl. How feasible would be to implement it using only bit syntax and is there any online doc where shows how you can get started on parsing xml this way?

Upvotes: 3

Views: 683

Answers (1)

user177800
user177800

Reputation:

It is not feasible, XML parsers are available for a reason, it if was feasible then the dedicated parsers would not exist. Bit syntax is only good for when the order of the bits/bytes is fixed. XML does not mandate order of attributes, and most people don't realize that the XML spec is does not mandate order of sibling elements either. So trying to match anything with the bit syntax would not work with all possible inputs of XML just with the unordered nature of attributes, much less unordered sibling elements. Just use an XML parser, this isn't a hill you want to die on.

Upvotes: 7

Related Questions