Skip to content

Commit

Permalink
Fix docs for unpairdTags example in XMLBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
amitguptagwl committed Jan 22, 2023
1 parent 007d638 commit 25f5e8a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions docs/v4/3.XMLBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const xmlData = `
</rootNode>`;

const options = {
// suppressEmptyNode: true,
// suppressUnpairedNode: true,
unpairedTags: ["unpaired"]
};
const parser = new XMLParser(options);
Expand All @@ -277,21 +277,20 @@ Output
<rootNode>
<tag>value</tag>
<empty></empty>
<unpaired/>
<unpaired/>
<unpaired/>
<unpaired>
<unpaired>
<unpaired>
</rootNode>
```

when you sets `suppressUnpairedNode: true`;
Now if you set `suppressUnpairedNode: false`. You'll get following output

```xml
<rootNode>
<tag>value</tag>
<empty></empty>
<unpaired>
<unpaired>
<unpaired>
<tag>value</tag>
<empty></empty>
<unpaired/>
<unpaired/>
<unpaired/>
</rootNode>
```

Expand Down

0 comments on commit 25f5e8a

Please sign in to comment.