Sha256: cb28fd7e46b4300196644acf708e99408f1e651d3b4255b7752f97cdd2c16d0d

Contents?: true

Size: 1.41 KB

Versions: 14

Compression:

Stored size: 1.41 KB

Contents

# This is a freedom patch that will only be applied when using JRuby
# Currently, Nokogiri does not properly handle namespace prefixes
# when they are set on the document root and then used in XPath
# expressions. We should be able to remove this patch if/when
# Rob's pull request is accepted:
# https://github.com/sparklemotion/nokogiri/pull/959
if RUBY_PLATFORM.include?('java')
  module Nokogiri
    module XML
      NAMESPACES = {'cda' => 'urn:hl7-org:v3',
                'sdtc' => 'urn:hl7-org:sdtc',
                'gc32' => 'urn:hl7-org:greencda:c32',
                'ccr' => 'urn:astm-org:CCR',
                'vs' => 'urn:ihe:iti:svs:2008',
                'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
                'hrf-md' => 'http://www.hl7.org/schemas/hdata/2009/11/metadata',
                'nlm' => 'urn:ihe:iti:svs:2008'
                }
      class Node
        alias_method :old_at_xpath, :at_xpath
        alias_method :old_xpath, :xpath

        def xpath(*args)
          old_xpath(*args, NAMESPACES)
        end

        def at_xpath(*args)
          old_at_xpath(*args, NAMESPACES)
        end
      end

      class NodeSet
        alias_method :old_at_xpath, :at_xpath
        alias_method :old_xpath, :xpath

        def xpath(*args)
          old_xpath(*args, NAMESPACES)
        end

        def at_xpath(*args)
          old_at_xpath(*args, NAMESPACES)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
health-data-standards-3.5.3 lib/health-data-standards/ext/node.rb
health-data-standards-3.5.2 lib/health-data-standards/ext/node.rb
health-data-standards-3.5.1 lib/health-data-standards/ext/node.rb
health-data-standards-3.5.0 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.6 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.5 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.4 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.3 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.2 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.1 lib/health-data-standards/ext/node.rb
health-data-standards-3.4.0 lib/health-data-standards/ext/node.rb
health-data-standards-3.2.12 lib/health-data-standards/ext/node.rb
health-data-standards-3.3.0 lib/health-data-standards/ext/node.rb
health-data-standards-3.2.11 lib/health-data-standards/ext/node.rb