Sha256: 265e305d21e3aefa199e2b1a2295c587e11e01081d26cd584fe693972e84a572

Contents?: true

Size: 815 Bytes

Versions: 179

Compression:

Stored size: 815 Bytes

Contents

require 'employment_schema'
require 'rexml/document'
include REXML
include EMP
$xnspre = "emp"
##
infile = File.new("example_employment_data.xml","r")
doc = REXML::Document.new infile
## create a model container for the data instances
m = EMP::Model___data.new
##
## Set the XML Namespace for the P28 E2 file
m.namespace = $xnspre
## Give model a name if you want
m.model_name = "Test dataset 1"
m.model_elements = []
m.readP28e2(doc)
if m.model_elements.size != 0
	puts "Copied " + m.model_elements.size.to_s
	for e in m.model_elements
		puts "p28id = " + e.getP28id.to_s
	end
##
## Set up the XML file and write all data in the model container to the file
	datafile = File.new("example_employment_data_copy.xml","w")
	p28file = REXML::Document.new
	m.writeP28e2 p28file
	datafile.puts p28file
	datafile.close
end

Version data entries

179 entries across 179 versions & 1 rubygems

Version Path
expressir-0.2.25-x86_64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.25-x86-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.25-x86-linux original/examples/employment/example_employment_reader.rb
expressir-0.2.25-x64-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.25-arm64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.24 original/examples/employment/example_employment_reader.rb
expressir-0.2.24-x86_64-linux original/examples/employment/example_employment_reader.rb
expressir-0.2.24-x86_64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.24-x86-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.24-x86-linux original/examples/employment/example_employment_reader.rb
expressir-0.2.24-x64-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.24-arm64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.21 original/examples/employment/example_employment_reader.rb
expressir-0.2.21-x86_64-linux original/examples/employment/example_employment_reader.rb
expressir-0.2.21-x86_64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.21-x86-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.21-x86-linux original/examples/employment/example_employment_reader.rb
expressir-0.2.21-x64-mingw32 original/examples/employment/example_employment_reader.rb
expressir-0.2.21-arm64-darwin original/examples/employment/example_employment_reader.rb
expressir-0.2.19 original/examples/employment/example_employment_reader.rb