472,810 Members | 4,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,810 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 3271
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" />...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.