Page 1 of 1

Go ahead! Criticize my XML! :)

Posted: Mon Apr 22, 2002 5:39 am
by Brian
Constructively, that is. :)

I am working on an XML file format for Monthly Calendars. As is often the case with the technologies we use for web development, there are a few different ways to do things. For example, I might change the empty "date" elements from "<date></date>" to "<date/>" and I might even change them to the names of the days of the week; I have not yet decided.

Would anyone care to comment about any aspect of this file/file format? Have you learned anything of particular interest while working with something similar? Perhaps you are feeling a bit down and you would feel better after criticizing my DTD? :)

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- This is just one idea for a single-month XML calendar file. -->

<!-- Hmm... should I call the root element "month", "calendar", or "monthly_calendar"? -->
<!-- If I call it "calendar" or "monthly_calendar", I can store the name of the month in a "month" element. -->
<!-- If I call it "month", I will need to store the name of the month in a "name" element. -->

<!-- I might want to use day names instead of seven "date" elements within "week" elements. -->

<!DOCTYPE monthly_calendar &#1111;
  <!ELEMENT monthly_calendar (month, year, week)>
  <!ELEMENT month (#PCDATA)>
  <!ELEMENT year (#PCDATA)>
  <!ELEMENT week (date)>
  <!ELEMENT date (#PCDATA)>
]>

<monthly_calendar>

  <month>May</month>

  <year>2002</year>

  <week>
    <date></date>
    <date></date>
    <date></date>
    <date>1</date>
    <date>2</date>
    <date>3</date>
    <date>4</date>
  </week>

  <week>
    <date>5</date>
    <date>6</date>
    <date>7</date>
    <date>8</date>
    <date>9</date>
    <date>10</date>
    <date>11</date>
  </week>

  <week>
    <date>12</date>
    <date>13</date>
    <date>14</date>
    <date>15</date>
    <date>16</date>
    <date>17</date>
    <date>18</date>
  </week>

  <week>
    <date>19</date>
    <date>20</date>
    <date>21</date>
    <date>22</date>
    <date>23</date>
    <date>24</date>
    <date>25</date>
  </week>

  <week>
    <date>26</date>
    <date>27</date>
    <date>28</date>
    <date>29</date>
    <date>30</date>
    <date>31</date>
    <date></date>
  </week>

</monthly_calendar>

Posted: Mon Apr 22, 2002 6:36 am
by jason
Obviously, you should be able to see my reasons for doing this, it is much more compact, and tells the information needed. Changed month from the name of the month to the number, that way you have support for whatever language.

Also, included events, as they would be important. Also, days are simply the number of days, and first_day in fact could be taken out because you could program into the system just to determine what they starting day is. Heck, PHP can do that given a month and a year.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!-- snip -->

<calendar> 
	<calendar_year>
		<year>2002</year>
		<calendar_month>
			<month>5</month>
	  		<days>31</days>
			<first_day>Wednesday<first_day>
	  		<events>
				<event>
					<day>5</day>
					<name>Cinco de Mayo</name>
					<type>Holiday</type>
				<event>
				<event>
					<day>21</day>
					<name>Bob's Birthday</name>
					<type>Birthday</type>
				</event>
			</events>
		</calendar_month>
	</calendar_year>
</calendary>

<!-- snip -->

Interesting...

Posted: Mon Apr 22, 2002 7:25 am
by Brian
That is an interesting point about specifying the starting day rather than including lots of separate date elements. I have already considered something similar to that, actually, except with the purpose of eliminating empty elements rather than most date elements, as I recall. I have a note about that in one of my notebooks. :)

That is a good point about events. I was thinking about including them as attributes to dates, so I could highlight holidays and such, but making them elements would certainly allow me to keep track of more information in case I decide to do that at some point.

Thank you for the suggestions. :)

Why did you choose XML ?

Posted: Thu Jul 04, 2002 8:40 pm
by ajaypatil
Hi,

I think having events makes sense, and having the list of
attendees/resources for an event would also make sense.

Also, the calendar should have some context that declares what
the calendar is for. i.e whether the calendar is for a person's
schedule, or whether it is for conference schedule, or for
booking schedule of certain equipments..

BTW why did you choose XML and how do you think this
XML format will be used in various calendar applications ?

Ajay

My Intended Calendar Application

Posted: Sun Jul 07, 2002 1:46 am
by Brian
My calendar application was simple: to keep track of the days in a month. It was not intended to be a scheduling system, although I have considered making such a companion system.

I chose XML because it is so portable. By generating and returning XML, one application can serve data to other applications very easily.

Posted: Tue Jul 09, 2002 8:27 pm
by ajaypatil
Dear Brian,

OK, here's my criticism, please dont take it as negative expression.

Your XML contains the days in the month. Arent the days in a month
already stored on every computer's operating system and readily
available to almost all applications through the standard functions
in programming languages.

So, why would one application ever ask another application for
the days in a month ?

So, unless there are events in your calendar, there is really
no information inside the XML, or any information that needs to
be exchanged.

I am quite willing to be shown that I am wrong in my above thinking.

Ajay

Ugh.

Posted: Fri Aug 02, 2002 12:57 am
by Brian
There is only so much I can say about a message I posted so long ago, but I will say this: although every computer has the date and time available somehow, it is not available within every application. Some applications must ask other applications for it. Even with the date, though, they must do some calculation to generate a calendar. The idea is to have one application that just generates the calendars for other applications then provides them nearly ready to use in XML format. Events could be added, of course, if they are desired.