3

What are the recommended XML parsers for parsing a TMX file(XML based tilemap) in C?

What are the pros and cons of each, as I would like to have an efficient one because it will be running on an embedded system.

some_id
  • 29,466
  • 62
  • 182
  • 304
  • 1
    What type of embedded system, a msp430@8MHz with 64kB flash or a ARM11 imx31@500MHz with Linux and 1GB flash? – jeb Mar 28 '11 at 14:33

3 Answers3

2

We used libxml on an embedded product a while back. It may be right for you.

TomM
  • 375
  • 3
  • 16
1

On a high-level I think you should be looking at an event based parser rather than a DOM based one. DOM based parsers will take up a lot of memory building the XML tree.

Here's a from a similiar question. The top suggestion from that case looks to be one of the earliest xml parsers: Expat.

Community
  • 1
  • 1
PPC-Coder
  • 3,522
  • 2
  • 21
  • 30
0

I have written sxmlc as a lightweight, potentially embeddable XML parser in C. See my answer on a related question (also linked by @PPC-Coder).

You can use it as DOM or SAX (to save memory), to parse either files or memory buffers.

Community
  • 1
  • 1
Matthieu
  • 2,736
  • 4
  • 57
  • 87
  • A word of caution, repeatedly promoting your own project may get you flagged for excessive self-promotion - especially since these "recommend a library" questions are explicitly off-topic. – nobody Jul 10 '14 at 16:06