OK here's the XML Schema for TV Shows (I used XML Schema instead of DTD, since it's the 'latest thing' and supercedes DTD).
Using this, with fancy XML editors, you can ensure a TV Show NFO file conforms to the rules, and in theory, 3rd party NFO editors can use Schema based forms editor to edit the elements (fill in the NFO).
In practice, it's not that simple... because GUI designers want a pretty UI, not some boring forms interface, and so they start making hard coded assumptions on the elements available etc.
Either way, using XML Schema would/should be the best way to document the NFO structure.... because it allows the 'rules' to be clearly stated...i.e. CAN you have multiple director elements or not?... what is the maximum season number supported? etc etc
One thing that MUST be said of XML.... the folks who promoted XML as 'readable' and 'efficient' where clearly wrong. It's actually a little messy to read, and in no way efficient! but still... that's another story.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="multiepisode">
<xs:complexType>
<xs:sequence>
<xs:element name="episodedetails" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="fileinfo" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="lastupdate" minOccurs="1" maxOccurs="1"
type="xs:date"/>
<xs:element name="version" minOccurs="0" maxOccurs="1"
type="xs:integer"/>
<xs:element name="streamdetails" minOccurs="0" maxOccurs="1"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="title" minOccurs="1" maxOccurs="1" type="xs:string"/>
<xs:element name="season" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="episode" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="rating" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="plot" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="thumb" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="watched" minOccurs="0" maxOccurs="1" type="xs:boolean"/>
<xs:element name="credits" minOccurs="0" maxOccurs="1" type="xs:string"/>
<xs:element name="director" minOccurs="0" maxOccurs="unbounded"
type="xs:string"/>
<xs:element name="aired" maxOccurs="1" minOccurs="0" type="xs:date"/>
<xs:element name="actor" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" minOccurs="1" maxOccurs="1"
type="xs:string"/>
<xs:element name="role" minOccurs="0" maxOccurs="unbounded"
type="xs:string"/>
<xs:element name="thumb" minOccurs="0" maxOccurs="1"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>