XML/DOM serialization: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,828: Line 1,828:
=={{header|Wren}}==
=={{header|Wren}}==
Wren has no built-in or (AFAIK) third party support for XML so we code a minimal DOM sufficient for completing this task.
Wren has no built-in or (AFAIK) third party support for XML so we code a minimal DOM sufficient for completing this task.
<syntaxhighlight lang="ecmascript">class XmlDocument {
<syntaxhighlight lang="wren">class XmlDocument {
construct new(root) {
construct new(root) {
_root = root
_root = root
Line 1,878: Line 1,878:
{{libheader|Wren-xsequence}}
{{libheader|Wren-xsequence}}
Since the first version was written, the above XML parser has appeared and, consequently, the solution can now be rewritten as follows.
Since the first version was written, the above XML parser has appeared and, consequently, the solution can now be rewritten as follows.
<syntaxhighlight lang="ecmascript">import "./xsequence" for XDocument, XElement
<syntaxhighlight lang="wren">import "./xsequence" for XDocument, XElement


var doc = XDocument.new(
var doc = XDocument.new(