lib/exlibris/primo/pnx/elements.rb in exlibris-primo-1.1.3 vs lib/exlibris/primo/pnx/elements.rb in exlibris-primo-1.1.4

- old
+ new

@@ -1,11 +1,11 @@ module Exlibris module Primo module Pnx - # + # # Provides access to PNX elements - # + # module Elements # # Parses elements from PNX base on the pattern # parentname_childname e.g. # record.display_title #=> "Travels with my aunt" @@ -42,29 +42,29 @@ (attr_read(method)) ? true : super end def attr_read method if("#{method}".start_with? "all_") - (inner_html_all(xpathize(method)) || inner_html_all(controlize(method))) + (inner_text_all(xpathize(method)) || inner_text_all(controlize(method))) else - (inner_html_at(xpathize(method)) || inner_html_at(controlize(method))) + (inner_text_at(xpathize(method)) || inner_text_at(controlize(method))) end end private :attr_read - def inner_html_all xpath + def inner_text_all xpath xml.root.xpath(xpath).collect do |element| - element.inner_html + element.inner_text end end - private :inner_html_all + private :inner_text_all - def inner_html_at xpath + def inner_text_at xpath xml_at = xml.root.at_xpath(xpath) - xml_at.inner_html if xml_at + xml_at.inner_text if xml_at end - private :inner_html_at + private :inner_text_at def controlize s "control/#{xpathize s.to_s}" end private :controlize @@ -74,6 +74,6 @@ end private :xpathize end end end -end \ No newline at end of file +end