Jump to content

Understanding errors in XML


Recommended Posts

Hi everyone,

 

I'm a beginner in XML and I'm still learning the basics. I need to find how many errors are in the following XML document:

  1. <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
  2. <!DOCTYPE université [ <!ELEMENT université (faculté*,description*)*>
  3. <!ELEMENT faculté (département*)> <!ELEMENT département EMPTY>
  4. <!ATTLIST département nom CDATA #REQUIRED xmlnote (vide|plein) "plein">
  5. <!ATTLIST université téléphone ID #REQUIRED> ]>
  6. <université téléphone="514-4321" xml:lang="fr"> <description>La plus grande.</description>
  7. <faculté nom="sciences"> <département nom="mathématiques"></département>
  8. <département nom="sociologie" xmlnote="vide"/> </faculté> </université>
Eclipse flagged the following errors:
  • Attribute "nom" must be declared for element type "faculté". (line 7)
  • Attribute "xml:lang" must be declared for element type "université". (line 6)
  • Attribute value "514-4321" of type ID must be a name. (line 6)

 

Could someone kindly explain those errors and what I did wrong? Is it possible that more errors than the ones Eclipse flagged are in the file? What validation tools do you guys use?

 

Thank you very much in advance!

Edited by stanman109
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...