The XMLSerializer()
constructor creates a new XMLSerializer
.
The XMLSerializer()
constructor creates a new XMLSerializer
.
new XMLSerializer()
None.
A new XMLSerializer
object.
This example serializes an entire document into a string containing XML.
const s = new XMLSerializer(); const d = document; const str = s.serializeToString(d); saveXML(str);
This involves creating a new XMLSerializer
object, then passing the Document
to be serialized into serializeToString()
, which returns the XML equivalent of the document. saveXML()
represents a function that would then save the serialized string.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
XMLSerializer |
1 | 12 | 1 | 9 | ≤12.1 | 3 | 4.4 | 18 | 4 | ≤12.1 | 1 | 1.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer/XMLSerializer