Page 1 of 1

Save as XML format

Posted: 2002-11-12 12:19:49
by Willspo
Hey

I have a suggestion for the save as XML format. In the current format all the datafields are stored as attributes of the movie element.

Code: Select all

<Movie Number="" Actors="" Description="" ...>
I think it would be a lot better if all datafields where separate child elements of a movie element.
It's not that it's anything wrong with your XML. I just think the structure makes it hard to read and also more important to do XSL transforms for.

I would suggest something like this:

Code: Select all

<movie>
  <actors></actors>
  <description></description>
   ...
</movie>
This structure would probably also be better prepared for future versions of Movie catalog with custom datafields. For example it would be possible to have unlimited number of extra datafields and also an internal structure amongst them. For example:

Code: Select all

<comments>
   <comment>...</comment>
   <comment>...</comment>
</comments>
I'm not complaining it's just an idea. :grinking:

/w

Posted: 2002-11-12 13:01:50
by antp
I use attributes instead of child tags because it is faster to load/save (at least with the parser that I use)
I will maybe change that in the future versions, I do not know yet.
I may use CDATA for fields such as Comments (that have multiple lines). For the moment I simply replace linebreaks by the character "|".

Posted: 2002-11-12 21:53:53
by Twink
there must be a better way then using "|" for line breaks, makes my template look weird. Although I could just add a line that replaced them I guess.

Posted: 2002-11-12 22:30:55
by antp
Only other way is using CDATA blocks, and it was not available in the parser I use, until few weeks.
So for version 4 I will probably use that.
But I haven't started all this customizable fields thing yet, so I do not know yet how I'll manager all these things.

Posted: 2002-11-13 00:51:15
by zion
And as the parser is now faster than before, you can afford the price to use child elements :innocent:

Zion aKa the parser writer :hihi:

Posted: 2002-11-13 08:28:31
by antp
;)
Ok I'll provide this possibility in the next version