Rust crate containing structs and validators to create Crossref conform XML output – with confidence.
Find a file
2025-12-24 16:17:00 +01:00
schemas automatically patch schemas for validation 2025-12-23 23:20:50 +01:00
src add xml output from tests, validate with xmllint 2025-12-24 16:17:00 +01:00
tests/xml_output add xml output from tests, validate with xmllint 2025-12-24 16:17:00 +01:00
.gitignore feat: add DoiBatch 2025-12-21 17:16:24 +01:00
Cargo.toml init unit tests 2025-12-22 16:01:08 +01:00
collect-schemas.sh automatically patch schemas for validation 2025-12-23 23:20:50 +01:00
LICENSE Initial commit 2025-12-21 15:40:13 +00:00
README.md add xml output from tests, validate with xmllint 2025-12-24 16:17:00 +01:00
schema.patch automatically patch schemas for validation 2025-12-23 23:20:50 +01:00

crossref-xml

Rust crate containing structs and validators to create Crossref conform XML output with confidence. Based on the 5.4.0 Crossref schema (documentation).

This is a hand-curated set of structs, as generating it from the XSD schema directly is a great idea, but has failed us in quirky ways. This crate is made to ensure when XML is generated, it is valid. It is not supposed to be feature complete from the get-go, but to provide a stable development base to keep evolving schema support.

Philosophy

Crossref has a complex schema with many requirements. The philosophy of this crate is for you to focus on your content and not be exposed to more complexities than that.

Concretely this means:

  • One submission per publication
  • Logical defaults for our use case (may not be logical for yours)
    • Digital first
    • Registrant and depositor are the same
    • English language default
    • Archived in the Internet Archive

First pass

flowchart LR
    A[✅✅doi_batch] --> B[✅✅body]
    A --> C[✅✅head]
    B --> D[✅✅journal]
    B --> E[book]
    B --> F[conference]
    B --> G[sa_component]
    B --> H[dissertation]
    B --> I[report-paper]
    B --> J[standard]
    B --> K[database]
    B --> L[peer_review]
    B --> M[pending_publication]
    B --> N[posted_content]
    D --> O[✅✅journal_metadata]
    D --> P[✅✅journal_issue]
    D --> Q[✅✅journal_article]

Dependencies

xmllint --schema schemas/crossref5.4.0.xsd ~/Downloads/test.xml