[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

error in DTD with multiple entities

  • From: Wendi Sisson <wsisson@e...>
  • To: xml-dev@l...
  • Date: Fri, 10 Aug 2001 09:19:39 -0500

pcdata in dtd
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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.