Class: Moxml::Adapter::REXMLSAX2Bridge
Overview
Bridge between REXML SAX2 and Moxml SAX
Translates REXML::SAX2Parser events to Moxml::SAX::Handler events
Instance Method Summary
collapse
#split_attributes_and_namespaces
Constructor Details
Returns a new instance of REXMLSAX2Bridge.
654
655
656
|
# File 'lib/moxml/adapter/rexml.rb', line 654
def initialize(handler)
@handler = handler
end
|
Instance Method Details
#cdata(content) ⇒ Object
672
673
674
|
# File 'lib/moxml/adapter/rexml.rb', line 672
def cdata(content)
@handler.on_cdata(content)
end
|
#characters(text) ⇒ Object
668
669
670
|
# File 'lib/moxml/adapter/rexml.rb', line 668
def characters(text)
@handler.on_characters(text)
end
|
676
677
678
|
# File 'lib/moxml/adapter/rexml.rb', line 676
def (text)
@handler.(text)
end
|
#end_document ⇒ Object
688
689
690
|
# File 'lib/moxml/adapter/rexml.rb', line 688
def end_document
@handler.on_end_document
end
|
#end_element(_uri, _localname, qname) ⇒ Object
664
665
666
|
# File 'lib/moxml/adapter/rexml.rb', line 664
def end_element(_uri, _localname, qname)
@handler.on_end_element(qname)
end
|
#processing_instruction(target, data) ⇒ Object
680
681
682
|
# File 'lib/moxml/adapter/rexml.rb', line 680
def processing_instruction(target, data)
@handler.on_processing_instruction(target, data || "")
end
|
#progress(position) ⇒ Object
697
698
699
|
# File 'lib/moxml/adapter/rexml.rb', line 697
def progress(position)
end
|
#start_document ⇒ Object
684
685
686
|
# File 'lib/moxml/adapter/rexml.rb', line 684
def start_document
@handler.on_start_document
end
|
#start_element(_uri, _localname, qname, attributes) ⇒ Object
REXML splits element name into uri/localname/qname
659
660
661
662
|
# File 'lib/moxml/adapter/rexml.rb', line 659
def start_element(_uri, _localname, qname, attributes)
attr_hash, ns_hash = split_attributes_and_namespaces(attributes)
@handler.on_start_element(qname, attr_hash, ns_hash)
end
|
#xmldecl(version, encoding, standalone) ⇒ Object
REXML calls these but we don’t need to handle them
693
694
695
|
# File 'lib/moxml/adapter/rexml.rb', line 693
def xmldecl(version, encoding, standalone)
end
|