[XML-DEV Mailing List Archive Home]
[Reply To This Message]
RE: Expert's advice needed about XML Schema and definin g so
- To: 'Jeff Greif' <jgreif@a...>
- Subject: RE: Expert's advice needed about XML Schema and definin g some kind of relation
- From: Barwell Jonathan <Jonathan.Barwell@a...>
- Date: Fri, 5 Dec 2003 08:36:27 -0000
- Cc: "'xml-dev@l...'" <xml-dev@l...>
- Return-receipt-to: Barwell Jonathan <Jonathan.Barwell@a...>
Title: RE: Expert's advice needed about XML Schema and defining some kind of relation
I wonder whether you are actually using the right technologies to solve your problems. In essence you are trying to design a relational database using XML.
Personally if I was an architect on your project I would either be suggesting 1) Use a technology such as Java to pull your person records from a database or your XML document and then validate them against the main schema. As Jon Bozak said "XML will give Java something to do". OR 2) use the facilities that are now available in some relational databases for this type of validation, e.g. an Oracle database can store XML documents which you can then build constraints on against relational tables.
XML and their associated technologies are very powerful but for certain solutions they are not performant and not scalable.
Sorry this doesn't answer your specific question.
From: Jeff Greif [mailto:jgreif@a...]
Sent: 04 December 2003 19:01
Subject: Re: Expert's advice needed about XML Schema and defining some kind of relation
Your solution seems pretty clever. However, it imposes some processing
1. You have to add a new person to the persons document and save it
before you can open the publications document in order to add a reference to
a new person. (That is, if you validated the publications document with the
old persons document, you cannot validly add a reference to a person added
subsequently, unless you can reparse the XSLT-produced schema for the
persons document after adding the person.)
2. Similarly, you must delete publication doc references to a person you
are going to subsequently delete from the persons doc.
If you do either of these things in the wrong order, the publications
document will not be validatable for editing until you undo the change to
the persons file. If all the changes are made by programs you can probably
manage this successfully, but if humans are involved they will probably get
frustrated by making mistakes in the order of editing.
Another possible approach is to use XSLT to combine the persons and
publications document, and use the XML Schema key constraints, validating
only the combined document when it is used -- the publications doc would not
be independently validated.
I know almost nothing about XInclude, but it might provide a way of giving
access to the persons document within the publications document. It might
also be worth investigating XQuery (about which I am also ignorant).
----- Original Message -----
From: "Peter Glantschnig" <justice@s...>
Sent: Thursday, December 04, 2003 5:00 AM
Subject: Expert's advice needed about XML Schema and defining some
kind of relation
... Let's say you have two XML
files. One stores publications and the other one stores some names of
persons. Now each person is responsible for a couple of publications.
Now I want to make sure that this relation is always true by using XML
Schema. So when you enter a new publication, you should not be able to
assign a person to that publication, which can not be found in the
persons XML file. So at least when you validate the publications XML
file you should get an error.
Now what I need in the publications XML Schema is something like that:
"for the type persons only values are allowed which can be found in a
certain field in the persons XML file".
I made a XSL Transformation which transforms the persons XML file into a
XML Schema data type, which allows only certain values. This generated
XML Schema file I included into the XML Schema file of the publications.
So you enter the persons, then you make the XSL Transformation and then
you can enter some publications and validate the XML file. You are sure,
that all assigned person appear in the persons XML file!
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>
The list archives are at http://lists.xml.org/archives/xml-dev/
To subscribe or unsubscribe from this list use the subscription
The information contained in this e-mail is confidential and is intended
for the recipient only.
If you have received it in error, please notify us immediately by reply
e-mail and then delete it from your system. Please do not copy it or
use it for any other purposes, or disclose the content of the e-mail
to any other person or store or copy the information in any medium.
The views contained in this e-mail are those of the author and not
necessarily those of Admenta UK Group.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
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