* Encode all of a block's fields as XML and attach them to the given tree of * XML elements. * * @param block A block with fields to be encoded. * @param element The XML element to which the field DOM should be attached.
(block: Block, element: Element)
| 166 | * @param element The XML element to which the field DOM should be attached. |
| 167 | */ |
| 168 | function allFieldsToDom(block: Block, element: Element) { |
| 169 | for (const field of block.getFields()) { |
| 170 | const fieldDom = fieldToDom(field); |
| 171 | if (fieldDom) { |
| 172 | element.appendChild(fieldDom); |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Encode a block subtree as XML. |
no test coverage detected