Skip to content

TheMadman/descent-xml

Repository files navigation

Descent XML - An XML Parser-Helper Library

Descent XML provides a tokenizer and helper functions for writing an XML parser.

Quickstart: Nix

This repo (as well as libadt) use Nix files to provide quick dependency management and a simple-to-use build environment.

  • Install the Nix package manager: https://nixos.org/download/
  • Use nix-build to compile the project for production
    • The compiled results will be placed in result
  • Use nix-shell to enter a shell with build dependencies installed
    • This environment will have libadt, cmake, gcc, gdb and doxygen available, and set up CFLAGS with many useful debugging flags

From there, you can use the build steps described in the Configuration and Documentation sections below.

Manual Building

Dependencies

Configuration

Building uses CMake, providing a couple of custom flags for tests and examples in the documentation:

mkdir build
cd build
# Add other cmake command options to taste, e.g.
# -DBUILD_TESTING=True -DBUILD_EXAMPLES=True
cmake ..
make install

Link with -ldescent-xml -ladt. For static linking, use -ldescent-xmlstatic.

Documentation

Tutorials and reference documentation can be found at https://themadman.github.io/descent-xml/. Documentation can be built using doxygen, which will generate a html/index.html that can be opened.

Bugs/Shortcomings

  • Currently, Descent XML just uses the application's encoding. It doesn't support reading the encoding provided in the XML and parsing it, separately from the application's CTYPE locale setting. This should be fixed in lex.h.
  • There isn't an easy interface to parse partial XML, for example from a partially-filled buffer.
  • Only simple !DOCTYPEs are supported. The !DOCTYPE name is not validated against the root node.
  • The library works by passing around pointers into the original script, meaning:
    • entities are passed as-is, without being processed; and
    • text nodes with embedded ![CDATA[]] sections will call the text callback separately.
  • Processing Instructions are not implemented.
  • Schema validation is not implemented.
  • Probably more issues, idk. I'm sick of looking at this stupid standard.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published