From e5af4f62f507ae05c102bf140423d45ea8e5601c Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Mon, 28 Oct 2024 13:13:10 +0800 Subject: [PATCH] fix: more specs --- lib/niso/jats/author_notes.rb | 6 +++--- lib/niso/jats/ext_link.rb | 2 ++ lib/niso/jats/fn.rb | 2 +- lib/niso/jats/graphic.rb | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/niso/jats/author_notes.rb b/lib/niso/jats/author_notes.rb index 40b0dad..93dea8a 100644 --- a/lib/niso/jats/author_notes.rb +++ b/lib/niso/jats/author_notes.rb @@ -13,16 +13,16 @@ class AuthorNotes < Lutaml::Model::Serializable attribute :p, Paragraph, collection: true xml do - root "author-notes" + root "author-notes", ordered: true map_attribute "id", to: :id map_attribute "rid", to: :rid map_attribute "specific-use", to: :specific_use map_element "label", to: :label map_element "title", to: :title - map_element "fn", to: :fn - map_element "corresp", to: :corresp map_element "p", to: :p + map_element "corresp", to: :corresp + map_element "fn", to: :fn end end end diff --git a/lib/niso/jats/ext_link.rb b/lib/niso/jats/ext_link.rb index f4d2f6b..13145af 100644 --- a/lib/niso/jats/ext_link.rb +++ b/lib/niso/jats/ext_link.rb @@ -6,6 +6,7 @@ class ExtLink < Lutaml::Model::Serializable attribute :content, :string attribute :assigning_authority, :string attribute :ext_link_type, :string + attribute :href, :string attribute :hreflang, :string attribute :id, :string attribute :specific_use, :string @@ -30,6 +31,7 @@ class ExtLink < Lutaml::Model::Serializable root "ext-link", mixed: true map_content to: :content + map_attribute "href", to: :href, namespace: "http://www.w3.org/1999/xlink" map_attribute "assigning-authority", to: :assigning_authority map_attribute "ext-link-type", to: :ext_link_type map_attribute "hreflang", to: :hreflang diff --git a/lib/niso/jats/fn.rb b/lib/niso/jats/fn.rb index 45877a4..0af0fb6 100644 --- a/lib/niso/jats/fn.rb +++ b/lib/niso/jats/fn.rb @@ -16,7 +16,7 @@ class Fn < Lutaml::Model::Serializable attribute :p, Paragraph, collection: true xml do - root "fn" + root "fn", mixed: true map_attribute "custom-type", to: :custom_type map_attribute "fn-type", to: :fn_type diff --git a/lib/niso/jats/graphic.rb b/lib/niso/jats/graphic.rb index 0dad9c5..356e4c8 100644 --- a/lib/niso/jats/graphic.rb +++ b/lib/niso/jats/graphic.rb @@ -4,6 +4,7 @@ module Niso module Jats class Graphic < Lutaml::Model::Serializable attribute :content_type, :string + attribute :href, :string attribute :hreflang, :string attribute :id, :string attribute :mime_subtype, :string @@ -31,6 +32,7 @@ class Graphic < Lutaml::Model::Serializable root "graphic" map_attribute "content-type", to: :content_type + map_attribute "href", to: :href, namespace: "http://www.w3.org/1999/xlink" map_attribute "hreflang", to: :hreflang map_attribute "id", to: :id map_attribute "mime-subtype", to: :mime_subtype