10. ADAT XML compatibility
This appendix records the compatibility target explicitly. “Compatible” means the same useful XML shapes and query behavior, not source compatibility with ADAT classes or preservation of every historical mutation and failure mode.
10.1. Implemented in the core package
Legacy capability |
|
Status |
|---|---|---|
File and stream readers |
|
Complete |
Reader rooted at an XPath subtree |
|
Complete |
Full XPath expressions |
libxml2-backed reader queries |
Complete |
Registered XPath namespaces |
|
Complete |
Primitive reads and writes |
|
Complete |
Attribute reads and writes |
XPath |
Complete |
Query count and existence |
|
Complete |
Query result and subtree printing |
|
Complete |
Destructive scalar replacement |
|
Complete |
Tag stack and empty tags |
|
Complete |
In-memory and buffered file writers |
|
Complete |
Incremental file or stream writer |
|
Complete modernization |
Raw XML composition |
|
Complete |
Complex values |
|
Complete |
Primitive arrays |
compact whitespace |
Complete |
Structured arrays |
|
Complete |
Maps and pairs |
|
Complete representation |
Merge several map documents |
|
Complete extension |
Optional values |
|
Complete extension |
Repeated sibling values |
|
Complete extension |
Factory XML groups |
|
Complete |
10.2. Deliberate modernization
Legacy behavior |
Modern behavior |
|---|---|
Exceptions thrown as |
Typed |
|
|
One-based |
Zero-based standard containers |
7/15 digit floating output |
|
Ambiguous source handling only through constructors |
Explicit |
Map reads insert silently into existing contents |
|
One file-writer name covered two storage models |
|
Buffer-writer |
|
10.3. Important behavioral differences
ADAT’s std::map reader inserted entries without clearing the destination and
silently retained an existing value when keys collided. Some catalog-loading
code used that behavior to combine several files. In xmlio, ordinary read
has conventional replacement semantics and rejects duplicate keys within one
document. Use read_map_into with DuplicateKeyPolicy::error,
keep_existing, or overwrite when combining catalogs.
ADAT’s file writer emitted XML incrementally. In xmlio, the storage choice is
part of the type: XMLFileWriter retains a DOM for normal configuration and
result files, while XMLStreamWriter writes large graph and event documents
with memory proportional to nesting depth. Both accept the same tag operations
and typed write overloads.
ADAT’s XMLBufferWriter::str() returned a root fragment without an XML
declaration. The established xmlio::str() default still returns a standalone
document for compatibility with existing xmlio clients. New code should use
document_str() or fragment_str() whenever that distinction matters.
10.4. Compatibility adapters not in the core
The following APIs are not used by scattering_devel and are intentionally not
part of the core package:
XMLArrayWriter, the stateful fixed-size streaming array writer.XMLStructWriterBaseand its pointer-owned child-writer API.XMLSimpleSchemaWriterandXMLSchemaWriter, which emit XSD alongside XML.Source-level aliases in the old
ADATXML,XMLWriterAPI, andXMLArraynamespaces.
If legacy applications need source-level migration, these belong in a separate
xmlio_adat_compat adapter. Keeping them out of the core prevents obsolete
ownership and one-based-container conventions from becoming dependencies of
the new analysis suite.