- creator = opfDoc.css('dc|creator', 'dc' => 'http://purl.org/dc/elements/1.1/')
- if (nil != creator) and (creator.length > 0)
- roleNode = creator.attr('role')
- if nil != roleNode
- role = roleNode.value
- if ('aut' == role) and (creator.children.length > 0) and (nil != creator.children[0])
- name = creator.children[0].content
- parts = name.split(' ')
- if parts.length > 1
- surname = parts[-1]
- givenNames = parts[0..-2].join(' ')
- @author = Author.new(surname, givenNames)
- else
- @author = Author.new(name, '')
+ grouping = @author.grouping
+ reading_order = @author.reading_order
+ sort_order = @author.sort_order
+
+ creators = opfDoc.css('dc|creator', 'dc' => @@DC_NS_URL)
+ if (creators.length > 0)
+ creator = creators[0]
+ if nil != creator
+ role = creator['opf:role']
+ if 'aut' == role
+ reading_order = creator.content
+
+ file_as = creator['opf:file-as']
+ if nil != file_as
+ sort_order = file_as