Initial project setup
This commit is contained in:
33
lib/ezdoc/xml/relationships.rb
Normal file
33
lib/ezdoc/xml/relationships.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Ezdoc
|
||||
module Xml
|
||||
class Relationships
|
||||
NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"
|
||||
|
||||
def to_xml
|
||||
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
|
||||
xml.Relationships(xmlns: NAMESPACE) do
|
||||
xml.Relationship(
|
||||
Id: "rId1",
|
||||
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
|
||||
Target: "word/document.xml"
|
||||
)
|
||||
end
|
||||
end
|
||||
builder.to_xml
|
||||
end
|
||||
end
|
||||
|
||||
class DocumentRelationships
|
||||
NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"
|
||||
|
||||
def to_xml
|
||||
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
|
||||
xml.Relationships(xmlns: NAMESPACE)
|
||||
end
|
||||
builder.to_xml
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user