diff options
| author | Felix Hanley <felix@userspace.com.au> | 2018-11-20 05:44:30 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2018-11-20 05:44:30 +0000 |
| commit | 12f344f96a8225c93873aafa0f110babae267a0a (patch) | |
| tree | ac03e950244ea48d6e8f26b72f8d11ed94cded5b /node.go | |
| parent | 505c75b306322a22aef900aac636100eab556be9 (diff) | |
| download | query-12f344f96a8225c93873aafa0f110babae267a0a.tar.gz query-12f344f96a8225c93873aafa0f110babae267a0a.tar.bz2 | |
Use Node interface for JSON
Diffstat (limited to 'node.go')
| -rw-r--r-- | node.go | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -15,9 +15,19 @@ const ( DoctypeNode = NodeType(html.DoctypeNode) AttributeNode = 100 AnyNode = 101 - // Add json node types ) +var NodeNames = map[NodeType]string{ + ErrorNode: "ErrorNode", + DocumentNode: "DocumentNode", + ElementNode: "ElementNode", + TextNode: "TextNode", + CommentNode: "CommentNode", + DoctypeNode: "DoctypeNode", + AttributeNode: "AttributeNode", + AnyNode: "AnyNode", +} + type Node interface { Parent() Node FirstChild() Node @@ -26,6 +36,8 @@ type Node interface { NextSibling() Node Type() NodeType Data() string + InnerText() string + DataType() string Attr() []Attribute } |
