xdoc-rs 0.1.1

Declarative XML engine for Rust
Documentation
# Testing Fixtures

## XML fixtures

Reusable XML fixtures live in `tests/fixtures/xml`.

- Valid fixtures should parse with `xdoc::parser::parse_str`.
- Invalid fixtures should fail with a structured `XmlError`.
- Fixtures must stay generic; do not add domain-specific payloads here.

## Contract fixtures

Reusable schema contract fixtures live in `tests/fixtures/contracts`. The CLI
uses these files to exercise `xdoc validate <input.xml> <contract.toml>` against
the engine-native `schema` module.

## Golden files

Golden files live in `tests/golden`. Tests should compare generated XML with
`xdoc::testing::assert_matches_golden` or `xdoc::testing::assert_xml_eq` so
failures include the first differing line and column.

To update a golden file intentionally:

1. Reproduce the output locally with the focused test or example.
2. Inspect the semantic change in the generated XML.
3. Replace only the affected golden file.
4. Run `cargo test golden` and the broader task verification.

Do not update golden files to hide nondeterminism. If output changes between
runs, fix the serializer, canonicalizer, or test setup first.

## Roundtrip tests

Use `xdoc::testing::assert_compact_roundtrip` for parser/writer roundtrips. The
helper parses XML, serializes compactly, reparses, and checks that compact output
is stable.

## Fuzzing

The initial parser fuzz harness is in `fuzz/fuzz_targets/parser.rs`. It is kept
outside the Cargo workspace so the engine remains a single runtime crate plus
the explicitly allowed macro and CLI crates.