Sha256: 9f7c3e0422e4a2a58d5c2fb698e3ec03100f80535fbf8cbed099a39584cbf28d

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

module Metanorma
  module JIS
    class Converter < ISO::Converter
      def doctype_validate(_xmldoc)
        %w(japanese-industrial-standard technical-report
           technical-specification amendment).include? @doctype or
          @log.add("Document Attributes", nil,
                   "#{@doctype} is not a recognised document type")
      end

      def script_validate(xmldoc)
        script = xmldoc&.at("//bibdata/script")&.text
        %w(Jpan Latn).include?(script) or
          @log.add("Document Attributes", nil,
                   "#{script} is not a recognised script")
      end

      def validate(doc)
        content_validate(doc)
        schema_validate(formattedstr_strip(doc.dup),
                        File.join(File.dirname(__FILE__), "jis.rng"))
      end

      def image_name_validate(xmldoc); end
      def norm_bibitem_style(xmldoc); end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metanorma-jis-0.3.3 lib/metanorma/jis/validate.rb