Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Declaration error on root level when applying namespace prefix

8:40 am on Mar 10, 2011 (gmt 0)

New User

5+ Year Member

joined:Mar 10, 2011
posts: 1
votes: 0

I get a constant 'Declaration' error when using namespace prefix and validating the xml file. Tried it with netbeans
Cannot find the declaration of element 'c:camera'
and xmllint
element camera: Schemas validity error : Element '{http://www.camera.org}camera': No matching global declaration available for the validation root.
. I think I didn't understand the concept. But on the other hand this is an example out of the Internet and is similar to many other examples out there.

camera.xml [pastebin.com ]:
<?xml version="1.0"?>
<c:camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=". camera.xsd">
Ergonomically designed casing for easy handling
<c:speed>1/10,000 sec to 100 sec</c:speed>

camera.xsd [pastebin.com ]:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="camera">
<xsd:element name="body"/>
<xsd:element name="lens"/>
<xsd:element name="manual_adapter"/>

I understand that in this case namespace prefix is not required but I want to understand why it is not working.

Your help is very much appreciated!