[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML DTD update proposition



Hi !

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.

With the following dtd, the rule would be :
<rrule freq="yearly" count="5">
	<byday ordwk="1" > MO</byday>
</rule>

So you can get directy the frequency, count and day list
from your xml parser without having to parse any string yourself.

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>

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


Best regards

Philippe Lesage