Larry wrote:
> I'm quite a XML/XSL/DTD newbie, is this DOCTYPE correct? thanks
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl" href="stile.xsl"?>
> <!DOCTYPE catalog
> [
> <!ELEMENT catalog (cd+)>
> <!ELEMENT cd (title,artist,country,company,price,year)>
> <!ELEMENT title (#PCDATA)>
> <!ELEMENT artist (#PCDATA)>
> <!ELEMENT country (#PCDATA)>
> <!ELEMENT company (#PCDATA)>
> <!ELEMENT price (#PCDATA)>
> <!ELEMENT year (#PCDATA)>
> ]>
>
> <catalog>
> <cd>
> <title>Empire Burlesque</title>
> <artist>Bob Dylan</artist>
> <country>USA</country>
> <company>Columbia</company>
> <price>10.90</price>
> <year>1985</year>
> </cd>
Technically the DTD you have written is fine for the XML instance
document, the DTD is syntatically correct and its semantics models the
structure of the XML instance.
As for modelling a CD list however there might be more complex
scenarios, what happends if there is a CD done by multiple artists for
instance. And what currency is the price value for?
--
Martin Honnen
http://JavaScript.FAQTs.com/