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

root/branches/1_5/lib/wsdl/xmlSchema/choice.rb

Revision 1918, 0.9 kB (checked in by nahi, 1 year ago)
  • allow <any> appear twice or more (with the current implementation, soap4r ignores <any> element definition such as namespace and processContent. just allow any element appear.) closes #402.
  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1 # WSDL4R - XMLSchema complexType definition for WSDL.
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/xmlSchema/content'
10
11
12 module WSDL
13 module XMLSchema
14
15
16 class Choice < Content
17   attr_reader :any
18
19   def initialize
20     super()
21     @any = nil
22   end
23
24   def have_any?
25     !!@any
26   end
27
28   def choice?
29     true
30   end
31
32   def parse_element(element)
33     case element
34     when SequenceName
35       o = Sequence.new
36       @elements << o
37       o
38     when ChoiceName
39       o = Choice.new
40       @elements << o
41       o
42     when GroupName
43       o = Group.new
44       @elements << o
45       o
46     when AnyName
47       @any = Any.new
48       @elements << @any
49       @any
50     else
51       super(element)
52     end
53   end
54 end
55
56
57 end
58 end
Note: See TracBrowser for help on using the browser.