diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eb055f..32255be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@v2 if: ${{ matrix.ruby == '3.0' && matrix.gemfile == 'Gemfile' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/rdf/rdfa/reader/nokogiri.rb b/lib/rdf/rdfa/reader/nokogiri.rb index 97d31d7..0f00bbd 100644 --- a/lib/rdf/rdfa/reader/nokogiri.rb +++ b/lib/rdf/rdfa/reader/nokogiri.rb @@ -35,8 +35,8 @@ def initialize(node, parent = nil) # @return [String] def language case - when @node.attribute_with_ns("lang", RDF::XML.to_s) - @node.attribute_with_ns("lang", RDF::XML.to_s) + when @node.attribute_with_ns("lang", "http://www.w3.org/XML/1998/namespace") + @node.attribute_with_ns("lang", "http://www.w3.org/XML/1998/namespace") when @node.attribute("xml:lang") @node.attribute("xml:lang").to_s when @node.attribute("lang") @@ -49,7 +49,7 @@ def language # # @return [String] def base - @node.attribute_with_ns("base", RDF::XML.to_s) || @node.attribute('xml:base') + @node.attribute_with_ns("base", "http://www.w3.org/XML/1998/namespace") || @node.attribute('xml:base') end def display_path @@ -303,7 +303,7 @@ def doc_base(base) base_el = @doc.at_css("html>head>base") base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else - xml_base = root.attribute_with_ns("base", RDF::XML.to_s) || root.attribute('xml:base') if root + xml_base = root.attribute_with_ns("base", "http://www.w3.org/XML/1998/namespace") || root.attribute('xml:base') if root base = base.join(xml_base) if xml_base end diff --git a/lib/rdf/rdfa/reader/rexml.rb b/lib/rdf/rdfa/reader/rexml.rb index a6f2753..60081a3 100644 --- a/lib/rdf/rdfa/reader/rexml.rb +++ b/lib/rdf/rdfa/reader/rexml.rb @@ -36,9 +36,9 @@ def initialize(node, parent = nil) # # @return [String] def language - language = case - when @node.attribute("lang", RDF::XML.to_s) - @node.attribute("lang", RDF::XML.to_s) + case + when @node.attribute("lang", "http://www.w3.org/XML/1998/namespace") + @node.attribute("lang", "http://www.w3.org/XML/1998/namespace") when @node.attribute("xml:lang") @node.attribute("xml:lang").to_s when @node.attribute("lang") @@ -51,7 +51,7 @@ def language # # @return [String] def base - @node.attribute("base", RDF::XML.to_s) || @node.attribute('xml:base') + @node.attribute("base", "http://www.w3.org/XML/1998/namespace") || @node.attribute('xml:base') end def display_path @@ -224,7 +224,7 @@ def initialize_xml(input, **options) @base_uri = base_uri ? base_uri.to_s : nil # Only parse as XML, no HTML mode - doc = ::REXML::Document.new(input.respond_to?(:read) ? input.read : input.to_s) + ::REXML::Document.new(input.respond_to?(:read) ? input.read : input.to_s) end end @@ -331,7 +331,7 @@ def doc_base(base) base_el = ::REXML::XPath.first(@doc, "/html/head/base") rescue nil base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else - xml_base = root.attribute("base", RDF::XML.to_s) || root.attribute('xml:base') if root + xml_base = root.attribute("base", "http://www.w3.org/XML/1998/namespace") || root.attribute('xml:base') if root base = base.join(xml_base) if xml_base end diff --git a/lib/rdf/rdfa/vocab.rb b/lib/rdf/rdfa/vocab.rb index b2c2b94..bd3cc1d 100644 --- a/lib/rdf/rdfa/vocab.rb +++ b/lib/rdf/rdfa/vocab.rb @@ -155,7 +155,4 @@ module RDF "dc:description": "is the class for all warnings".freeze, subClassOf: "rdfa:PGClass".freeze end - - XML = Class.new(Vocabulary("http://www.w3.org/XML/1998/namespace")) - XSI = Class.new(Vocabulary("http://www.w3.org/2001/XMLSchema-instance")) end