4 Replies - 3058 Views - Last Post: 28 July 2010 - 02:23 PM

#1 thursdayniac  Icon User is offline

  • D.I.C Regular

Reputation: 6
  • View blog
  • Posts: 255
  • Joined: 26-April 09

XML Validation Error

Posted 28 July 2010 - 10:44 AM

Mods - Feel free to move this to wherever

I keep getting this error for my XML string:

Reason: The node is neither valid nor invalid because no DTD/Schema declaration was found.
Line: 22
Position: 11

But I cant figure out what it's talking about... everything looks OK to me. Can anyone help?

Here is the exact XML string:

Quote

<?xml version="1.0" encoding="utf-16"?>
<friends xmlns="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd">
<person>
<userID>1001</userID>
<firstName>Bill</firstName>
<lastName>Gates</lastName>
<fileAs>Gates, Bill</fileAs>
<company>Polycom</company>
<title>Software Engineer</title>
<emailAddress>bill.gates@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=bill.gates@polycom.com</webProfilePage>
<phone>512-235-4577</phone>
<workPhone>234-456-5677</workPhone>
</person>
<person>
<userID>1002</userID>
<firstName>Steve</firstName>
<lastName>Jobs</lastName>
<fileAs>Jobs, Steve</fileAs>
<company>Polycom</company>
<title>Software Engineer</title>
<emailAddress>steve.jobs@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=steve.jobs@polycom.com</webProfilePage>
<phone>512-345-2345</phone>
<workPhone>512-234-1234</workPhone>
</person>
<person>
<userID>1003</userID>
<firstName>Linus</firstName>
<lastName>Torvalds</lastName>
<fileAs>Torvalds, Linus</fileAs>
<company>Polycom</company>
<title>Software Engineer</title>
<emailAddress>linus.torvalds@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=linus.torvalds@polycom.com</webProfilePage>
<phone>234-456-6789</phone>
<workPhone>345-456-7567</workPhone>
</person>
<person>
<userID>1004</userID>
<firstName>Nikola</firstName>
<lastName>Tesla</lastName>
<fileAs>Tesla, Nikola</fileAs>
<company>Polycom</company>
<title>Electrical Engineer</title>
<emailAddress>nikola.tesla@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=nikola.tesla@polycom.com</webProfilePage>
<phone>456-345-4564</phone>
<workPhone>234-456-2343</workPhone>
</person>
<person>
<userID>1005</userID>
<firstName>Barack</firstName>
<lastName>Obama</lastName>
<fileAs>Obama, Barack</fileAs>
<company>Polycom</company>
<title>President</title>
<emailAddress>barack.obama@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=barack.obama@polycom.com</webProfilePage>
<phone>234-345-4566</phone>
<workPhone>234-345-4577</workPhone>
</person>
<person>
<userID>1006</userID>
<firstName>James</firstName>
<lastName>Bond</lastName>
<fileAs>Bond, James</fileAs>
<company>Polycom</company>
<title>Secret Agent</title>
<emailAddress>james.bond@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=james.bond@polycom.com</webProfilePage>
<phone>456-567-2344</phone>
<workPhone>234-345-4566</workPhone>
</person>
<person>
<userID>1007</userID>
<firstName>Billy</firstName>
<lastName>Mays</lastName>
<fileAs>Mays, Billy</fileAs>
<company>Polycom</company>
<title>Sales</title>
<emailAddress>billy.mays@polycom.com</emailAddress>
<webProfilePage>http://mtuckerguestbook.cloudapp.net/View.aspx?User=billy.mays@polycom.com</webProfilePage>
<phone>234-345-4565</phone>
<workPhone>233-453-4673</workPhone>
</person>
</friends>


Is This A Good Question/Topic? 0
  • +

Replies To: XML Validation Error

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5833
  • View blog
  • Posts: 12,687
  • Joined: 16-October 07

Re: XML Validation Error

Posted 28 July 2010 - 11:01 AM

It passed this puppy: http://validator.w3....lidate_by_input

That schema you're validating against seems fine: http://msdn.microsof...y/ff759403.aspx

The only thing I can think of is that you're trying to validate against a different schema.
Was This Post Helpful? 2
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,238
  • Joined: 08-June 10

Re: XML Validation Error

Posted 28 July 2010 - 11:09 AM

an XSD is referenced a bit differently

<root
    xmlns="http://www.w3schools.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3schools.com note.xsd"
>

Was This Post Helpful? 2
  • +
  • -

#4 thursdayniac  Icon User is offline

  • D.I.C Regular

Reputation: 6
  • View blog
  • Posts: 255
  • Joined: 26-April 09

Re: XML Validation Error

Posted 28 July 2010 - 11:24 AM

View Postbaavgai, on 28 July 2010 - 10:01 AM, said:

It passed this puppy: http://validator.w3....lidate_by_input

That schema you're validating against seems fine: http://msdn.microsof...y/ff759403.aspx

The only thing I can think of is that you're trying to validate against a different schema.


Ha I know that's why its driving me crazy.


Dormilich - Do I need to add what you wrote to the string?
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,238
  • Joined: 08-June 10

Re: XML Validation Error

Posted 28 July 2010 - 02:23 PM

that was only an example of how to reference an XSD. full ref.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1