/tools/Ruby/lib/ruby/1.8/wsdl/xmlSchema/any.rb

http://github.com/agross/netopenspace · Ruby · 56 lines · 38 code · 13 blank · 5 comment · 0 complexity · ed879646d768ca409cf0c01773061bde MD5 · raw file

  1. # WSDL4R - XMLSchema any definition for WSDL.
  2. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
  3. # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
  4. # redistribute it and/or modify it under the same terms of Ruby's license;
  5. # either the dual license version in 2003, or any later version.
  6. require 'wsdl/info'
  7. module WSDL
  8. module XMLSchema
  9. class Any < Info
  10. attr_accessor :maxoccurs
  11. attr_accessor :minoccurs
  12. attr_accessor :namespace
  13. attr_accessor :process_contents
  14. def initialize
  15. super()
  16. @maxoccurs = '1'
  17. @minoccurs = '1'
  18. @namespace = '##any'
  19. @process_contents = 'strict'
  20. end
  21. def targetnamespace
  22. parent.targetnamespace
  23. end
  24. def parse_element(element)
  25. nil
  26. end
  27. def parse_attr(attr, value)
  28. case attr
  29. when MaxOccursAttrName
  30. @maxoccurs = value.source
  31. when MinOccursAttrName
  32. @minoccurs = value.source
  33. when NamespaceAttrName
  34. @namespace = value.source
  35. when ProcessContentsAttrName
  36. @process_contents = value.source
  37. else
  38. nil
  39. end
  40. end
  41. end
  42. end
  43. end