Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with schema

 
Raja Kannappan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The type attribute requires fully qualified name to be specified i.e. with prefix.
 
Raja Kannappan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic