473,320 Members | 1,853 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,320 software developers and data experts.

querry on ID's and IDREF in DTD

Hi ppl,

I have a querry based on ID. Suppose if i have got two primary keys
(ID) and one foreign key (IDREF) in the same attribute, is there a way
to use them.

For example :

INSTRUCTUR

1) FirstName varchar(32) Primary key
2) LastName varchar(32) Primary key
3) emailID varchar(64) Foreign Key

Now the question is what could be the possible DTD for this kind of
situation.
Can anyone please let me know regarding this and if u have any good
suggestions for the weblink for such kind of DTD's please let me know.

Thanks in advance.

Maulik.

Feb 21 '06 #1
10 1645
DTDs do not support the concept of multiple keys. Only one attribute per
element type may be declared as having type ID.

(http://www.w3.org/TR/2004/REC-xml11-...#one-id-per-el)

If you're working with schemas rather than DTDs, you could try using
keys rather than IDs. Or you could just have your software explicitly
search for elements that have the appropriate attribute/value pair,
using XPaths or something of that sort.
Feb 21 '06 #2
Hi,

but what if i wanted to implement that structure using DTD only..

Thanks
Aalap
Joe Kesselman wrote:
DTDs do not support the concept of multiple keys. Only one attribute per
element type may be declared as having type ID.

(http://www.w3.org/TR/2004/REC-xml11-...#one-id-per-el)

If you're working with schemas rather than DTDs, you could try using
keys rather than IDs. Or you could just have your software explicitly
search for elements that have the appropriate attribute/value pair,
using XPaths or something of that sort.


Feb 24 '06 #3
>>DTDs do not support the concept of multiple keys. Only one attribute per
element type may be declared as having type ID.

but what if i wanted to implement that structure using DTD only..


Then the DTD can't help you. As I said:
Or you could just have your software explicitly
search for elements that have the appropriate attribute/value pair,
using XPaths or something of that sort.


--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 24 '06 #4
hey

Thanks again.....

suppose i took instructor as an element and first name , last name ,
email as the child elements.......and each element should have an
attribute called first name ,last name and email respectively . and in
that case first name and last name can have and ID rt?

Aalap

Feb 24 '06 #5
> suppose i took instructor as an element and first name , last name ,
email as the child elements.......and each element should have an
attribute called first name ,last name and email respectively . and in
that case first name and last name can have and ID rt?


Yes. Ugly, but yes.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Feb 24 '06 #6
Hey thanks.......a lot !!!

Feb 25 '06 #7
Note that IDs must be unique, though. So if you make firstname an ID,
nobody else can have the same firstname; if lastname is also an ID, not
only can no two people have the same lastname, but no lastname can be
the same as any firstname.

I doubt that's what you're trying to achieve. IDs are generally the
wrong solution for anything except pointing to a specific location in a
document.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 25 '06 #8
Hey

even i just realised that . i surely dont want that
So there is no way i can use ID for a composite key for a table....
also i am getting and error in XML spy
This file is not valid:
Required attribute 'dept' is missing.
even though i have it in the dtd .

Thanks
Aalap

Feb 25 '06 #9
> Required attribute 'dept' is missing.
even though i have it in the dtd .


Sounds like the problem is that you do have it in the DTD but it's
missing in the instance document.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 25 '06 #10
And what abt the composite key thing....can i implement it using the
DTD
`

Feb 25 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Stoic | last post by:
Hi, I'm relatively new to CSS. I'm trying to get all the urls in a group of text bracketed by <p></p> tags to be underlined and everywhere else to NOT be underlined. As of now my code is like...
25
by: Andreas Fromm | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Im building an user database with many tables keeping the data for the Address, Phone numbers, etc which are referenced by a table where I...
7
by: Microsoft News | last post by:
Hi all. Does id() xpath function work in System.XML? I have built dtd, schema, xdr for a simple xml which includes attributes definded as ID and IDREFS. Validation is occurring properly for all...
2
by: VernonR | last post by:
I'm having problems getting the .NET 1.1 XSL transform to cross reference using ID / IDREF correctly. I have collapsed to a simple set of files to show the problem more clearly... The output...
3
by: Linn K B | last post by:
I have a querry that works, but it is incredeble slow, so do anyone have any suggestions how to make this better: The table looks like this Gab(ID (key), Gid, Pid, Status, .....), mening there...
3
by: Eric Lilja | last post by:
Sorry for asking so many questions, but I've just started and need to get some things working so I can do the task that is before me. Consider this (validating) schema: <?xml version="1.0"?>...
0
by: Ridius | last post by:
Hello. I start to study XML and have a question. What`s the difference between ID/IDREF and Key/Keyref? What's better to use? Thanks.
0
by: getmeidea | last post by:
I have the following tables, 1> employee_master(emp_id int primary key, emp_name varchar(100)); 2> employee_salary_payment(salary_rid int primary key, emp_id int, sal_date date, paid_amt int); ...
2
by: geoff | last post by:
Hello, Why does this not work: <billTo id="addr-1"> <company>The Skateboard Warehouse</company> <street>One Warehouse Park</street> <street>Building 17</street> <city>Boston</city>...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.