lib/onix/code_list_extractor.rb
def list_data(num)
      str   = ""
      nodes = document.xpath("//simpleType[@name='List#{num}']/restriction/enumeration")
      nodes.each do |node|
        code  = node.xpath("./@value").first.value
        desc  = node.xpath("./annotation/documentation").first.text
        ldesc = node.xpath("./annotation/documentation").last.text
        str += "#{code}\t#{desc}\t#{ldesc}\n"
      end
      str
    end
# Creates a new extractor. Expects the path to a copy of the code lists
# file from the spec (called ONIX_BookProduct_CodeLists.xsd on my system).
#
Creates a new extractor. Expects the path to a copy of the code lists
file from the spec (called ONIX_BookProduct_CodeLists.xsd on my system).
Creates a new extractor . Expects the path to a copy of the code lists file from the spec ( called ONIX_BookProduct_CodeLists . xsd on my system ) .
def list_data(num)
      str   = ""
      nodes = document.xpath("//simpleType[@name='List#{num}']/restriction/enumeration")
      nodes.each do |node|
        code  = node.xpath("./@value").first.value
        desc  = node.xpath("./annotation/documentation").first.text
        ldesc = node.xpath("./annotation/documentation").last.text
        str += "#{code}\t#{desc}\t#{ldesc}\n"
      end
      str
    end
def list_data ( num ) str = "" nodes = document . xpath ( "//simpleType[@name='List#{num}']/restriction/enumeration" ) nodes . each do | node | code = node . xpath ( "./@value" ) . first . value desc = node . xpath ( "./annotation/documentation" ) . first . text ldesc = node . xpath ( "./annotation/documentation" ) . last . text str += "#{code}\t#{desc}\t#{ldesc}\n" end str end
Creates a new extractor.
Creates a new extractor .
num