XML Schema <-> DTD ? equivalent to external ENTITY

R

Robert Lintner

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 ?
 
B

Bob Foster

include and import.

Bob

Robert Lintner said:
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
 
P

Peter C. Chapin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top