开发者

Parsing XML in C from a DTD and building a linked-list accordingly

开发者 https://www.devze.com 2022-12-23 00:42 出处:网络
I\'m trying to parse an XML file using C. The DTD for this XML file is fairly simple. It\'s basically a bunch of key-value pairs, with support for arrays as well.

I'm trying to parse an XML file using C.

The DTD for this XML file is fairly simple. It's basically a bunch of key-value pairs, with support for arrays as well.

I've found XML parsers like Mini-XML and AsmXml, but they don't seem to support building a linked-list of the XML file based on the DTD. Is there an XML parsing library available that can read a DTD, and then convert the XML data into a linked list that I can easily search, access, etc?

Since this XML fil开发者_如何转开发e is a bunch of key-value pairs, I'd like the XML parser to read the XML file, put it into a linked list, and then allow me to do something like xml_lookup_key(xml_data, "Name"), which would return something like John Doe, or xml_lookup_key(xml_data, "lastNames") which would return a linked list of last names.

Any help would be appreciated.


Have you looked at libxml2 or RXP?

From my experience libxml2 is probably the best XML library available in C.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号