jQuery in Action, 2nd edition*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 8919

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with schema