@ooxml-tools/xml 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ const outXml = compact(`
|
|
|
61
61
|
assert.equal(outXml, "<test>something</test>");
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
### `
|
|
64
|
+
### `collapseFragments`
|
|
65
65
|
For XML to be valid, there must be a single root node. When composing apps it's handy for that not to be true.
|
|
66
66
|
|
|
67
67
|
For example the following would error
|
|
@@ -84,7 +84,7 @@ const xml = safeXml`
|
|
|
84
84
|
`
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
So we did just that, `
|
|
87
|
+
So we did just that, `collapseFragments` walks over a tree removing `<XML_FRAGMENT>...</XML_FRAGMENT>` nodes.
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
const innerBit = safeXml`
|
|
@@ -93,7 +93,7 @@ const innerBit = safeXml`
|
|
|
93
93
|
<name>bar</name>
|
|
94
94
|
</XML_FRAGMENT>
|
|
95
95
|
`
|
|
96
|
-
const newXml =
|
|
96
|
+
const newXml = collapseFragments(
|
|
97
97
|
safeXml`
|
|
98
98
|
<doc>
|
|
99
99
|
${innerBit}
|