gramps_xml 0.1.0

Rust library to work with Gramps XML files.
Documentation
  • Coverage
  • 0.25%
    1 out of 405 items documented1 out of 59 items with examples
  • Size
  • Source code size: 2.84 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 22.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 53s Average build duration of successful builds.
  • all releases: 53s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Urhengulas/gramps-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Urhengulas

gramps-xml

Rust library to work with Gramps XML files.

Implemented according to GRAMPS XML format 1.7.2 (See Document Type definition).

Learnings about translating dtd file to Rust types

  • CDATA is String
  • (0|1) is bool
  • T? is zero or one T, T* is zero or more Ts, T+ is 1 or more Ts and T is exactly one T
  • ELEMENT
    <!ELEMENT header (created, researcher?, mediapath*)>
    
    That is struct Header with fields created: Created, researcher: Option<Researcher> and mediapath: Option<Vec<MediaPath>>.
  • ATTLIST
    <!ELEMENT created EMPTY>
    <!ATTLIST created
            date     CDATA #REQUIRED
            version  CDATA #IMPLIED
    >
    
    That is struct Created with fields date: String and version: Option<String>. Both have to be serde renamed to start with @.
  • (daterange|datespan|dateval|datestr)? This could be any of those types or none. This should be represented as an enum but it is currently unclear how to.