Class: OpenSRS::XmlProcessor::Libxml
- Inherits:
-
OpenSRS::XmlProcessor
- Object
- OpenSRS::XmlProcessor
- OpenSRS::XmlProcessor::Libxml
- Includes:
- LibXML::XML
- Defined in:
- lib/opensrs/xml_processor/libxml.rb
Class Method Summary collapse
-
.build(data) ⇒ Object
First, builds REXML elements for the inputted data.
Methods inherited from OpenSRS::XmlProcessor
Class Method Details
.build(data) ⇒ Object
First, builds REXML elements for the inputted data. Then, it will go ahead and build the entire XML document to send to OpenSRS.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/opensrs/xml_processor/libxml.rb', line 15 def self.build(data) xml = Document.new xml.root = envelope = Node.new("OPS_envelope") envelope << header = Node.new("header") envelope << body = Node.new("body") header << Node.new("version", "0.9") body << data_block = Node.new("data_block") data_block << encode_data(data, data_block) return xml.to_s end |