Module: LibXML::XML::SaxParser::VerboseCallbacks

Defined in:
lib/libxml/sax_callbacks.rb

Instance Method Summary collapse

Instance Method Details

#on_cdata_block(cdata) ⇒ Object

Called for a CDATA block event.



70
71
72
73
74
# File 'lib/libxml/sax_callbacks.rb', line 70

def on_cdata_block(cdata)
  STDOUT << "on_cdata_block" << "\n" <<
            "  cdata " << cdata << "\n"
  STDOUT.flush
end

#on_characters(chars) ⇒ Object

Called for a characters event.



77
78
79
80
81
# File 'lib/libxml/sax_callbacks.rb', line 77

def on_characters(chars)
  STDOUT << "on_characters" << "\n" <<
            "  chars " << chars << "\n" 
  STDOUT.flush
end

#on_comment(comment) ⇒ Object

Called for a comment event.



84
85
86
87
88
# File 'lib/libxml/sax_callbacks.rb', line 84

def on_comment(comment)
  STDOUT << "on_comment" << "\n" <<
            "  comment: " << comment << "\n"
  STDOUT.flush
end

#on_end_documentObject

Called for a end document event.



91
92
93
94
# File 'lib/libxml/sax_callbacks.rb', line 91

def on_end_document
  STDOUT << "on_end_document\n"
  STDOUT.flush
end

#on_end_element_ns(name, prefix, uri) ⇒ Object

Called for a end element event.



97
98
99
100
101
102
103
# File 'lib/libxml/sax_callbacks.rb', line 97

def on_end_element_ns(name, prefix, uri)
  STDOUT << "on_end_element_ns" << "\n" <<
            "  name: " << name << "\n" <<
            "  prefix: " << prefix << "\n" <<
            "  uri: " << uri << "\n"
  STDOUT.flush
end

#on_error(error) ⇒ Object

Called for parser errors.



106
107
108
109
110
# File 'lib/libxml/sax_callbacks.rb', line 106

def on_error(error)
  STDOUT << "on_error" << "\n"
            "  error " << error << "\n"
  STDOUT.flush
end

#on_external_subset(name, external_id, system_id) ⇒ Object

Called for an external subset event.



113
114
115
116
117
118
# File 'lib/libxml/sax_callbacks.rb', line 113

def on_external_subset(name, external_id, system_id)
  STDOUT << "on_external_subset" << "\n"
            "  external_id " << external_id << "\n" <<
            "  system_id   " << system_id << "\n"
  STDOUT.flush
end

#on_has_external_subsetObject

Called for an external subset notification event.



121
122
123
124
# File 'lib/libxml/sax_callbacks.rb', line 121

def on_has_external_subset
  STDOUT << "on_has_internal_subset\n"
  STDOUT.flush
end

#on_has_internal_subsetObject

Called for an internal subset notification event.



127
128
129
130
# File 'lib/libxml/sax_callbacks.rb', line 127

def on_has_internal_subset
  STDOUT << "on_has_internal_subset\n"
  STDOUT.flush
end

#on_internal_subset(name, external_id, system_id) ⇒ Object

Called for an internal subset event.



133
134
135
136
137
138
# File 'lib/libxml/sax_callbacks.rb', line 133

def on_internal_subset(name, external_id, system_id)
  STDOUT << "on_internal_subset" << "\n"
            "  external_id " << external_id << "\n" <<
            "  system_id   " << system_id << "\n"
  STDOUT.flush
end

#on_is_standaloneObject

Called for ‘is standalone’ event.



141
142
143
144
# File 'lib/libxml/sax_callbacks.rb', line 141

def on_is_standalone
  STDOUT << "on_is_standalone\n"
  STDOUT.flush
end

#on_processing_instruction(target, data) ⇒ Object

Called for an processing instruction event.



147
148
149
150
151
152
# File 'lib/libxml/sax_callbacks.rb', line 147

def on_processing_instruction(target, data)
  STDOUT << "on_characters" << "\n"
            "  target: " << target << "\n" <<
            "  data:   " << data << "\n"
  STDOUT.flush
end

#on_reference(name) ⇒ Object

Called for a reference event.



155
156
157
158
159
# File 'lib/libxml/sax_callbacks.rb', line 155

def on_reference(name)
  STDOUT << "on_reference:" << "\n" <<
            "  name:" << name << "\n"
  STDOUT.flush
end

#on_start_documentObject

Called for a start document event.



162
163
164
165
# File 'lib/libxml/sax_callbacks.rb', line 162

def on_start_document
  STDOUT << "on_start_document\n"
  STDOUT.flush
end

#on_start_element_ns(name, attributes, prefix, uri, namespaces) ⇒ Object

Called for a start element event.



168
169
170
171
172
173
174
175
176
# File 'lib/libxml/sax_callbacks.rb', line 168

def on_start_element_ns(name, attributes, prefix, uri, namespaces)
  STDOUT << "on_start_element_ns" << "\n" <<
            "  name: " << name << "\n" <<
            "  attr: " << (attributes || Hash.new).inspect << "\n" <<
            "  prefix: " << prefix << "\n" <<
            "  uri: " << uri << "\n" <<
            "  ns_defs: " << (namespaces || Hash.new).inspect << "\n"
  STDOUT.flush
end