Class: XML::SAX::Debug

Inherits:
Filter
  • Object
show all
Defined in:
lib/xml-sax-machines/debug.rb

Overview

SAX Debug filter.

Warn all SAX event methods before calling the next filter in the chain. Handy as it can be placed anywhere in a pipeline to see what events are being passed to the next filter.

See

  • XML::SAX::Filter

Instance Attribute Summary

Attributes inherited from Filter

#filter

Instance Method Summary collapse

Methods inherited from Filter

#cdata_block, #characters, #comment, #end_document, #end_element_namespace, #error, #start_document, #warning

Instance Method Details

#start_element_namespace(name, attributes = [], prefix = nil, uri = nil, ns = []) ⇒ Object



31
32
33
34
35
# File 'lib/xml-sax-machines/debug.rb', line 31

def start_element_namespace name, attributes = [], prefix = nil, uri = nil, ns = []
  atts = attributes.map{|attribute| [[attribute.prefix, attribute.localname].compact.join(':'), attribute.value]}
  warn "start_element_namespace: [#{name.inspect}, #{atts.inspect}, #{prefix.inspect}, #{uri.inspect}, #{ns.inspect}]"
  super
end