Class: WSDL::XMLSchema::ImportHandler
- Defined in:
- lib/wsdl/xmlSchema/importHandler.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#schemalocation ⇒ Object
readonly
Returns the value of attribute schemalocation.
Instance Method Summary collapse
-
#initialize ⇒ ImportHandler
constructor
A new instance of ImportHandler.
- #parse_schemalocation(location, root, parent) ⇒ Object
Constructor Details
#initialize ⇒ ImportHandler
Returns a new instance of ImportHandler.
22 23 24 25 |
# File 'lib/wsdl/xmlSchema/importHandler.rb', line 22 def initialize @schemalocation = nil @content = nil end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
20 21 22 |
# File 'lib/wsdl/xmlSchema/importHandler.rb', line 20 def content @content end |
#schemalocation ⇒ Object (readonly)
Returns the value of attribute schemalocation.
19 20 21 |
# File 'lib/wsdl/xmlSchema/importHandler.rb', line 19 def schemalocation @schemalocation end |
Instance Method Details
#parse_schemalocation(location, root, parent) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/wsdl/xmlSchema/importHandler.rb', line 27 def parse_schemalocation(location, root, parent) @schemalocation = URI.parse(location) if @schemalocation.relative? and !parent.location.nil? and !parent.location.relative? @schemalocation = parent.location + @schemalocation end if root.importedschema.key?(@schemalocation) @content = root.importedschema[@schemalocation] else root.importedschema[@schemalocation] = nil # placeholder @content = Importer.import(@schemalocation, root) root.importedschema[@schemalocation] = @content end @schemalocation end |