Namespace DocWright.Dom.ContentControls
Classes
- ContentControl
A typed view over a structured document tag — the API side of the content controls the DOM has preserved since Phase 1.
How this relates to RawXml. The raw
w:sdtPrstays the source of truth and is still exactly what the DOCX writer emits. Reading a typed property parses it; setting one splices the corresponding element or attribute back into it. Two things follow, and both are the point of the design: a control nobody touched round-trips byte for byte because the writer never stopped emitting the original bytes, and aw:sdtPrchild DocWright does not model survives because it was never removed from the string in the first place.A refused edit changes nothing. Where the preserved markup cannot be understood with certainty — an undeclared prefix, a construct the fragment scanner does not accept — a setter throws ContentControlEditException and leaves both the island and this view untouched. Phase 15 established that rule for text boxes: a half-applied rewrite leaves two representations disagreeing, and unlike a refusal, that is invisible.
- ContentControlBindingException
Thrown when a content control's data binding uses an XPath construct outside the supported subset, or names a custom XML part or node that cannot be resolved.
The exception names the construct. A binding engine that guessed at an expression it did not understand would read or overwrite the wrong node, and the document would still look correct — which is why this is loud rather than silent.
- ContentControlDataBinding
A content control's binding to a node in a custom XML part (ECMA-376 Part 1 §17.5.2.6 w:dataBinding).
The binding is a description, not a live connection. Reading and writing through it is done by the custom-XML binding API, which needs access to the package parts the DOM deliberately keeps opaque.
- ContentControlDiscovery
Finds content controls and gives typed access to the ones already in the model.
- ContentControlEditException
Thrown when a content control edit was refused because it could not be applied with certainty, or because the property does not apply to the control's kind.
The refusal is the feature. A content control's typed properties are a view over the preserved
w:sdtPr, and that island is what the writer emits; an edit the rewriter cannot place exactly would leave the typed view and the emitted document disagreeing. Phase 15 met the same choice with text boxes and refused both edits together rather than applying one, on the grounds that a refusal is visible and a silent disagreement is not. When this is thrown, neither the island nor the model has changed.
- ContentControlListItem
One entry of a drop-down list or combo box (ECMA-376 Part 1 §17.5.2.19 w:listItem).
- CustomXmlDataStore
Reads and writes the custom XML parts a content control can be bound to (ECMA-376 Part 1 §17.5.2.6
w:dataBinding).
Enums
- ContentControlKind
The kind of a structured document tag, determined by the type-specific child of
w:sdtPr(ECMA-376 Part 1 §17.5.2, plus thew14andw15extensions Word uses for check boxes and repeating sections).