39: def parse_attr(attr, value)
40: case attr
41: when NamespaceAttrName
42: @namespace = value.source
43: if @content
44: @content.targetnamespace = @namespace
45: end
46: @namespace
47: when LocationAttrName
48: @location = URI.parse(value.source)
49: if @location.relative? and !parent.location.nil? and
50: !parent.location.relative?
51: @location = parent.location + @location
52: end
53: if root.importedschema.key?(@location)
54: @content = root.importedschema[@location]
55: else
56: root.importedschema[@location] = nil
57: @content = import(@location)
58: if @content.is_a?(Definitions)
59: @content.root = root
60: if @namespace
61: @content.targetnamespace = @namespace
62: end
63: end
64: root.importedschema[@location] = @content
65: end
66: @location
67: else
68: nil
69: end
70: end