0

Given the DTD file below :

!ELEMENT hotels (address+)>
<!ELEMENT address (city,street,phone,hotelDetails)>
<!ELEMENT hotelDetails (hotel_code,hotel_rank,hotel_name)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT hotel_rank (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT hotel_code (#PCDATA)>
<!ELEMENT hotel_name (#PCDATA)>

<!ELEMENT guests (id+)>
<!ELEMENT guestDetails (name,city,address,state)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT state (#PCDATA)>

As you can see, I have two different tables : hotels & guests , where both tables has a column of city . When I try to save the file in XMLspy I get :

Element 'city' has already been declared.

Is there a way to declare that field for both tables ?

Regards

Ron

JAN
  • 21,236
  • 66
  • 181
  • 318

1 Answers1

3

You need this element only once. It may be referenced from both address and guestDetails.

jpstrube
  • 785
  • 1
  • 11
  • 27