This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Problem with schema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem with schema" Watch "Problem with schema" New topic
Author

Problem with schema

Raja Kannappan
Ranch Hand

Joined: May 08, 2002
Posts: 83
I currently have a XML schema file which is working good. It has a root
node called BT. I'm trying to add a node above it (which will become
the root node) called BTS, which can have multiple BT elements (one or
more) inside it.

So, I tried doing this:

<xs:element name="BTS" type="TypeBTS"/>

<xs:complexType name="TypeBTS">
<xs:sequence>
<xs:element name="BT" type="TypeBT"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="TypeBT">
.......... <!-- Big element with multiple elements inside it-->
.......... <!-- This part works fine-->
</xs:complexType>

My XML file looks like this:

<BTS>
<BT>
...
...
</BT>
</BTS>

When I try to validate this, I'm getting this error:
Cannot find the declaration of element 'BTS'.

Does anyone have any ideas on where I'm going wrong? I would really
appreciate your help.

Thanks,

- Raja.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

The type attribute requires fully qualified name to be specified i.e. with prefix.


Groovy
Raja Kannappan
Ranch Hand

Joined: May 08, 2002
Posts: 83
What do you mean by fully qualified name? They are in a single file. Can you explain it? I'm new to XML Schema.

Thanks,

- Raja.

[ October 26, 2005: Message edited by: Raja Kannappan ]
[ October 26, 2005: Message edited by: Raja Kannappan ]
 
wood burning stoves
 
subject: Problem with schema
 
Similar Threads
servlets and xml
mixed content using schema
problem with schemas
root element to wrap all the complexType elements
How to implement getElementById() with Xerces using XML Schema?