Changeset 1919
- Timestamp:
- 08/23/07 21:01:27 (11 months ago)
- Files:
-
- trunk/lib/xsd/datatypes.rb (modified) (2 diffs)
- trunk/test/soap/test_basetype.rb (modified) (2 diffs)
- trunk/test/xsd/test_xsd.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/xsd/datatypes.rb
r1892 r1919 455 455 raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") 456 456 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'. 459 459 raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") 460 460 end … … 492 492 r << "#{ @sec }S" if @sec.nonzero? 493 493 str << l 494 if l.empty?495 str << "0D"496 end497 494 unless r.empty? 498 495 str << "T" << r 496 end 497 if l.empty? and r.empty? 498 str << "0D" 499 499 end 500 500 str trunk/test/soap/test_basetype.rb
r1840 r1919 407 407 "P1Y2M3DT4H5M6S", 408 408 "P1234Y5678M9012DT3456H7890M1234.5678S", 409 "P 0DT3456H7890M1234.5678S",409 "PT3456H7890M1234.5678S", 410 410 "P1234Y5678M9012D", 411 411 "-P1234Y5678M9012DT3456H7890M1234.5678S", … … 419 419 "-P567800000000000M", 420 420 "+P901200000000000D", 421 "P 0DT345600000000000H",422 "-P 0DT789000000000000M",423 "+P 0DT123400000000000.000000000005678S",421 "PT345600000000000H", 422 "-PT789000000000000M", 423 "+PT123400000000000.000000000005678S", 424 424 "P1234YT1234.5678S", 425 425 "-P5678MT7890M", trunk/test/xsd/test_xsd.rb
r1840 r1919 446 446 "P1Y2M3DT4H5M6S", 447 447 "P1234Y5678M9012DT3456H7890M1234.5678S", 448 "P 0DT3456H7890M1234.5678S",448 "PT3456H7890M1234.5678S", 449 449 "P1234Y5678M9012D", 450 450 "-P1234Y5678M9012DT3456H7890M1234.5678S", … … 458 458 "-P567800000000000M", 459 459 "+P901200000000000D", 460 "P 0DT345600000000000H",461 "-P 0DT789000000000000M",462 "+P 0DT123400000000000.000000000005678S",460 "PT345600000000000H", 461 "-PT789000000000000M", 462 "+PT123400000000000.000000000005678S", 463 463 "P1234YT1234.5678S", 464 464 "-P5678MT7890M", 465 465 "+P9012DT3456H", 466 "PT5S", 466 467 ] 467 468 targets.each do |str|