[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] error in DTD with multiple entities
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|