ReferenceAnchored Metadata
Anchored Metadata operations
Attach a JSON payload to a span of text and read it back across DOCX round-trips. Backed by hidden inline content controls and namespaced Custom XML Data Storage Parts; consumers see one operation set.
6 operations. Names, descriptions, and behavior flags come from the canonical contract.
Operations
metadata.attachAnchor a JSON metadata payload to a span of text. Wraps the target range in a hidden inline content control whose w:tag carries a stable id, and stores the payload in a namespaced Custom XML Data Storage Part. v1 supports text-range anchors only.mutatesmetadata.getGet a single anchored-metadata entry by id, including its JSON payload.readmetadata.listList anchored-metadata entries in the document, optionally filtered by consumer namespace and/or a `within` selection (returns only entries whose anchor overlaps `within`).readmetadata.removeRemove an anchored-metadata entry. Strips the anchor content-control wrapper (its content stays in the document) and deletes the payload entry from the Storage Part. In v1 these writes are sequenced, not transactional: the adapter resolves the target up-front so missing-target failures land before any state change, but a crash strictly between the two writes can leave a dangling payload. When the backing part has no remaining entries, the part itself is removed.mutatesmetadata.resolveFind where an anchored-metadata entry is anchored in the document. Returns the SelectionTarget covering the anchor content.readmetadata.updateReplace the JSON payload of an existing anchored-metadata entry. Replace semantics; no merge. The anchor is left untouched.mutates