Expand description
Location tracking for XSD parsing
This module provides accurate source location tracking using byte offsets from quick-xml. It supports three retention modes to balance memory usage vs. error reporting fidelity:
Retain: Keep full source text (default, ~200KB per 200KB schema)DropText: Keep only line starts (~10KB per 200KB schema)DropAll: No location info (minimal memory)
Per XSD_PARSER_DESIGN.md:
- Use quick-xml’s
buffer_position()for byte offsets - Build line_starts table once per document
- Handle CR, LF, and CRLF line endings correctly
- Column calculation counts UTF-8 characters, not bytes
Structs§
- Compact
Source Map - Compact source map when text is dropped (DropText mode)
- Source
Location - Line/column location for error reporting (1-based)
- Source
Map - Per-document source mapping for line/column resolution
- Source
Ref - Reference to a location within a schema document
- Source
Span - Byte range within a document
Enums§
- Source
MapStorage - Centralized source map storage with configurable retention
- Source
Retention - Source buffer retention policy
Functions§
- build_
line_ starts - Build line start index from source bytes