I am just preparing a class on XML and DTDs for tuesday, and wanted to
use the CDindex DTD as example. Unfortunately, I think it is wrong, for
two reasons:
- inconsistent: <!ELEMENT SingleArtistCD (ArtistName, TrackName+)>:
there is no element ArtistName or TrackName in the DTD, neither is there
a MultTrack, or NumTracks
- does not fit example data: only either MultiArtistCD or MultiArtistCd
appear, TOC can appear in top-level? Disk-ID can be empty?
I think the following makes more sense. It seems unfortunate that the
Track/MultiTrack distintions is not used. It is therefore possible not
to have an artist, or to have 'global' and 'local' artists.
My knowledge of DTDs is not very deep, but this makes more sense to me.
Or am I completely off here?
(not sure about the 'IdInfo?', is it really optional?)
<!ELEMENT CDInfo (Title, NumTracks, IdInfo?,
(SingleArtistCD | MultipleArtistCD))>
<!ELEMENT IdInfo (DiskId+)>
<!ELEMENT DiskId (ID | TOC | (ID, TOC))>
<!ELEMENT TOC (Offset+)>
<!ELEMENT SingleArtistCD (Artist, Track+)>
<!ELEMENT MultipleArtistCD (Track+)>
<!ELEMENT Track (Name | (Artist, Name))>
<!ELEMENT Id (#PCDATA)>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Artist (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Offset (#PCDATA)>
<!ELEMENT NumTracks (#PCDATA)>
<!ATTLIST Offset Num NMTOKEN #REQUIRED>
<!ATTLIST Track Num NMTOKEN #REQUIRED>
<!ATTLIST Track Duration NMTOKEN #IMPLIED>
<!ATTLIST TOC First NMTOKEN #IMPLIED
Last NMTOKEN #IMPLIED>
Good luck with the CDIndex project (I wonder if PHP3 or Zend are not
better tools to write the DB interfaces with...)
thorsten
-----------------------------------------------------------------------
\ k
\ e Thorsten Schnier
\ y
/\ \ Key Centre of Design Computing
/ / c University of Sydney
\ / e NSW 2006
\ / n
\/ t thorsten nospam at arch.usyd.edu.au
DESIGN r http://www.arch.usyd.edu.au/~thorsten/
COMPUTING e