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.



68
69
70
71
72
# File 'lib/libxml/sax_callbacks.rb', line 68

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.



75
76
77
78
79
# File 'lib/libxml/sax_callbacks.rb', line 75

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

#on_comment(comment) ⇒ Object

Called for a comment event.



82
83
84
85
86
# File 'lib/libxml/sax_callbacks.rb', line 82

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

#on_end_documentObject

Called for a end document event.



89
90
91
92
# File 'lib/libxml/sax_callbacks.rb', line 89

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.



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

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.



104
105
106
107
108
# File 'lib/libxml/sax_callbacks.rb', line 104

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.



111
112
113
114
115
116
# File 'lib/libxml/sax_callbacks.rb', line 111

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.



119
120
121
122
# File 'lib/libxml/sax_callbacks.rb', line 119

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.



125
126
127
128
# File 'lib/libxml/sax_callbacks.rb', line 125

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.



131
132
133
134
135
136
# File 'lib/libxml/sax_callbacks.rb', line 131

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.



139
140
141
142
# File 'lib/libxml/sax_callbacks.rb', line 139

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

#on_processing_instruction(target, data) ⇒ Object

Called for an processing instruction event.



145
146
147
148
149
150
# File 'lib/libxml/sax_callbacks.rb', line 145

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.



153
154
155
156
157
# File 'lib/libxml/sax_callbacks.rb', line 153

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

#on_start_documentObject

Called for a start document event.



160
161
162
163
# File 'lib/libxml/sax_callbacks.rb', line 160

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.



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

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