require 'rubygems'
require 'nokogiri'
puts ""
puts "SHOULD NOT BE THIS"
puts ""
record = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
xml.send("OAI-PMH",
:"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
:"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd",
:"xmlns" => "http://www.openarchives.org/OAI/2.0/") do
xml.responseDate(Time.now.utc)
xml.request({ :verb => "GetRecord", :metadataPrefix => "oai_dc" }, 'http://......./')
xml.GetRecord do
xml.header do
xml.identifier
end
xml.metadata do
xml.send("oai_dc:dc",
:"xmlns:oai_dc" => "http://www.openarchives.org/OAI/2.0/oai_dc/",
:"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
:"xmlns:dc" => "http://purl.org/dc/elements/1.1/",
:"xmlns:dcterms" => "http://purl.org/dc/terms/",
:"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd") do
end
end
end
end
end
puts record.to_xml
puts ""
puts "SHOULD BE THIS"
puts ""
record = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
xml.send("OAI-PMH",
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd",
"xmlns" => "http://www.openarchives.org/OAI/2.0/") do
xml.responseDate(Time.now.utc)
xml.request({ :verb => "GetRecord", :metadataPrefix => "oai_dc" }, 'http://......./')
xml.GetRecord do
xml.header do
xml.identifier
end
xml.metadata do
xml.send("oai_dc:dc",
"xmlns:oai_dc" => "http://www.openarchives.org/OAI/2.0/oai_dc/",
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
"xmlns:dc" => "http://purl.org/dc/elements/1.1/",
"xmlns:dcterms" => "http://purl.org/dc/terms/",
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd") do
end
end
end
end
end
puts record.to_xml
puts ""