Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
218 lines (194 loc) · 6.11 KB

File metadata and controls

executable file
·
218 lines (194 loc) · 6.11 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#!/usr/bin/env luajit
local xmlua = require("xmlua")
local listener = {}
function listener:start_document()
print("Start document")
end
function listener:print_element_content(content, indent)
if content.type == "PCDATA" then
print(indent .. "type: " .. content.type)
print(indent .. "occur: " .. content.occur)
elseif content.type == "ELEMENT" then
print(indent .. "type: " .. content.type)
print(indent .. "occur: " .. content.occur)
print(indent .. "prefix: " .. (content.prefix or ""))
print(indent .. "name: " .. content.name)
else
print(indent .. "type: " .. content.type)
print(indent .. "occur: " .. content.occur)
for i, child in pairs(content.children) do
print(indent .. "child[" .. i .. "]:")
self:print_element_content(child, indent .. " ")
end
end
end
function listener:element_declaration(name, element_type, content)
print("Element name: " .. name)
print("Element type: " .. element_type)
if element_type == "EMPTY" then
return
end
print("Content:")
self:print_element_content(content, " ")
end
function listener:attribute_declaration(name,
attribute_name,
attribute_type,
default_value_type,
default_value,
enumerated_values)
print("Element name: " .. name)
print("Attribute name: " .. attribute_name)
print("Attribute type: " .. attribute_type)
if default_value then
print("Default value type: " .. default_value_type)
print("Default value: " .. default_value)
end
for _, v in pairs(enumerated_values) do
print("Enumrated value: " .. v)
end
end
function listener:notation_declaration(name, public_id, system_id)
print("Notation name: " .. name)
if public_id ~= nil then
print("Notation public id: " .. public_id)
end
if system_id ~= nil then
print("Notation system id: " .. system_id)
end
end
function listener:unparsed_entity_declaration(name,
public_id,
system_id,
notation_name)
print("Unparserd entity name: " .. name)
if public_id ~= nil then
print("Unparserd entity public id: " .. public_id)
end
if system_id ~= nil then
print("Unparserd entity system id: " .. system_id)
end
print("Unparserd entity notation_name: " .. notation_name)
end
function listener:entity_declaration(name,
entity_type,
public_id,
system_id,
content)
print("Entity name: " .. name)
print("Entity type: " .. entity_type)
if public_id ~= nil then
print("Entity public id: " .. public_id)
end
if system_id ~= nil then
print("Entity system id: " .. system_id)
end
print("Entity content: " .. content)
end
function listener:internal_subset(name, external_id, system_id)
print("Internal subset name: " .. name)
if external_id ~= nil then
print("Internal subset external id: " .. external_id)
end
if system_id ~= nil then
print("Internal subset system id: " .. system_id)
end
end
function listener:external_subset(name, external_id, system_id)
print("External subset name: " .. name)
if external_id ~= nil then
print("External subset external id: " .. external_id)
end
if system_id ~= nil then
print("External subset system id: " .. system_id)
end
end
function listener:cdata_block(cdata_block)
print("CDATA block: " .. cdata_block)
end
function listener:comment(comment)
print("Comment: " .. comment)
end
function listener:processing_instruction(target, data)
print("Processing instruction target: " .. target)
print("Processing instruction data: " .. data)
end
function listener:ignorable_whitespace(ignorable_whitespaces)
print("Ignorable whitespaces: " .. "\"" .. ignorable_whitespaces .. "\"")
print("Ignorable whitespaces length: " .. #ignorable_whitespaces)
end
function listener:text(text)
print("Text: <" .. text .. ">")
end
function listener:reference(entity_name)
print("Reference entity name: " .. entity_name)
end
function listener:start_element(local_name,
prefix,
uri,
namespaces,
attributes)
print("Start element: " .. local_name)
if prefix then
print(" prefix: " .. prefix)
end
if uri then
print(" URI: " .. uri)
end
for namespace_prefix, namespace_uri in pairs(namespaces) do
if namespace_prefix == "" then
print(" Default namespace: " .. namespace_uri)
else
print(" Namespace: " .. namespace_prefix .. ": " .. namespace_uri)
end
end
if attributes then
if #attributes > 0 then
print(" Attributes:")
for i, attribute in pairs(attributes) do
local name
if attribute.prefix then
name = attribute.prefix .. ":" .. attribute.local_name
else
name = attribute.local_name
end
if attribute.uri then
name = name .. "{" .. attribute.uri .. "}"
end
print(" " .. name .. ": " .. attribute.value)
end
end
end
end
function listener:end_element(local_name, prefix, uri)
print("End element: " .. local_name)
if prefix then
print(" prefix: " .. prefix)
end
if uri then
print(" URI: " .. uri)
end
end
function listener:warning(message)
print("Warning message:", message)
print("Pedantic:", parser.is_pedantic)
end
function listener:error(xml_error)
print("Error domain:", xml_error["domain"])
print("Error code:", xml_error["code"])
print("Error message:", xml_error["message"])
print("Error level:", xml_error["level"])
print("Error line:", xml_error["line"])
end
function listener:end_document()
print("End document")
end
local parser = xmlua.XMLStreamSAXParser.new(listener)
while true do
local line = io.stdin:read()
if not line then
parser:finish()
break
end
parser:parse(line)
end
Morty Proxy This is a proxified and sanitized view of the page, visit original site.