Subject: Re: XML DTD update proposition

From: Michael Krivoruchko <[email-masked]>
Date: Tue, 04 Jan 2000 14:07:48 +0000

Hi All and Happy New Year!

From  my point of view the current DTD has to be *dramaticaly* improved
in two directions:

  1. Data typing and data structure (Philippe, I am with you!).
     Things like 'rrule' or 'DATE-TIME' have internal structure which can
     be explained in XML tags, so we should do this to make the internal
     data structure "visible" from XML level.

  2. DTD should provide more information for a validation XML parser.
     Elements has to have more restrictive (more correct) definition.
     Say, we should not use "(something.opt1)* (something.optm)*", where:
        something.opt1 := (tag1) | (tag2) | ... | (tagN)
     instead we should use "something.opt1 (something.optm)*", where:
        something.opt1 := (tag1)? (tag2)? ... (tagN)?

Philippe Lesage wrote:

>
> I think that the definition of the rrules & exrules elements in the xml dtd
> should be improved. The current definition (P35) is :
> <!ELEMENT rrule (#PCDATA) >
> <!ATTLIST rrule value NOTATION (RECUR) #IMPLIED>
>
> So, a rule looks like :
> <rrule>FREQ=YEARLY;COUNT=5;BYDAY=1MO</rrule>
>
> In this case, a xml parser would give you  back the string
> "FREQ=YEARLY;COUNT=5;BYDAY=1MO" from the xml file, then you would have to
> parse the string yourself to get back frequency, count and day list. I do not
> think this is in the spirit of xml to proceed this way.
>
>

Michael

--
---------------------------------------------------------------
Michael Krivoruchko                 CDE Group, Sun Microsystems
    Bool House, East Point Business Park, Dublin 3, Ireland
Ph: +353 1 819 9272               E-mail: [email-masked]
---------------------------------------------------------------

---

From: Michael Krivoruchko <[email-masked]>
Date: Wed, 05 Jan 2000 15:44:36 +0000

Hi All,

Frank Dawson wrote:

> We don't need two standard calendar formats, if at all possible. This effort is
> definitely not an attempt to define a new calendar format. It is not an effort to
> define a new calendar XML application, based on iCalendar. I think you would agree.
>

We are not creating a new format! Only thing we do is searching an XML
equivalent of RFC2445 data types. It is hard to find out "iCalendar XML"
tools, but there are few "XML aware" applications around. Why not allow
them "to see" iCalendar data?

The following is my version of RECUR data type. It is nearly the same as
Philippe's version but this variant a bit more strict than original:
  1. 'freq' is defined as '#REQUIRED' attribute with a list of possible values
  2. 'until' and 'count' defined as elements
  3. 'weekday' uses a list of possible values
  4. 'by...' rules more "typesafe"

---------------------------------------------------
<!-- TIME -->
<!ELEMENT seconds #PCDATA>  <!-- 0..60 -->
<!ELEMENT minutes #PCDATA>  <!-- 0..59 -->
<!ELEMENT hours #PCDATA>  <!-- 0..23 -->

<!ELEMENT TIME (hours, minutes, seconds)>

<!-- DATE and DATE-TIME -->
<!ENTITY % attr.weekday "MO | TU | WE | TH | FR | SA | SU">

<!ELEMENT monthday #PCDATA>  <!-- (-31..-1) | (1..31) -->
<!ELEMENT yearday #PCDATA>  <!-- (-366..-1) | (1..366) -->
<!ELEMENT weekno #PCDATA>  <!-- (-53..-1) | (1..53) -->
<!ELEMENT monthno #PCDATA>  <!-- 1..12 -->
<!ELEMENT yearno #PCDATA>  <!-- [0-9]{1,4} -->
<!ELEMENT yearpos #PCDATA>  <!-- (-366..-1) | (1..366) -->
<!ELEMENT weekday weekno?>  <!-- "weekno" is day's month or year position -->
<!ATTLIST weekday name (%attr.weekday;) #REQUIRED>

<!ELEMENT DATE (yearno, monthno, monthday)>
<!ELEMENT DATE-TIME (DATE, TIME)>

<!-- RECUR -->
<!ELEMENT until (DATE | DATE-TIME)>
<!ELEMENT count #PCDATA>  <!-- positive intager -->

<!ELEMENT bysecond seconds+>
<!ELEMENT byminute minutes+>
<!ELEMENT byhour hours+>
<!ELEMENT byweekday weekday+>
<!ELEMENT bymonthday monthday+>
<!ELEMENT byyearday yearday+>
<!ELEMENT byweekno weekno+>
<!ELEMENT bymonth monthno+>
<!ELEMENT bysetpos yearpos+>

<!ENTITY % RECUR.time "(bysecond?), (byminute?), (byhour?)">
<!ENTITY % RECUR.date "(byweekday?), (bymonthday?), (byyearday?), (byweekno?), (bymonth?)">
<!ELEMENT RECUR ((until | count)?), (%rrule.time;), (%rrule.date;), (bysetpos?)>

<!ATTLIST RECUR freq (SECONDLY | MINUTELY | HOURLY | DAILY | WEEKLY | MONTHLY | YEARLY) #REQUIRED>
<!ATTLIST RECUR interval #PCDATA "1" #IMPLIED>
<!ATTLIST RECUR wkst (%attr.weekday;) "MO" #IMPLIED>

---------------------------------------------------

Philippe Lesage wrote:

> What do you think about it ?
>
> ---------------------------------------------------
> <!ENTITY % attr.recrule "
>         freq CDATA #IMPLIED
>         until CDATA #IMPLIED
>         count CDATA #IMPLIED
>         wkst CDATA #IMPLIED
>         interval CDATA #IMPLIED ">
>
> <!ENTITY % recrule.opt1 " (bysecond?),(byminute?),(byhour?),(byday?),(bymonthday?),(byyearday?),(byweekno?),(bymonth?),(bysetpos?) ">
>
> <!ELEMENT exrule (%recrule.opt1;) >
> <!ATTLIST exrule
>         %attr.recrule;
>         value NOTATION (RECUR) #IMPLIED>
>
> <!ELEMENT rrule (%recrule.opt1;)>
> <!ATTLIST rrule
>         %attr.recrule;
>         value NOTATION (RECUR) #IMPLIED>
>
> <!ELEMENT bysecond (list+)>
>
> <!ELEMENT byminute (list+)>
>
> <!ELEMENT byhour (list+)>
>
> <!ELEMENT byday (daylist+)>
>
> <!ELEMENT bymonthday (list+)>
>
> <!ELEMENT byyearday (list+)>
>
> <!ELEMENT byweekno (list+)>
>
> <!ELEMENT bymonth (list+)>
>
> <!ELEMENT bysetpos (list+)>
>
> <!ELEMENT list (#PCDATA) >
>
> <!ELEMENT daylist (#PCDATA) >
> <!ATTLIST daylist ordwk CDATA #IMPLIED>
>
> --------------------------------------------------------
>

Michael