Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 1.29 KB

json-spec.md

File metadata and controls

88 lines (61 loc) · 1.29 KB

JSON data structure spec

example

nodes

Document

Root node of the whole document.

structure:

{
  type: 'Document',
  children: [/* */],
}

ProcessingInstruction

ProcessingInstruction node (like <?xml-stylesheet type="text/css" href="./bootstore.css"?>).

structure:

{
  "type": "ProcessingInstruction",
  "tag": "xml-stylesheet",
  "data": "type=\"text/css\" href=\"./bootstore.css\""
}

Comment

Comment node (like <!-- some comments -->).

structure:

{
  "type": "Comment",
  "data": " some comments "
}

Element

Normal Element node (like <book category="COOKING"></book>).

structure:

{
   "type": "Element",
   "tag": "bookstore",
   "children": [/* */]
}

TextNode

TextNode (like Everyday Italian).

structure:

{
  "type": "TextNode",
  "text": "Everyday Italian"
}

DocumentType

DocumentFragment

CDATASection