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

Changeset 1919

Show
Ignore:
Timestamp:
08/23/07 21:01:27 (11 months ago)
Author:
nahi
Message:
  • should allow durations lower than a day. Thanks to an anonymous user for taking the time to file the ticket #401. closes #401.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/xsd/datatypes.rb

    r1892 r1919  
    455455      raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") 
    456456    end 
    457     if ($5 and ((!$2 and !$3 and !$4) or (!$6 and !$7 and !$8))) 
    458       # Should we allow 'PT5S' here? 
     457    if $5 and !$6 and !$7 and !$8 
     458      # allows durations lower than a day such as 'PT5S'. 
    459459      raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") 
    460460    end 
     
    492492    r << "#{ @sec }S" if @sec.nonzero? 
    493493    str << l 
    494     if l.empty? 
    495       str << "0D" 
    496     end 
    497494    unless r.empty? 
    498495      str << "T" << r 
     496    end 
     497    if l.empty? and r.empty? 
     498      str << "0D" 
    499499    end 
    500500    str 
  • trunk/test/soap/test_basetype.rb

    r1840 r1919  
    407407      "P1Y2M3DT4H5M6S", 
    408408      "P1234Y5678M9012DT3456H7890M1234.5678S", 
    409       "P0DT3456H7890M1234.5678S", 
     409      "PT3456H7890M1234.5678S", 
    410410      "P1234Y5678M9012D", 
    411411      "-P1234Y5678M9012DT3456H7890M1234.5678S", 
     
    419419      "-P567800000000000M", 
    420420      "+P901200000000000D", 
    421       "P0DT345600000000000H", 
    422       "-P0DT789000000000000M", 
    423       "+P0DT123400000000000.000000000005678S", 
     421      "PT345600000000000H", 
     422      "-PT789000000000000M", 
     423      "+PT123400000000000.000000000005678S", 
    424424      "P1234YT1234.5678S", 
    425425      "-P5678MT7890M", 
  • trunk/test/xsd/test_xsd.rb

    r1840 r1919  
    446446      "P1Y2M3DT4H5M6S", 
    447447      "P1234Y5678M9012DT3456H7890M1234.5678S", 
    448       "P0DT3456H7890M1234.5678S", 
     448      "PT3456H7890M1234.5678S", 
    449449      "P1234Y5678M9012D", 
    450450      "-P1234Y5678M9012DT3456H7890M1234.5678S", 
     
    458458      "-P567800000000000M", 
    459459      "+P901200000000000D", 
    460       "P0DT345600000000000H", 
    461       "-P0DT789000000000000M", 
    462       "+P0DT123400000000000.000000000005678S", 
     460      "PT345600000000000H", 
     461      "-PT789000000000000M", 
     462      "+PT123400000000000.000000000005678S", 
    463463      "P1234YT1234.5678S", 
    464464      "-P5678MT7890M", 
    465465      "+P9012DT3456H", 
     466      "PT5S", 
    466467    ] 
    467468    targets.each do |str|