Save as XML format

Comments on existing version & Suggestions for future versions. If you want a new feature suggest it here. Discussions about beta versions also come in this section.
Post Reply
Willspo
Posts: 61
Joined: 2002-08-14 15:50:23

Save as XML format

Post 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
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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 "|".
Twink
Posts: 92
Joined: 2002-08-01 01:40:12

Post 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.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
zion
Posts: 19
Joined: 2002-05-30 14:35:24
Location: Nivelles, Belgium

Post 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:
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

;)
Ok I'll provide this possibility in the next version
Post Reply