473,804 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Infinetely stupid question

I am really sorry if this sounds stupid. Namespace is just not my cup
of tea.

Could anybody tell me what is wrong with this xsd file (It has
something wrong with the namespaces)

I am getting the error "The element 'Books' is used but not declared in
the DTD/Schema."

If I remove targetNamespace ="http://calendar/aiman" and
xmlns:myns="htt p://calendar/aiman" and change type="myns:Book Type" to
type="BookType" it works.

-------------------------------------------------

<?xml version="1.0"?>
<xsd:schema
targetNamespace ="http://calendar/aiman"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:myns="htt p://calendar/aiman"
elementFormDefa ult="qualified" >

<xsd:element name="Books">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="Book" type="myns:Book Type" minOccurs="1"
maxOccurs="unbo unded"/>
</xsd:sequence>
</xsd:complexType >
</xsd:element>

<xsd:complexTyp e name="BookType" >
<xsd:sequence >
<xsd:element name="Name" type="xsd:strin g" minOccurs="1"/>
<xsd:element name="Author" type="xsd:strin g" minOccurs="1"/>
<xsd:element name="Award" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="Price" minOccurs="1">
<xsd:simpleType >
<xsd:restrictio n base="xsd:integ er">
<xsd:minInclusi ve value="0"/>
<xsd:maxInclusi ve value="5000"/>
</xsd:restriction >
</xsd:simpleType>
</xsd:element>
<xsd:element name="Descripti on" minOccurs="0" maxOccurs="1">
<xsd:simpleType >
<xsd:restrictio n base="xsd:strin g">
<xsd:maxLengt h value="50"/>
</xsd:restriction >
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
<xsd:attribut e name="id" type="xsd:integ er" use="required"/>
</xsd:complexType >
</xsd:schema>

------------------------------------------------------------------

If u help me solve this , i'll bless u with my infinte stupidity/wisdom
;)

May 22 '06 #1
2 1118
The schema looks valid. Probably you validate an instance document
against this schema. When you have a target namespace set on a schema
then when you declare a global element like Books in your case then
that is a declaration for an element in the schema target namespace. So
in your instance document you need to place that element in the
appropriate namespace. From your description it seems you are placing
it in no namespace so instead of
<Books>

you should have

<Books xmlns="http://calendar/aiman">

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

May 22 '06 #2

George Bina wrote:
The schema looks valid. Probably you validate an instance document
against this schema. When you have a target namespace set on a schema
then when you declare a global element like Books in your case then
that is a declaration for an element in the schema target namespace. So
in your instance document you need to place that element in the
appropriate namespace. From your description it seems you are placing
it in no namespace so instead of
<Books>

you should have

<Books xmlns="http://calendar/aiman">

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Thanks!!!! that worked.

May 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

119
4643
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see, http://www.alistapart.com/articles/betterliving/ I read on http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/netfxcompat.asp It said they changed stuff like this
98
2759
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see, http://www.alistapart.com/articles/betterliving/ I read on http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/netfxcompat.asp It said they changed stuff like this
6
1620
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no stupid question. Is that another for political correctness I am attempting an install of 7.4.3 on FreeBSD O/S 4.9, apparently remnants of 7.3.x are scattered around on the disk from (a) previous ports installation, causing mutex_lock/unlock,...
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.