Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1475

Show
Ignore:
Timestamp:
04/15/05 11:43:54 (4 years ago)
Author:
nahi
Message:

importing XSD file at schemaLocation with xsd:import. closes #88.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/wsdl/xmlSchema/import.rb

    r1369 r1475  
    11# WSDL4R - XMLSchema import definition. 
    2 # Copyright (C) 2002, 2003  NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 
     2# Copyright (C) 2002, 2003, 2005  NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 
    33 
    44# This program is copyrighted free software by NAKAMURA, Hiroshi.  You can 
     
    88 
    99require 'wsdl/info' 
     10require 'wsdl/xmlSchema/importer' 
    1011 
    1112 
     
    1718  attr_reader :namespace 
    1819  attr_reader :schemalocation 
     20  attr_reader :content 
    1921 
    2022  def initialize 
     
    2224    @namespace = nil 
    2325    @schemalocation = nil 
     26    @content = nil 
    2427  end 
    2528 
     
    3437    when SchemaLocationAttrName 
    3538      @schemalocation = value.source 
     39      @content = import(@schemalocation) 
     40      @schemalocation 
    3641    else 
    3742      nil 
    3843    end 
     44  end 
     45 
     46private 
     47 
     48  def import(location) 
     49    Importer.import(location) 
    3950  end 
    4051end 
  • trunk/lib/wsdl/xmlSchema/schema.rb

    r1430 r1475  
    8080    result = XSD::NamedElements.new 
    8181    result.concat(@attributes) 
     82    @imports.each do |import| 
     83      result.concat(import.content.collect_attributes) if import.content 
     84    end 
    8285    result 
    8386  end 
     
    8689    result = XSD::NamedElements.new 
    8790    result.concat(@elements) 
     91    @imports.each do |import| 
     92      result.concat(import.content.collect_elements) if import.content 
     93    end 
    8894    result 
    8995  end 
     
    9298    result = XSD::NamedElements.new 
    9399    result.concat(@complextypes) 
     100    @imports.each do |import| 
     101      result.concat(import.content.collect_complextypes) if import.content 
     102    end 
    94103    result 
    95104  end 
     
    98107    result = XSD::NamedElements.new 
    99108    result.concat(@simpletypes) 
     109    @imports.each do |import| 
     110      result.concat(import.content.collect_simpletypes) if import.content 
     111    end 
    100112    result 
    101113  end