[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
error in DTD with multiple entities
- From: Wendi Sisson <wsisson@east.fedex.com>
- To: xml-dev@lists.xml.org
- Date: Fri, 10 Aug 2001 09:19:39 -0500
I have one DTD that references 2 other DTDs by using entities. The 2
other DTDs are from 3rd party sources and I am not at liberty to change
them. Both the referenced DTDs have an element named "country" and so I
get errors from the parser when I try to parse an XML document that
uses my DTD. The error I'm getting makes sense to me, since using the
entities is like bringing the elements from the other 2 DTDs into my
DTD, and you can't have 2 elements declared with the same name, right?
But since I cannot change the referenced DTDs, I am looking for some
kind of a work-around. Each of these entities is used in isolation from
each other, by a separate root element in the DTD. I am wondering if
there is some way I can isolate the entities or put them in some kind of
scope so they don't conflict with each other? Simplified examples of the
DTD and XML are below, as this is a pretty complicated question. Thanks
in advance for any help or pointers you may be able to give me. Wendi
******************
wrapper.dtd
******************
<?xml version="1.0" encoding='UTF-8'?>
<!ENTITY % tx1 SYSTEM "tx1.dtd">
%tx1;
<!ENTITY % tx2 SYSTEM "tx2.dtd">
%tx2;
<!ELEMENT tx1Root (commonData1,commonData2,tx1)>
<!ELEMENT tx2Root (commonData1,commonData2,tx2)>
<!ELEMENT commonData1 (#PCDATA)>
<!ELEMENT commonData2 (#PCDATA)>
******************
tx1.dtd
******************
<?xml version="1.0" encoding='UTF-8'?>
<!ELEMENT tx1 (data1,data2)>
<!ELEMENT data1 (#PCDATA)>
<!ELEMENT data2 (#PCDATA)>
******************
tx2.dtd
******************
<?xml version="1.0" encoding='UTF-8'?>
<!ELEMENT tx2 (data2,data3)>
<!ELEMENT data2 (#PCDATA)>
<!ELEMENT data3 (#PCDATA)>
******************
tx1.xml
******************
<!DOCTYPE tx1Root SYSTEM "wrapper.dtd">
<tx1Root>
<commonData1>1</commonData1>
<commonData2>2</commonData2>
<tx1>
<data1>1</data1>
<data2>2</data2>
</tx1>
</tx1Root>
--
Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695