From 7d163a29ec5458eb8e02ef3de8d7aece2be1f59e Mon Sep 17 00:00:00 2001 From: nahi Date: Mon, 20 Dec 2004 13:50:15 +0000 Subject: * added files: * lib/soap/mapping/wsdl*.rb * lib/wsdl/soap/element.rb * lib/wsdl/xmlSchema/simpleContent.rb * modified files: * lib/soap/* * lib/wsdl/* * lib/xsd/* * test/soap/* * test/wsdl/* * test/xsd/* * summary * imported from the soap4r repository. Version: 1.5.3-ruby1.8.2 * added several XSD basetype support: nonPositiveInteger, negativeInteger, nonNegativeInteger, unsignedLong, unsignedInt, unsignedShort, unsignedByte, positiveInteger * HTTP client connection/send/receive timeout support. * HTTP client/server gzipped content encoding support. * improved WSDL schema definition support; still is far from complete, but is making step by step improovement. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/xsd/ns.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'lib/xsd/ns.rb') diff --git a/lib/xsd/ns.rb b/lib/xsd/ns.rb index 224db6c05..66bd9caf4 100644 --- a/lib/xsd/ns.rb +++ b/lib/xsd/ns.rb @@ -93,9 +93,20 @@ public # $1 and $2 are necessary. ParseRegexp = Regexp.new('^([^:]+)(?::(.+))?$') - def parse(elem) - ns = nil - name = nil + def parse(str, local = false) + if ParseRegexp =~ str + if (name = $2) and (ns = @tag2ns[$1]) + return XSD::QName.new(ns, name) + end + end + XSD::QName.new(local ? nil : @default_namespace, str) + end + + # For local attribute key parsing + # + # => + # {}bar, {urn:}baz + def parse_local(elem) ParseRegexp =~ elem if $2 ns = @tag2ns[$1] @@ -104,10 +115,9 @@ public raise FormatError.new('Unknown namespace qualifier: ' << $1) end elsif $1 - ns = @default_namespace + ns = nil name = $1 - end - if !name + else raise FormatError.new("Illegal element format: #{ elem }") end XSD::QName.new(ns, name) -- cgit