on 4fdc19d help sign in
332 lines 3.7 kB history raw
1+++
2title = "5e: Molds and mold builders"
3weight = 47
4template = "doc.html"
5+++
7## `+$mane`
9XML name+space
11XML tag name and optional namespace.
13#### Source
15```hoon
16+$ mane $@(@tas [@tas @tas])
17```
19#### Examples
21```
22> (en-xml:html ;foo;)
23"<foo></foo>"
25> (en-xml:html ;foo_bar;)
26"<foo:bar></foo:bar>"
28> `manx`;foo_bar;
29[g=[n=[%foo %bar] a=~] c=~]
31> `mane`n.g:`manx`;foo_bar;
32[%foo %bar]
34> `mane`n.g:`manx`;foo;
35%foo
36```
38---
40## `+$manx`
42Dynamic XML node
44An XML element which may contain text, attributes, and other elements.
46`g` is a [`$marx`](#marx) (a tag) and `c` is a
47[`$marl`](#marl) (its contents).
49#### Source
51```hoon
52+$ manx $~([[%$ ~] ~] [g=marx c=marl])
53```
55#### Examples
57```
58> *manx
59[g=[n=%$ a=~] c=~
61> `manx`;foo;
62[g=[n=%foo a=~] c=~]
64> (en-xml:html `manx`;foo;)
65"<foo></foo>"
67> =a ^- manx
68 ;foo
69 ;bar: abc
70 ;baz
71 ;xxx: hello
72 ==
73 ==
75> a
76[ g=[n=%foo a=~]
77 c
78 ~[
79 [ g=[n=%bar a=~]
80 c=~[[g=[n=%$ a=~[[n=%$ v="abc"]]] c=~]]
81 ]
82 [ g=[n=%baz a=~]
83 c
84 ~[
85 [ g=[n=%xxx a=~]
86 c=~[[g=[n=%$ a=~[[n=%$ v="hello"]]] c=~]]
87 ]
88 ]
89 ]
90 ]
93> (en-xml:html a)
94"<foo><bar>abc</bar><baz><xxx>hello</xxx></baz></foo>"
95```
97---
99## `+$marl`
101XML node list
103A list of XML nodes ([`$marx`](#marx)).
105#### Source
107```hoon
108+$ marl (list manx)
109```
111#### Examples
113```
114> *marl
117> ^- marl
118 ;=
119 ;foo: abc
120 ;bar: def
121 ==
122~[
123 [g=[n=%foo a=~] c=~[[g=[n=%$ a=~[[n=%$ v=~['a' 'b' 'c']]]] c=~]]]
124 [g=[n=%bar a=~] c=~[[g=[n=%$ a=~[[n=%$ v=~['d' 'e' 'f']]]] c=~]]]
127> %- en-xml:html
128 ;baz
129 ;=
130 ;foo: abc
131 ;bar: def
132 ==
133 ==
134"<baz><foo>abc</foo><bar>def</bar></baz>"
135```
137---
139## `+$mars`
141XML cdata
143#### Source
145```hoon
146+$ mars [t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~]
147```
149---
151## `+$mart`
153XML attributes
155A list of atributes for an XML tag. For each list item, `n` is a
156[`$mane`](#mane) (an attribute name with optional namespace) and `v` is
157a `tape` (the attribute itself).
159#### Source
161```hoon
162+$ mart (list [n=mane v=tape])
163```
165#### Examples
167```
168> *mart
171> `manx`;foo.bar;
172[g=[n=%foo a=~[[n=%class v="bar"]]] c=~]
174> `mart`a.g:`manx`;foo.bar;
175~[[n=%class v="bar"]]
177> (en-xml:html ;foo.bar;)
178"<foo class=\"bar\"></foo>"
179```
181---
183## `+$marx`
185Dynamic XML tag
187An XML tag with optional attributes. `n` is a [`$mane`](#mane) (the tag
188name with optional namespace) and `a` is a [`$mart`](marthoot) (any XML
189attributes).
191#### Source
193```hoon
194+$ marx $~([%$ ~] [n=mane a=mart])
195```
197#### Examples
199```
200> `manx`;foo.bar;
201[g=[n=%foo a=~[[n=%class v="bar"]]] c=~]
203> `marx`g:`manx`;foo.bar;
204[n=%foo a=~[[n=%class v="bar"]]]
206> (en-xml:html ;foo.bar;)
207"<foo class=\"bar\"></foo>"
208```
210---
212## `+$mite`
214MIME type
216This type represents a MIME type like `text/plain` as a `path`.
218#### Source
220```hoon
221+$ mite (list @ta)
222```
224#### Examples
226```
227> `mite`/text/plain
228/text/plain
229```
231---
233## `+$pass`
235Public key
237This type is used for a ship's public key, as an atom.
239#### Source
241```hoon
242+$ pass @
243```
245---
247## `+$ring`
249Private key
251This type is used for a ship's private key, as an atom.
253#### Source
255```hoon
256+$ ring @
257```
259---
261## `+$ship`
263Network identity
265Just an `@p`
267#### Source
269```hoon
270+$ ship @p
271```
273#### Examples
275```
276> *ship
277~zod
279> `ship`~sampel-palnet
280~sampel-palnet
281```
283---
285## `+$shop`
287Urbit/DNS identity
289Either a [`$ship`](#ship) or a domain name as a `path`.
291#### Source
293```hoon
294+$ shop (each ship (list @ta))
295```
297---
299## `+$spur`
301ship desk case spur
303The part of a Clay `path` after the `%`.
305#### Source
307```hoon
308+$ spur path
309```
311---
313## `+$time`
315Galactic time
317Just a `@da`
319#### Source
321```hoon
322+$ time @da
323```
325#### Examples
327```
328> *time
329~2000.1.1
330```
332---