(root)
| 3802 | } |
| 3803 | |
| 3804 | function writeDocument(root) { |
| 3805 | var builder = xmlbuilder |
| 3806 | .create(mapElementName(root.name), { |
| 3807 | version: '1.0', |
| 3808 | encoding: 'UTF-8', |
| 3809 | standalone: true |
| 3810 | }); |
| 3811 | |
| 3812 | _.forEach(namespaces, function(uri, prefix) { |
| 3813 | var key = "xmlns" + (prefix === "" ? "" : ":" + prefix); |
| 3814 | builder.attribute(key, uri); |
| 3815 | }); |
| 3816 | |
| 3817 | root.children.forEach(function(child) { |
| 3818 | writeNode(builder, child); |
| 3819 | }); |
| 3820 | return builder.end(); |
| 3821 | } |
| 3822 | |
| 3823 | return writeDocument(root); |
| 3824 | } |
no test coverage detected