Sha256: 82b8d4f8a34ff42eec88b75081593b89623ddfaf2d97f15cbccee739df91a6c7
Contents?: true
Size: 1.36 KB
Versions: 17
Compression:
Stored size: 1.36 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', '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
17 entries across 17 versions & 1 rubygems