467,877 Members | 1,101 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

XML Schema <-> DTD ? equivalent to external ENTITY

Hi,

I woult like to switch from DTD to XML-Schema and am looking for an equivalent
to external ENTITY for composition of an xml file from modules

--- my.dtd --
<?xml version="1.0" encoding="ISO-8859-1"?>
<!ENTITY module1 SYSTEM "module1.xml">
<!ENTITY module2 SYSTEM "module2.xml">
.....

--- my.xml --- ( + module1.xml, module2.xml )
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE my SYSTEM "my.dtd">
<my>
&module1;
&module2;
</my>

.... modul1.xml and modul2.xml are included in my.xml and validated with my.dtd
together.

how could I realize this with XML Schema ?

thanks in advance

Robert

P.S.: the modules should be validated together because of common ID/IDREF scope
I know XML Schema can be composed of multiple files with <include> and <import>
but xml data ?

Jul 20 '05 #1
  • viewed: 3093
Share:
3 Replies
include and import.

Bob

"Robert Lintner" <rl******@etm.at> wrote in message
news:10***************@newsmaster-03.atnet.at...
Hi,

I woult like to switch from DTD to XML-Schema and am looking for an equivalent to external ENTITY for composition of an xml file from modules

--- my.dtd --
<?xml version="1.0" encoding="ISO-8859-1"?>
<!ENTITY module1 SYSTEM "module1.xml">
<!ENTITY module2 SYSTEM "module2.xml">
....

--- my.xml --- ( + module1.xml, module2.xml )
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE my SYSTEM "my.dtd">
<my>
&module1;
&module2;
</my>

... modul1.xml and modul2.xml are included in my.xml and validated with my.dtd together.

how could I realize this with XML Schema ?

thanks in advance

Robert

P.S.: the modules should be validated together because of common ID/IDREF scope I know XML Schema can be composed of multiple files with <include> and <import> but xml data ?

Jul 20 '05 #2
In article <bf***********@pc-news.cogsci.ed.ac.uk>,
ri*****@cogsci.ed.ac.uk says...
The most straightforward solution is to continue using entities. You
can use a DTD for entities and a schema for validation.


Interestingly it appears to be impossible to get Xerces-J v2.4.0 (at
least) to validate such an arrangement. In particular, if one turns on
schema validation, then DTD validation is also turned on. Since the DTD
does not declare the elements (if it only provides entities), the result
is a large stream of validation errors about undeclared elements coming
from the DTD validator.

The Xerces documentation talks about this issue and basically says there
is currently no resolution. That seems hard to believe. Does anyone here
know anything to the contrary?

Peter

Jul 20 '05 #3
ri*****@cogsci.ed.ac.uk (Richard Tobin) writes:
In article <NrgSa.86034$GL4.22868@rwcrnsc53>,
Bob Foster <bo********@comcast.net> wrote:
include and import.


No, those are for composition of schemas, not documents. They correspond
very roughly to parameter entities rather than general entities.


how about http://www.w3.org/TR/xinclude/ ?
Susanne
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by wooks | last post: by
4 posts views Thread by Gordon Dickens | last post: by
2 posts views Thread by mrc-1 | last post: by
reply views Thread by Derek | last post: by
5 posts views Thread by j.tremlett | last post: by
2 posts views Thread by gregmcmullinjr | last post: by
1 post views Thread by Mikus Sleiners | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.