XMLSerializer
The XMLSerializer interface provides the serializeToString() method to construct an XML string representing a DOM tree.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | 3 | 18 | 1 | |
| The XMLSerializer method serializeToString() constructs a string representing the specified DOM tree in XML form. | 1 | 12 | 1 | 3 | 18 | 1 |
| The XMLSerializer() constructor creates a new XMLSerializer. | 1 | 12 | 1 | 3 | 18 | 1 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Use cases
-
Using XMLSerializer
The XMLSerializer interface provides the serializeToString() method to construct an XML string representing a DOM tree.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.