source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/wsdl/xmlSchema/include.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 1014 bytes
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
9require 'wsdl/info'
10require 'wsdl/xmlSchema/importer'
11
12
13module WSDL
14module XMLSchema
15
16
17class 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
45private
46
47 def import(location)
48 Importer.import(location)
49 end
50end
51
52
53end
54end
Note: See TracBrowser for help on using the repository browser.