movitto / RXSD

XSD / Ruby Translator
http://projects.morsi.org/RXSD
GNU Lesser General Public License v3.0
85 stars 35 forks source link

Problem with superclass method #13

Open frosenberg opened 10 years ago

frosenberg commented 10 years ago

I run the following sample program (pretty much adapted from the wiki) and use the National Vulnerability Database XML schema and sample file as an input.

This is the sample file:

require 'rxsd'

xsd_uri = "http://nvd.nist.gov/schema/nvd-cve-feed_2.0.xsd"
xml_uri = "http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-modified.xml"

schema = RXSD::Parser.parse_xsd :uri => xsd_uri

puts "=======Classes======="
classes = schema.to :ruby_classes
puts classes.collect{ |cl| !cl.nil? ?
    (cl.to_s + " < " + cl.superclass.to_s) : ""}.sort.join("\n")

This is what I'm getting:

cert-input.rb:23:in `block in <main>': undefined method `superclass' for "vuln:vulnerabilityType":String (NoMethodError)
    from cert-input.rb:23:in `collect'
    from cert-input.rb:23:in `<main>'