build_data_module
Build a single S1000D data module or publication module from a structured draft, number it from allocation rules, and verify XML against XSD, BREX, and references with automatic fixes.
Instructions
Build ONE S1000D data module (descript / proced / process / fault) or publication module (pm) from a structured draft and number it from the allocation rules. You give titles, paragraphs, steps, tables, figures and references as a tree; the server writes the XML (you never write XML, DMCs, ICNs or the BREX reference). The XML is verified (XSD, BREX along the brexDmRef chain, references; applicability too when a product is given); fixes the server is certain about (confidence "exact") are applied automatically and verified again, up to maxFixRounds times. Returns xml, fileName, dmCode (pmCode for a pm), verification, appliedFixes[] (what was changed automatically), fixes[] (what remains: candidates to choose from), the updated ledger and the next ICN number. Writes into the CSDB only when write is true. A malformed draft comes back as error.code "input-error" with the path of the problem.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | Yes | The data module as a tree. kind decides which node kinds are accepted. | |
| write | No | Write the result into the CSDB (the first folder of csdbDirs / S1000D_CSDB_DIR). Default false: the XML is only returned. Nothing is written when the XML is not valid against the XSD unless allowInvalid is true. | |
| product | No | The product to evaluate applicability for. attributes: ACT productAttribute id → value; conditions: CCT cond id → value. Omit to skip the applicability check. | |
| csdbDirs | No | CSDB folders (in addition to S1000D_CSDB_DIR) used to resolve references, find BREX and number new objects. The FIRST folder is also where write: true writes. | |
| maxFixes | No | Cap on the remaining fixes listed in the response (default 50). | |
| overwrite | No | With write: true, replace a file of the same name. Default false: an existing file is left alone and reported as write-conflict. | |
| allocation | Yes | Numbering rules and the ledger. Pass the ledger of the previous response back so that the same sourceId keeps the same DMC and the same asset keeps the same ICN. | |
| issuePolicy | No | When the CSDB already has the same data module and the draft gives no issueInfo: raise issueNumber (default), raise inWork, or keep the issue. | increment-issue |
| allowInvalid | No | With write: true, write even when verification.schema.state is "invalid". Default false. | |
| assetFormats | No | File format of each figure original, by assetId (or ICN): { extension: "PNG", notation: "png", publicId? }. Default: taken from the original file name for known formats (png, jpg, gif, svg, cgm, pdf). | |
| maxFixRounds | No | How many times to apply the fixes the server is certain about (confidence "exact") and verify again (default 3). 0 turns automatic fixing off. |