Class: WsdlMapper::Deserializers::SaxDocument
- Inherits:
-
Nokogiri::XML::SAX::Document
- Object
- Nokogiri::XML::SAX::Document
- WsdlMapper::Deserializers::SaxDocument
- Includes:
- WsdlMapper::Dom
- Defined in:
- lib/wsdl_mapper/deserializers/sax_document.rb
Constant Summary
- XSI_NS =
'http://www.w3.org/2001/XMLSchema-instance'
- XSI_TYPE =
WsdlMapper::Dom::Name.get XSI_NS, 'type'
Instance Attribute Summary (collapse)
-
- (Object) object
readonly
Returns the value of attribute object.
Instance Method Summary (collapse)
- - (Object) cdata_block(text)
- - (Object) characters(text)
- - (Object) end_document
- - (Object) end_element_namespace(name, prefix = nil, uri = nil)
-
- (SaxDocument) initialize(base)
constructor
A new instance of SaxDocument.
- - (Object) start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
Constructor Details
- (SaxDocument) initialize(base)
Returns a new instance of SaxDocument
14 15 16 17 18 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 14 def initialize(base) @base = base @namespaces_stack = [] @buffer = '' end |
Instance Attribute Details
- (Object) object (readonly)
Returns the value of attribute object
8 9 10 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 8 def object @object end |
Instance Method Details
- (Object) cdata_block(text)
70 71 72 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 70 def cdata_block(text) @buffer << text end |
- (Object) characters(text)
66 67 68 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 66 def characters(text) @buffer << text end |
- (Object) end_document
62 63 64 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 62 def end_document @object = @last_frame.object end |
- (Object) end_element_namespace(name, prefix = nil, uri = nil)
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 46 def end_element_namespace(name, prefix = nil, uri = nil) @namespaces_stack.pop if @wrapper == Name.get(uri, name) @wrapper = nil return end @current_frame.text = @buffer @buffer = '' @last_frame = @current_frame @current_frame = @current_frame.parent if @current_frame @current_frame.children << @last_frame end @last_frame.end end |
- (Object) start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/wsdl_mapper/deserializers/sax_document.rb', line 25 def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) @buffer = '' uri = inherit_element_namespace uri name = Name.get uri, name namespaces = Namespaces.for Hash[ns] @namespaces_stack << namespaces if @current_frame && @current_frame.mapping.wrapper?(name) @wrapper = name return end type_name = get_type_name name, attrs attrs = get_attributes type_name, attrs parent = @current_frame mapping = @base.get_type_mapping type_name @current_frame = Frame.new name, type_name, attrs, parent, namespaces, @base, mapping @current_frame.start end |