在DTD中识别ID和IDREF [英] querry on ID's and IDREF in DTD
本文介绍了在DTD中识别ID和IDREF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨ppl,
我有一个基于ID的querry。假设我在同一属性中有两个主键
(ID)和一个外键(IDREF),有没有办法使用它们。
。 >
例如:
INSTRUCTUR
1)FirstName varchar(32)主键
2)LastName varchar(32)主键
3)emailID varchar(64)外键
现在的问题是什么可能是对于这种
的情况可能有DTD。
任何人都可以告诉我这方面的问题,如果你对网络链接有任何好的
建议对于这种DTD,请告诉我。
提前致谢。
毛利克。
>
推荐答案
DTD不支持多个密钥的概念。每个
元素类型只能声明一个属性类型ID。
( http://www.w3.org/TR/2004/REC-xml11- .. 。#one-id-per-el )
如果你正在使用架构而不是DTD,你可以尝试使用
密钥而不是ID。或者您可以明确地使用您的软件
搜索具有相应属性/值对的元素,使用XPath或类似的东西来获取
。
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.
但如果我只想使用DTD实现该结构怎么办..
谢谢
Aalap
Joe Kesselman写道:
Hi,
but what if i wanted to implement that structure using DTD only..
Thanks
Aalap
Joe Kesselman wrote:
DTD不支持多键的概念。每个
元素类型只能声明一个属性具有类型ID。
( http://www.w3.org/TR/2004/REC-xml11-...#one-id-per- el )
如果你正在使用模式而不是DTD,你可以尝试使用
键而不是ID。或者你可以让你的软件明确地搜索具有适当属性/值对的元素,使用XPath或类似的东西。
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.
>> DTD不支持多键的概念。每个
>>DTDs do not support the concept of multiple keys. Only one attribute per
元素类型只有一个属性可以声明为具有类型ID。
element type may be declared as having type ID.
但是,如果我只想使用DTD实现该结构,该怎么办? ..
but what if i wanted to implement that structure using DTD only..
然后DTD无法帮助你。正如我所说:
Then the DTD can''t help you. As I said:
或者您可以明确地让您的软件搜索具有适当属性/值对的元素,
使用XPath或类似的东西。
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
/ \标记HTML电子邮件! |系统架构和动态诗歌
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
这篇关于在DTD中识别ID和IDREF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文