~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/wsdl/xmlSchema/include.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# WSDL4R - XMLSchema include definition.
2
 
# Copyright (C) 2005  NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
 
 
4
 
# This program is copyrighted free software by NAKAMURA, Hiroshi.  You can
5
 
# redistribute it and/or modify it under the same terms of Ruby's license;
6
 
# either the dual license version in 2003, or any later version.
7
 
 
8
 
 
9
 
require 'wsdl/info'
10
 
require 'wsdl/xmlSchema/importer'
11
 
 
12
 
 
13
 
module WSDL
14
 
module XMLSchema
15
 
 
16
 
 
17
 
class Include < Info
18
 
  attr_reader :schemalocation
19
 
  attr_reader :content
20
 
 
21
 
  def initialize
22
 
    super
23
 
    @schemalocation = nil
24
 
    @content = nil
25
 
  end
26
 
 
27
 
  def parse_element(element)
28
 
    nil
29
 
  end
30
 
 
31
 
  def parse_attr(attr, value)
32
 
    case attr
33
 
    when SchemaLocationAttrName
34
 
      @schemalocation = URI.parse(value.source)
35
 
      if @schemalocation.relative?
36
 
        @schemalocation = parent.location + @schemalocation
37
 
      end
38
 
      @content = import(@schemalocation)
39
 
      @schemalocation
40
 
    else
41
 
      nil
42
 
    end
43
 
  end
44
 
 
45
 
private
46
 
 
47
 
  def import(location)
48
 
    Importer.import(location)
49
 
  end
50
 
end
51
 
 
52
 
 
53
 
end
54
 
end