Skip to content

Commit

Permalink
Using sax-parser for text_info.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Jun 17, 2014
1 parent 6807445 commit 20c2633
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 497 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -39,6 +39,7 @@ gem 'rubyzip', '0.9.9'
gem 'wasabi', '2.3.0'
gem 'savon', '0.9.7'
gem 'sbsm', '1.2.5'
gem 'sax-machine', '0.1.0'
gem 'spreadsheet', '0.9.7'
gem 'swissmedic-diff', '0.1.7'
# gem 'tmail' # wo wird das noch angezogen?
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -138,6 +138,8 @@ GEM
nokogiri (>= 1.4.0)
nori (~> 1.0)
wasabi (~> 2.0)
sax-machine (0.1.0)
nokogiri (> 0.0.0)
sbsm (1.2.5)
selenium-webdriver (2.35.1)
childprocess (>= 0.2.5)
Expand Down Expand Up @@ -227,6 +229,7 @@ DEPENDENCIES
rubyXL (= 1.2.10)
rubyzip (= 0.9.9)
savon (= 0.9.7)
sax-machine (= 0.1.0)
sbsm (= 1.2.5)
simplecov (~> 0.7.1)
spreadsheet (= 0.9.7)
Expand Down
37 changes: 37 additions & 0 deletions src/plugin/aips_xml_definitions.rb
@@ -0,0 +1,37 @@
# Definitions for the sax-machine to parse the Aips*.xml
# Preparations.xml

require 'sax-machine'

class SectionContent
include SAXMachine
attribute :id
element :title
end

class SectionsContent
include SAXMachine
elements :section, :class => SectionContent
end

class MedicalInformationContent
include SAXMachine
attribute :type
attribute :version
attribute :lang
attribute :safetyRelevant
element :title
element :authHolder
element :atcCode
element :substances
element :authNrs
element :remark
element :style
element :content
element :sections, :class => SectionsContent
end

class MedicalInformationsEntry
include SAXMachine
elements :medicalInformation, :lazy => true, :as => :medicalInformations, :class => MedicalInformationContent
end

0 comments on commit 20c2633

Please sign in to comment.