Welcome to WebmasterWorld Guest from 54.198.118.102

Forum Moderators: open

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"
xmlns:c="http://www.camera.org"
xsi:schemaLocation=". camera.xsd">
<c:body>
<c:description>
Ergonomically designed casing for easy handling
</c:description>
</c:body>
<c:lens>
<c:zoom>300mm</c:zoom>
<c:f-stop>1.2</c:f-stop>
</c:lens>
<c:manual_adapter>
<c:speed>1/10,000 sec to 100 sec</c:speed>
</c:manual_adapter>
</c:camera>


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


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!

Thanks,
Ralf
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members