Skip to content

Readme on copying a Node is out of date #44

Closed
@TimG1964

Description

@TimG1964

The text on the Readme page currently says:


- Node is an immutable type. However, you can easily create a copy with one or more field values changed by using the Node(::Node; kw...) constructor where kw are the fields you want to change. For example:

node = XML.Element("tag", XML.Text("child"))

simple_value(node)
# "child"

node2 = Node(node, children=XML.Text("changed"))

simple_value(node2)
# "changed"

This seems to be a bit out of date. The Node() function seems to treat arguments as new children and keywords as new/changed attributes. The example presented now seems to create an attribute called "children" rather than changing the child node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions