You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-17Lines changed: 36 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,6 @@ doc[end][2] # Second child of root
83
83
## `Node`: Probably What You're Looking For
84
84
85
85
-`read`-ing a `Node` loads the entire XML DOM in memory.
86
-
-**This is what you would use to build an XML document programmatically.**
87
86
- See the table above for convenience constructors.
88
87
-`Node`s have some additional methods that aid in construction/mutation:
89
88
@@ -114,6 +113,24 @@ simplevalue(node2)
114
113
# "changed"
115
114
```
116
115
116
+
### Writing `Element``Node`s with `XML.h`
117
+
118
+
Similar to [Cobweb.jl](https://github.com/JuliaComputing/Cobweb.jl#-creating-nodes-with-cobwebh), `XML.h` enables you to write elements with a simpler syntax:
119
+
120
+
```julia
121
+
using XML: h
122
+
123
+
julia> node = h.parent(
124
+
h.child("content", id="my id")
125
+
)
126
+
# Node Element <parent> (1 child)
127
+
128
+
julia> XML.write(node)
129
+
# <parent>
130
+
# <child id=\"my id\">content</child>
131
+
# </parent>
132
+
```
133
+
117
134
<br>
118
135
119
136
## `XML.LazyNode`: For Fast Iteration through an XML File
0 commit comments