expat

홈페이지: http://expat.sourceforge.net/

xml 파서 라이브러리.

Expat is an XML parser library written in C

int main()
{
  char buf[convenient size];
  int len;   /* len is the number of bytes in the current bufferful of data */
  int done;
  int depth = 0;  /* nothing magic about this; the sample program tracks depth to know how far to indent. */
                  /* depth is thus going to be the user data for this parser. */

  XML_Parser parser = XML_ParserCreate(NULL);
  XML_SetUserData(parser, &depth);
  XML_SetElementHandler(parser, startElement, endElement);
  do {
    get a piece of input into the buffer
    done = whether this bufferful is the last bufferful
    if (!XML_Parse(parser, buf, len, done)) {
      handle parse error
      return 1;
    }
  } while (!done);
  XML_ParserFree(parser);
  return 0;
}

다운로드: 2.01

Libcroco

홈페이지: http://www.freespiders.org/projects/libcroco

libxml이 xml을 해석하듯 css를 해석해주는 라이브러리. cssom까지 제공한다.

Libcroco is a general CSS parsing and manipulation library written in C for the GNOME project. It provides a CSS2 parser (SAC and CSSOM API), and a CSS2 selection engine. It uses Libxml2 as underlying XML platform and the GLib as a portability layer.

다운로드: 0.6.2