1 | JSON data structure spec
|
2 | ========================
|
3 |
|
4 | ## example
|
5 |
|
6 | * [bookstore.json](../spec/fixtures/bookstore.json)
|
7 | * [cd-catalog.json](../spec/fixtures/cd-catalog.json)
|
8 | * [large.json](../spec/fixtures/large.json)
|
9 | * [menu.json](../spec/fixtures/menu.json)
|
10 | * [mmap-content.json](../spec/fixtures/mmap-content.json)
|
11 | * [note.json](../spec/fixtures/note.json)
|
12 | * [svg.json](../spec/fixtures/svg.json)
|
13 |
|
14 | ## nodes
|
15 |
|
16 | ### Document
|
17 |
|
18 | Root node of the whole document.
|
19 |
|
20 | structure:
|
21 |
|
22 | ```javascript
|
23 | {
|
24 | type: 'Document',
|
25 | children: [/* */],
|
26 | }
|
27 | ```
|
28 |
|
29 | ### ProcessingInstruction
|
30 |
|
31 | ProcessingInstruction node (like `<?xml-stylesheet type="text/css" href="./bootstore.css"?>`).
|
32 |
|
33 | structure:
|
34 |
|
35 | ```javascript
|
36 | {
|
37 | "type": "ProcessingInstruction",
|
38 | "tag": "xml-stylesheet",
|
39 | "data": "type=\"text/css\" href=\"./bootstore.css\""
|
40 | }
|
41 | ```
|
42 |
|
43 | ### Comment
|
44 |
|
45 | Comment node (like `<!-- some comments -->`).
|
46 |
|
47 | structure:
|
48 |
|
49 | ```javascript
|
50 | {
|
51 | "type": "Comment",
|
52 | "data": " some comments "
|
53 | }
|
54 | ```
|
55 |
|
56 | ### Element
|
57 |
|
58 | Normal Element node (like `<book category="COOKING"></book>`).
|
59 |
|
60 | structure:
|
61 |
|
62 | ```javascript
|
63 | {
|
64 | "type": "Element",
|
65 | "tag": "bookstore",
|
66 | "children": [/* */]
|
67 | }
|
68 | ```
|
69 |
|
70 | ### TextNode
|
71 |
|
72 | TextNode (like `Everyday Italian`).
|
73 |
|
74 | structure:
|
75 |
|
76 | ```javascript
|
77 | {
|
78 | "type": "TextNode",
|
79 | "text": "Everyday Italian"
|
80 | }
|
81 | ```
|
82 |
|
83 | ### DocumentType
|
84 |
|
85 | ### DocumentFragment
|
86 |
|
87 | ### CDATASection
|
88 |
|