Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2013, 09:02 AM
Registered User
 
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
 
Old June 10th, 2013, 04:04 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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/
The Following User Says Thank You to joefawcett For This Useful Post:
Tinnin (June 10th, 2013)
 
Old June 10th, 2013, 01:22 PM
Registered User
 
Join Date: Jun 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the quick response Joe.
 
Old July 20th, 2013, 11:41 AM
Chi Chi is offline
Registered User
 
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..
 
Old July 22nd, 2013, 08:47 AM
Registered User
 
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.
 
Old June 26th, 2014, 12:44 AM
Registered User
 
Join Date: Jun 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mucuslesss

Mucuslesss





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Parse Error - OBJECT REQUIRED?!? kevorkian XML 3 November 29th, 2007 02: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 12:21 PM
parse error xml load document asp.net academics2006 ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2006 03:21 PM
about XML receive ang XML parse by tomcat taianmhzy Apache Tomcat 0 May 20th, 2004 01:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.