Reputation: 41
I am attempting to find out why this xml document will not validate. I am new to this, but it all looks good. I am attemtping to validate it at http://www.validome.org/grammar/validate/ my xml document named contacts1.xml looks like this...
<?xml version=”1.0”?>
<!DOCTYPE contacts SYSTEM “contacts1.dtd”>
<contacts>
<contact>
<name>
<first>Jeff</first>
<middle>Craig</middle>
<last>Rafter</last>
</name>
<location>
<latitude>34.031892</latitude>
<longitude>-117.207642</longitude>
</location>
<phone>001-909-555-1212</phone>
<knows>David Hunter, Danny Ayers</knows>
<description>Jeff is a developer and author for Beginning XML <em>4th
edition</em>.<br/>Jeff <strong>loves</strong> XML!</description>
</contact>
</contacts>
my DTD document named contacts1.dtd looks like this...
<!ELEMENT contacts (contact)>
<!ELEMENT contact (name, location, phone, knows, description)>
<!ELEMENT name (first, middle, last)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT middle (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT location (address | (latitude, longitude))>
<!ELEMENT address (#PCDATA)>
<!ELEMENT latitude (#PCDATA)>
<!ELEMENT longitude (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT knows (#PCDATA)>
<!ELEMENT description (#PCDATA | em | strong | br)*>
<!ELEMENT em (#PCDATA)>
<!ELEMENT strong (#PCDATA)>
<!ELEMENT br EMPTY>
The error message I get from the validator says
Value following "version" within text declaration must be a quoted string.
Can someone please tell me what the problem is, it all appears to be typed in correctly
Upvotes: 0
Views: 527
Reputation: 99993
You have some rather fancy quotation marks on the first line which are not permitted. Use plain-old-ASCII (ISO-646) single or double quotes.
Upvotes: 2