Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  View Answers    Answer this question    Ask a question  
 

dan28
Aug 27, 2009, 11:49 PM
Hi, I'm new to XML and have been struggling. Where have I gone wrong in this bit of code?


<?xml version="1.0" encoding="utf-8"?><!DOCTYPE bibliography [
<!ELEMENT bibliography (book+)>
<!ELEMENT book (author+, title, pub?, year, URL*)>
<!ELEMENT author (
(givenname | nickname)?, surname)>
<!ELEMENT givenname (#PCDATA)>
<!ELEMENT nickname (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT pub (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT URL (#PCDATA)>
]>
<bibliography>
<book>
<author>
<nickname>Fred</nickname>
<surname>Flintstone</surname>
</author>
<author>
<givenname>Helen</givenname>
<surname>James</surname>
</author>
<title>"Statistical Database Disclosure"</title>
<year>2006</year>
<URL>http://some.webaddress.com</URL>
<URL>http://another.webaddress.com</URL>
</book>
<book>
<author>
<surname>Simpson</surname>
</author>
<title>"Homer's Odyssey"</title>
<pub>Springer Verlag</pub>
<year>2003</year>
</book>
</bibliography>

<journal>
<book>
<author>
<givenname>Alf</givenname>
<surname>Turner</surname>
</author>
<author>
<nickname>Roddy</nickname>
<surname>Stewart</surname>
</author>
<title>lifecycles</title>
<pub>lifepublishing</pub>
<year>1999</year>
<URL>http://some.webaddress.com</URL>
</book>
</journal>

I was given up to </bibliography> and had to add journals to it with 2 entries.
Any help would be appreciated.
Thank you

mpolo
Aug 28, 2009, 01:01 AM
<!element url (#pcdata)>
]>
<bibliography>

mpolo
Aug 28, 2009, 01:02 AM
]>

dan28
Aug 28, 2009, 01:38 AM
<!ELEMENT URL (#PCDATA)>
]>

Is that where I've done something wrong?
I checked my code on a xml validator and got 15 errors.

I don't understand what I've done wrong and what it should be.

crigby
Oct 14, 2009, 07:11 AM
Hi,
The term "PCDATA" is a placeholder for info used in your particular document. Try the tutorial and references at:
W3Schools Online Web Tutorials (http://www.w3schools.com/)
Peace,
Clarke