|
Revision 1890, 1.0 kB
(checked in by nahi, 1 year ago)
|
- some WSDL caused cyclic schema inclusion. <xsd:import> supported cyclic include but <xsd:include> did not. extract common implementation as importHandler.rb. closes #385.
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
# WSDL4R - XMLSchema import definition. |
|---|
| 2 |
# Copyright (C) 2000-2007 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 |
require 'wsdl/xmlSchema/importHandler' |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
module WSDL |
|---|
| 15 |
module XMLSchema |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
class Import < Info |
|---|
| 19 |
attr_reader :namespace |
|---|
| 20 |
|
|---|
| 21 |
def initialize |
|---|
| 22 |
super |
|---|
| 23 |
@namespace = nil |
|---|
| 24 |
@handler = ImportHandler.new |
|---|
| 25 |
end |
|---|
| 26 |
|
|---|
| 27 |
def schemalocation |
|---|
| 28 |
@handler.schemalocation |
|---|
| 29 |
end |
|---|
| 30 |
|
|---|
| 31 |
def content |
|---|
| 32 |
@handler.content |
|---|
| 33 |
end |
|---|
| 34 |
|
|---|
| 35 |
def parse_element(element) |
|---|
| 36 |
nil |
|---|
| 37 |
end |
|---|
| 38 |
|
|---|
| 39 |
def parse_attr(attr, value) |
|---|
| 40 |
case attr |
|---|
| 41 |
when NamespaceAttrName |
|---|
| 42 |
@namespace = value.source |
|---|
| 43 |
when SchemaLocationAttrName |
|---|
| 44 |
@handler.parse_schemalocation(value.source, root, parent) |
|---|
| 45 |
else |
|---|
| 46 |
nil |
|---|
| 47 |
end |
|---|
| 48 |
end |
|---|
| 49 |
end |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
end |
|---|
| 53 |
end |
|---|