Skip to content

Commit

Permalink
Map some more XSD types.
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaw committed Apr 7, 2016
1 parent 3768212 commit 427845b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ end

task :xjc do
schema = ENV["SCHEMA"]
abort "SCHEMA not set" unless schema
abort "SCHEMA not set" if schema.to_s.strip.empty?

output = ENV["OUTPUT"] || "java-src"
FileUtils.mkdir(output) unless File.directory?(output)

sh "xjc -extension -npa -d #{output} #{schema} -b lib/jaxb2ruby/config.xjb"
sh "xjc -extension -npa -d #{output} #{schema} -b lib/jaxb2ruby/config.xjb"
end
2 changes: 2 additions & 0 deletions lib/jaxb2ruby/type_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class TypeUtil # :nodoc:
SCHEMA_TO_RUBY = {
"ID" => :ID,
"IDREF" => :IDREF,
"Name" => "String",
"NCName" => "String",
"NMTOKEN" => "String",
"anySimpleType" => "Object",
Expand All @@ -50,6 +51,7 @@ class TypeUtil # :nodoc:
"int" => "Integer",
"integer" => "Integer",
"long" => "Integer",
"language" => "String",
"nonNegativeInteger" => "Integer",
"nonPositiveInteger" => "Integer",
"normalizedString" => "String",
Expand Down

0 comments on commit 427845b

Please sign in to comment.