plattecoducks
03-23-2009, 04:33 PM
My client conducts events (seminars) in his store after hours. He wants me to keep the schedule up to date. I suggested I knew an easy technology that would work. I want to use an XML file that he can upload to the server when he wants to update the schedule. The file is of the following format:
<events>
<event>
<date>Some date here</date>
<time>Some time here</time>
<remark>Something about the event</remark>
</event>
<!-- etc., etc., etc., -->
</events>
I tested it pretty thoroughly, gave him a lesson on structure of the file and went on about my business. Now he reports to me that the table I set up for the events does not display. I examined the XML file and the first thing I noticed was that the <remark></remark> tag was empty.
I thought about it a while and realized that this could happen in his line of business; that this indeed could be empty, meaning it is open to anyone and no special invitation is required. That the idea of the table.
So I sat down to modify the code and discovered I don't know how to write a suitable test for an empty XML tag. If the tag is empty the javascript code falls down and just exits the routine.
Has anyone ever seen this? What am I missing? What is the value of an empty object pulled from an XML file? Is it Null, undefined or what? Help! This should be a piece of cake for somebody.
<events>
<event>
<date>Some date here</date>
<time>Some time here</time>
<remark>Something about the event</remark>
</event>
<!-- etc., etc., etc., -->
</events>
I tested it pretty thoroughly, gave him a lesson on structure of the file and went on about my business. Now he reports to me that the table I set up for the events does not display. I examined the XML file and the first thing I noticed was that the <remark></remark> tag was empty.
I thought about it a while and realized that this could happen in his line of business; that this indeed could be empty, meaning it is open to anyone and no special invitation is required. That the idea of the table.
So I sat down to modify the code and discovered I don't know how to write a suitable test for an empty XML tag. If the tag is empty the javascript code falls down and just exits the routine.
Has anyone ever seen this? What am I missing? What is the value of an empty object pulled from an XML file? Is it Null, undefined or what? Help! This should be a piece of cake for somebody.