homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

Declaration error on root level when applying namespace prefix

Msg#: 4279456 posted 8:40 am on Mar 10, 2011 (gmt 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!



Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved