p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning XML 3rd Edition (http://p2p.wrox.com/forumdisplay.php?f=149)
-   -   Error in "Try It Out", pages 149-150 (http://p2p.wrox.com/showthread.php?t=64656)

pfloyd December 18th, 2007 10:53 AM

Error in "Try It Out", pages 149-150
 
I'm working on the Chapter 5 "Try It Out" on pages 149-50, and keep getting the same error when I try to validate the xml file in Codeplot, though I've checked what I've written against what's in the book, and it seems to match. The error I'm getting is:

[Error] Document is invalid: no grammar found. Line 2, Column 6
[Error] Document root element "name", must match DOCTYPE root "null". Line 2, Column 6

Do you know why I'm getting this? The text of the xml doc I'm validating is:

<?xml version="1.0"?>
<name
   xmlns="http://www.example.com/name"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.example.com/name name5.xsd"
   title="Mr.">
      <first>John</first>
      <middle>Fitzgerald Johansen</middle>
      <last>Doe</last>
</name>

And the text of the .xsd file is:

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:target="http://www.example.com/name"
targetNamespace="http://www.example.com/name" elementFormDefault="qualified">
   <element name="name">
      <complexType>
         <sequence>
            <element name="first" type="string"/>
            <element name="middle" type="string"/>
            <element name="last" type="string"/>
         </sequence>
         <attribute name="title" type="string"/>
      </complexType>
   </element>
</schema>

Thanks,
Peter Floyd
pfloyd@asp.md



All times are GMT -4. The time now is 10:30 AM.

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