89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# File 'lib/gepub/spine.rb', line 89
def self.parse(spine_xml, opf_version = '3.0', id_pool = Package::IDPool.new)
Spine.new(opf_version, id_pool) {
|spine|
spine.instance_eval {
@xml = spine_xml
@namespaces = @xml.namespaces
@attributes = attr_to_hash(@xml.attributes)
@item_refs = []
@xml.xpath("//#{ns_prefix(OPF_NS)}:spine/#{ns_prefix(OPF_NS)}:itemref", @namespaces).map {
|itemref|
i = Itemref.create(self, attr_to_hash(itemref.attributes))
@item_refs << i
}
}
}
end
|