我正在阅读W3Schools关于XHTML的this page,其中说{x}对于XHTML文档来说<!DOCTYPE>
强制。
我的问题仅仅是理论上的问题:这条规则来自哪里?
我的意思是,我已经阅读了很多关于XML的教程,但没有人说必须始终有DOCTYPE声明,只有在需要验证时才需要它。所以,XHTML是一个XML文档,我试过阅读XHTML DTD(严格),但我没有找到一条说DOCTYPE是强制性的。
答案 0 :(得分:2)
SELECT MEMBERS.scancode, MEMBERS.fname, MEMBERS.lname, MEMBERS.datejoin, MEMBERS.entrydate
, MEMBERS.relationship, MEMBERUDFS.udfvalue
FROM MEMBERS
LEFT OUTER JOINMEMBERUDFS
ON MEMBERS.memid = MEMBERUDFS.memid
INNER JOIN MEMBERUDFSETUPS
ON MEMBERUDFS.udfid = MEMBERUDFSETUPS.udfid
WHERE (MEMBERS.siteid = @rvSite
AND MEMBERS.status = 'A'
AND MEMBERS.relationship = 'M'
AND MEMBERS.datejoin BETWEEN @rvStartDate AND @rvEndDate
AND MEMBERS.mtypeid NOT IN (5, 6, 7, 11, 14, 31)
AND (MEMBERUDFS.udfid = '17' or MEMBERUDFS.udfid is null)
OR (MEMBERS.siteid = @rvSite
AND MEMBERS.relationship = 'P'
AND MEMBERS.entrydate BETWEEN @rvStartDate AND @rvEndDate)
AND (MEMBERUDFS.udfid = '17' or MEMBERUDFS.udfid is null)
在XML 由于@Lashane已经回答,因此在XHTML中是强制性的。它(List<int> index = new List<int> ();
index.Clear ();
foreach (Vector3 location in locations) {
foreach (Vector3 comparedLocation in locations) {
if (location == comparedLocation) {
continue;
}
if ((location.x == comparedLocation.x) && (location.y > comparedLocation.y)) {
int id = missingLocations.IndexOf (location);
index.Add (id);
}
}
}
index.Sort ();
index = index.Distinct ().ToList ();
for (int i = index.Count - 1; i >= 0; i--) {
int id = index [i];
locations.RemoveAt (id);
}
)是Codecademy:
只要附加要求与XML不相符,XHTML就可以施加额外的要求,仍然是XML。此DOCTYPE要求与XML完全一致。没有矛盾。<!DOCTYPE>
答案 1 :(得分:1)
此规则来自xhtml standard
根元素之前的文档中必须有DOCTYPE声明。 DOCTYPE声明中包含的公共标识符必须使用相应的正式公共标识符引用DTD中找到的三个DTD之一。可以更改系统标识符以反映本地系统约定。