| Class | WSDL::XMLSchema::Schema |
| In: |
lib/wsdl/xmlSchema/schema.rb
|
| Parent: | Info |
| attributeformdefault | [RW] | |
| attributes | [R] | |
| complextypes | [R] | |
| elementformdefault | [RW] | |
| elements | [R] | |
| importedschema | [R] | |
| imports | [R] | |
| simpletypes | [R] | |
| targetnamespace | [R] |
# File lib/wsdl/xmlSchema/schema.rb, line 29
29: def initialize
30: super
31: @targetnamespace = nil
32: @complextypes = XSD::NamedElements.new
33: @simpletypes = XSD::NamedElements.new
34: @elements = XSD::NamedElements.new
35: @attributes = XSD::NamedElements.new
36: @imports = []
37: @attributeformdefault = "unqualified"
38: @elementformdefault = "unqualified"
39: @importedschema = {}
40: @location = nil
41: @root = self
42: end
# File lib/wsdl/xmlSchema/schema.rb, line 132
132: def self.parse_element(element)
133: if element == SchemaName
134: Schema.new
135: else
136: nil
137: end
138: end
# File lib/wsdl/xmlSchema/schema.rb, line 96
96: def collect_attributes
97: result = XSD::NamedElements.new
98: result.concat(@attributes)
99: @imports.each do |import|
100: result.concat(import.content.collect_attributes) if import.content
101: end
102: result
103: end
# File lib/wsdl/xmlSchema/schema.rb, line 114
114: def collect_complextypes
115: result = XSD::NamedElements.new
116: result.concat(@complextypes)
117: @imports.each do |import|
118: result.concat(import.content.collect_complextypes) if import.content
119: end
120: result
121: end
# File lib/wsdl/xmlSchema/schema.rb, line 105
105: def collect_elements
106: result = XSD::NamedElements.new
107: result.concat(@elements)
108: @imports.each do |import|
109: result.concat(import.content.collect_elements) if import.content
110: end
111: result
112: end
# File lib/wsdl/xmlSchema/schema.rb, line 123
123: def collect_simpletypes
124: result = XSD::NamedElements.new
125: result.concat(@simpletypes)
126: @imports.each do |import|
127: result.concat(import.content.collect_simpletypes) if import.content
128: end
129: result
130: end
# File lib/wsdl/xmlSchema/schema.rb, line 44
44: def location
45: @location || (root.nil? ? nil : root.location)
46: end
# File lib/wsdl/xmlSchema/schema.rb, line 48
48: def location=(location)
49: @location = location
50: end
# File lib/wsdl/xmlSchema/schema.rb, line 83
83: def parse_attr(attr, value)
84: case attr
85: when TargetNamespaceAttrName
86: @targetnamespace = value.source
87: when AttributeFormDefaultAttrName
88: @attributeformdefault = value.source
89: when ElementFormDefaultAttrName
90: @elementformdefault = value.source
91: else
92: nil
93: end
94: end
# File lib/wsdl/xmlSchema/schema.rb, line 52
52: def parse_element(element)
53: case element
54: when ImportName
55: o = Import.new
56: @imports << o
57: o
58: when IncludeName
59: o = Include.new
60: @imports << o
61: o
62: when ComplexTypeName
63: o = ComplexType.new
64: @complextypes << o
65: o
66: when SimpleTypeName
67: o = SimpleType.new
68: @simpletypes << o
69: o
70: when ElementName
71: o = Element.new
72: @elements << o
73: o
74: when AttributeName
75: o = Attribute.new
76: @attributes << o
77: o
78: else
79: nil
80: end
81: end