Line | |
---|
1 | # WSDL4R - XMLSchema include definition.
|
---|
2 | # Copyright (C) 2005 NAKAMURA, Hiroshi <[email protected]>.
|
---|
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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.