*bump* Dmitry, did you have a chance to review this patch yet?
- David On 22.06.2009, at 15:21, David Zülke wrote:
Hi folks,attached is a patch (with the respective test cases) that implements DateTime marshalling from and to xsd:dateTime in ext/soap as requested in http://bugs.php.net/44383Right now, it is implemented for xsd:date, xsd:time and xsd:dateTime, but not for other types defined in W3C XML Schema such as gDayMonth; I don't really think it makes sense mapping from and to DateTimes in this case (from DateTime to gDayMonth would work, but the other way round would prove rather difficult).Some notes about this patch:- it conforms strictly to the XML Schema specification by only producing canonical representations of values when generating xsd:dateTime and xsd:time values. Specifically: - it will not generate trailing zeroes on microseconds (in other words, it simply generates a fractional second part as mandated by the specification), but it will accept such values - UTC is always used as the timezone (one of the tests in ext/date/ tests that mirrors SBR1-echoDate from http://www.w3.org/TR/2007/REC-soap12-testcollection-20070427/#SBR1-echoDate currently does this wrong), but it will accept any timezone- xsd:time produces current date when generating a DateTime object - xsd:date is relatively straightfoward as well: - produces "00:00:00" as the time when creating a DateTime object - accepts any time when parsing - also supports timezones- as a side effect of the patch, microseconds are now supported in time values (for xsd:time and xsd:dateTime), hence the removed comment in to_xml_timeThe tests have several permutations, but all but one is commented out each. The test_schema() function does some odd (but understandable) stunts with output buffering and global variables that make it impossible to test more than one case at a time. We didn't want to produce a million test files for the several variants; is there a nicer way to test this properly?This feature is enabled by a SoapClient "feature" called SOAP_MARSHAL_DATETIME. I think this is a reasonable choice.Greetings, David< schema089 .phpt > < soap_marshal_datatype .diff .txt > < schema087 .phpt><schema088.phpt><schema086.phpt><schema090.phpt><schema091.phpt>
smime.p7s
Description: S/MIME cryptographic signature