Pages

Thursday, October 31, 2013

XMLlucination: XML pseudo-parser

XMLlucination is a pseudo-parser for XML documents, in which you can locate nodes and read attributes or raw text between nodes. Yes. It is raw text - anything between nodes, not intelligently extract text elements only. :P

This code applies the same license terms of Lazarus, LGPL with additionally accepting static link.

Quick start guide:

  1. Load a file to array of PChar or String
  2. Use LocateNodePair() to get a TNodePair
  3. Use GetAttributeValue() with TNodePair.Open to search for a attribute value
  4. Use GetNodeValue() with TNodePair object
Hope you like it. Happy coding!

Edit at April 21th. 2014:In the original posting at Oct. 31. 2013, I opened the full source code here but now I replace the code with download link to Google Drive. I found out the source code is broken, which is expected to unexpected Tumblr behavior(replacing the quotation mark to unicode characters, deleting ‘less than’ sign accidentally, etc).

Click here to download the file.

No comments:

Post a Comment