[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] RE: ANN: Portable Data Component -- start/end
- From: Stephen D Green <stephengreenubl@gmail.com>
- To: "Costello, Roger L." <costello@mitre.org>
- Date: Tue, 19 Apr 2011 07:15:43 +0100
Who is at fault?
Well nowadays it is the responsibility of software developers to
write software which prevents the input of invalid values so the
person is either using weakly written software in which case the
usual practice is to blame the software developer(s) or business
analyst(s) for not catching this error, or if the person is writing
the XML by hand then they should have ensured they knew the
schema first or used software which was written according to it.
----
Stephen D Green
On 18 April 2011 19:18, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Folks,
>
> Suppose that a person records the start time and end time of a movie, which starts at 11pm and ends at 1am the next day:
>
> <movie>
> <start>23:00:00</start>
> <end>01:00:00</end>
> </movie>
>
> Validating that against the portable start/end data component (see below) results in this error: "movie does not match the assertion".
>
> Had the movie times been specified using dateTime:
>
> <movie>
> <start>2011-04-16T23:00:00</start>
> <end>2011-04-17T01:00:00</end>
> </movie>
>
> then there would be no error.
>
> QUESTION
>
> Who's at fault?
>
> - The person who specified the movie times using just time values?
> - Or, the portable start/end data component for throwing an error on perfectly good movie times?
>
> /Roger
>
> P.S. Here's the portable start/end data component:
>
> <xs:complexType name="start-end-date-time">
> <xs:sequence>
> <xs:element name="start">
> <xs:simpleType>
> <xs:union memberTypes="xs:date xs:time
> xs:dateTime" />
> </xs:simpleType>
> </xs:element>
> <xs:element name="end" minOccurs="0">
> <xs:simpleType>
> <xs:union memberTypes="xs:date xs:time
> xs:dateTime" />
> </xs:simpleType>
> </xs:element>
> </xs:sequence>
> <xs:assert test="
> if (exists(end)) then
> if (start castable as xs:dateTime) then
> xs:dateTime(end) gt xs:dateTime(start)
> else if (start castable as xs:date) then
> xs:date(end) gt xs:date(start)
> else if (start castable as xs:time) then
> xs:time(end) gt xs:time(start)
> else true()
> else true()" />
> </xs:complexType>
>
> Comments welcome.
>
> /Roger
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]