homepage Welcome to WebmasterWorld Guest from 23.23.22.200
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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
rbutler




msg:4279458
 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"
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

 

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