473,387 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
3 3308
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: wooks | last post by:
<?xml version='1.0'?> <userlogin xmlns="urn:faster:userlogin" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <login>mick</login> <password>brown</password> </userlogin> Above is my...
0
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > ...
4
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could...
0
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
2
by: mrc-1 | last post by:
Hi, i'd like to validate my XML file (see below) using XML Schema. Now my question: is it possible to limit the occurrence of the element b in the data element. I mean: data can contain up to...
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
5
by: j.tremlett | last post by:
Hi, I have read various articles on this and I have had a few suggestions but would like to know which is correct. I have an XML file with the element <root> Within <root> I can have a...
2
by: gregmcmullinjr | last post by:
I am wondering if there is a way to use a DTD or Schema to instruct an XML parser to ignore tags that are not defined. That is, if my list of acceptable tags is <bodyand <content>, then in the...
1
by: Mikus Sleiners | last post by:
I have a task to create xml document from c# code. I have example of that document should look like and also a xml schema. I wonder if i can use this xml schema somehow ? This is schema: ...
3
by: Kai Schlamp | last post by:
Hello! In my schema I have the following: <xs:complexType name="textareaType"> <xs:simpleContent> <xs:restriction base="xs:string"> <xs:attribute ref="label" use="required" />...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.