XML DTD problem

Post Reply
HairyHarry (imported)
Articles: 0
Posts: 237
Joined: Mon Jul 05, 2004 2:01 pm

Posting Rank

XML DTD problem

Post by HairyHarry (imported) »

! am creating a website with 10 pages, each with its own separate stylesheet, 6 XSL and 4 CSS. It was OK until I try to add images and a table of links. The XML validator informs me of an error on line 21. The CSS validates OK. Here is the code, I am not sure what the attributes of the photo element are. (I've put the <code></code> tags in to stop it activating here)

<code>

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/css" href="trees.css"?>

<!DOCTYPE trees[

<!ELEMENT trees (tree)+>

<!ELEMENT tree (common_name,latin_name,origin,type,flower,fruit,f oliage,size,photo,table,LINK)>

<!ELEMENT common_name (#PCDATA)>

<!ELEMENT latin_name (#PCDATA)>

<!ELEMENT origin (#PCDATA)>

<!ELEMENT type (#PCDATA)>

<!ELEMENT flower (#PCDATA)>

<!ELEMENT fruit (#PCDATA)>

<!ELEMENT foliage (#PCDATA)>

<!ELEMENT size (#PCDATA)>

<!ELEMENT photo (#PCDATA)>

<!ATTLIST photo source CDATA #REQUIRED

a CDATA #REQUIRED

img CDATA #REQUIRED

alt CDATA #IMPLIED>

<!ELEMENT html (#PCDATA)>

<!ATTRIBUTE html xmlns CDATA #REQUIRED Line 21

html CDATA #REQUIRED

img CDATA #REQUIRED>

<!ELEMENT table (tr,th1,th2,td)>

<!ATTLIST table tr CDATA #REQUIRED

a href CDATA #REQUIRED

th1 CDATA #REQUIRED

th2 CDATA #REQUIRED

td CDATA #REQUIRED

a CDATA #REQUIRED>

<!ELEMENT LINK (#PCDATA)>

<!ATTLIST LINK VALUE CDATA #REQUIRED>

]>

<trees>

<tree>

<common_name>Common name:Mountain Ash, Rowan</common_name>

<latin_name>Latin name:Sorbus aucuparia</latin_name>

<origin>Origin:Europe, Asia</origin>

<type>Type:Deciduous</type>

<flower>Flower:pale, insignificant</flower>

<fruit>Fruit:Red berries</fruit>

<foliage>Leaves:Dark green above, blue-green below, turning red in autumn</foliage>

<size>Size:15M height, 7M spread</size>

<photo><html:img xmlns:html="http://www.w3.org/TR/REC-html40"

src="m ash.jpg" alt="Mountain Ash"/></photo>

</tree>

<table>

<tr>

<th1><td>Links to the other pages</td></th1>

</tr>

<tr>

<th2><td><a href="boats.xml">Boats</a></td></th2>

<th2><td><a href="books.xml">Books</a></td></th2>

<th2><td><a href="cars.xml">Cars</a></td></th2>

<th2><td><a href="CDs.xml">CDs</a></td></th2>

<th2><td><a href="countries.xml">Countries</a></td></th2>

</tr>

<tr>

<th2><td><a href="family.xml">Family</a></td></th2>

<th2><td><a href="football.xml">Football</a></td></th2>

<th2><td><a href="houses.xml">Houses</a></td></th2>

<th2><td><a href="tools.xml">Tools</a></td></th2>

<th2><td><a href="trees.xml">Trees</a></td></th2>

</tr>

</table>

</trees></code>

Can you point me in the right direction, please.
Paolo
Articles: 0
Posts: 9709
Joined: Wed May 16, 2001 8:53 am

Posting Rank

Re: XML DTD problem

Post by Paolo »

Keep in mind that the use of the ":" character with some letters triggers smilies to pop up.
HairyHarry (imported)
Articles: 0
Posts: 237
Joined: Mon Jul 05, 2004 2:01 pm

Posting Rank

Re: XML DTD problem

Post by HairyHarry (imported) »

Good point, Paolo, I hadn't seen that happen before, but I'll change a bit of the text.
Post Reply

Return to “Archive Technical Help”