the-experimenters-rdf-rdfxml 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rdf/rdfxml/patches/nokogiri_hacks.rb +15 -0
- data/lib/rdf/rdfxml/reader.rb +0 -4
- data/rdf-rdfxml.gemspec +1 -1
- metadata +1 -1
@@ -13,4 +13,19 @@ class Nokogiri::XML::Node
|
|
13
13
|
when Nokogiri::XML::Attr then "#{parent.display_path}@#{name}"
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
alias_method :attribute_with_ns_without_ffi_null, :attribute_with_ns
|
18
|
+
##
|
19
|
+
# Monkey patch attribute_with_ns, to insure nil is returned for #null?
|
20
|
+
#
|
21
|
+
# Get the attribute node with name and namespace
|
22
|
+
#
|
23
|
+
# @param [String] name
|
24
|
+
# @param [String] namespace
|
25
|
+
# @return [Nokogiri::XML::Attr]
|
26
|
+
def attribute_with_ns(name, namespace)
|
27
|
+
a = attribute_with_ns_without_ffi_null(name, namespace)
|
28
|
+
|
29
|
+
(a.respond_to?(:null?) && a.null?) ? nil : a # to ensure FFI Pointer compatibility
|
30
|
+
end
|
16
31
|
end
|
data/lib/rdf/rdfxml/reader.rb
CHANGED
@@ -59,11 +59,7 @@ module RDF::RDFXML
|
|
59
59
|
# Extract Evaluation Context from an element
|
60
60
|
def extract_from_element(el, &cb)
|
61
61
|
b = el.attribute_with_ns("base", RDF::XML.to_s)
|
62
|
-
b = nil if b.respond_to?(:null?) && b.null? # to ensure FFI Pointer compatibility
|
63
|
-
|
64
62
|
lang = el.attribute_with_ns("lang", RDF::XML.to_s)
|
65
|
-
lang = nil if lang.respond_to?(:null?) && lang.null? # to make FFI Pointer compatibility
|
66
|
-
|
67
63
|
self.base = self.base.join(b) if b
|
68
64
|
self.language = lang if lang
|
69
65
|
self.uri_mappings.merge!(extract_mappings(el, &cb))
|
data/rdf-rdfxml.gemspec
CHANGED