Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Beginning XML, 5th edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning XML, 5th edition
This is the forum to discuss the Wrox book Beginning XML 5th Edition by Joe Fawcett, Danny Ayers, Liam R. E. Quin; ISBN: 978-1-1181-6213-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML, 5th edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 9th, 2013, 09:02 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default contacts6.xml parse error

(Opened in Firefox)

XML Parsing Error: no element found
Location: file:///home/Programming/XML/XML%20Downloaded%20Scripts/Chapter%205/contacts6.xml
Line Number 35, Column 1:

I've been working my way through this book and have come up against this problem. I thought I was making an error so downloaded the original script but it is just the same.

It seems to be the line:

<contacts source="Beginning XML 5E" version="1.0">

that is causing the problem.

When I remove it and inlcude these attributes in the root "contacts" it works fine.

Why is it not working as stated in the book?

Thanks

"Beginning XML 5th Edition" - Ch5
Reply With Quote
  #2 (permalink)  
Old June 10th, 2013, 04:04 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Although I didn't author that chapter I think you are right, the XML is incorrect. The second 'contacts' element needs removing altogether and the attributes moving to the root as you said:
Code:
<?xml version="1.0"?>
<contacts source="Beginning XML 5E" version="1.0"
  xmlns="http://www.example.com/contacts"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.example.com/contacts contacts6.xsd">
  <contact person="Joe_Fawcett" tags="author xml poetry">
    <name>
      <first>Joseph</first>
      <first>John</first>
      <last>Fawcett</last>
    </name>
    <location>
      <address>Exeter, UK</address>
      <latitude>50.7218</latitude>
      <longitude>-3.533617</longitude>
    </location>
    <phone kind="Home">001-234-567-8910</phone>
    <knows contacts="John_Doe Danny_Ayers"/>
        <description>Joseph is a developer and author for Beginning XML <em>5th edition</em>.<br/>Joseph <strong>loves</strong> XML!</description>
  </contact>
  <contact person="Liam_Quin" tags="author consultant w3c">
    <name>
      <first>Liam</first>
      <last>Quin</last>
    </name>
    <location>
      <address>Ontario, Canada</address>
    </location>
    <phone>+1 613 476 8769</phone>
    <knows/>
    <description>XML Activity Lead at W3C</description>
  </contact>
</contacts>
__________________
Joe
http://joe.fawcett.name/
Reply With Quote
The Following User Says Thank You to joefawcett For This Useful Post:
Tinnin (June 10th, 2013)
  #3 (permalink)  
Old June 10th, 2013, 01:22 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the quick response Joe.
Reply With Quote
  #4 (permalink)  
Old July 20th, 2013, 11:41 AM
Chi Chi is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Validation in that Chapter:
contacts9.xml --> contacts6.xsd
contacts10.xml --> contacts7.xsd
contacts11.xml --> contacts8.xsd
contacts12.xml --> contacts9.xsd

contacts9.xml and contacts10.xml are validated right away. contacts8.xsd and contacts9.xsd need modifying as indicated in the book to successfully validate contacts11.xml and contacts12.xml, respectively.

You could ignore contacts6.xml if you like or do what Joe suggested.

Hope this helps.

Last edited by Chi; July 20th, 2013 at 11:51 AM.
Reply With Quote
  #5 (permalink)  
Old July 22nd, 2013, 08:47 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks Chi. I've noticed a few things that are a bit off like this but nothing major. All in all it's been a very useful book for me.
Reply With Quote
  #6 (permalink)  
Old June 26th, 2014, 12:44 AM
Registered User
Points: 4, Level: 1
Points: 4, Level: 1 Points: 4, Level: 1 Points: 4, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mucuslesss

Mucuslesss
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Parse Error - OBJECT REQUIRED?!? kevorkian XML 3 November 29th, 2007 01:53 PM
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 11:21 AM
parse error xml load document asp.net academics2006 ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2006 02:21 PM
about XML receive ang XML parse by tomcat taianmhzy Apache Tomcat 0 May 20th, 2004 01:56 AM



All times are GMT -4. The time now is 05:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.