提问人:Sami Li 提问时间:2/19/2015 最后编辑:Sami Li 更新时间:2/19/2015 访问量:1412
省略了“meta”的结束标记,但指定了 OMITTAG NO
end tag for "meta" omitted, but OMITTAG NO was specified
问:
当我尝试验证我的联系人支持页面时,我收到以下错误。
在我的一生中,我无法验证此页面。 另外,我得到了这个,这根本没有意义:
Error Line 35, Column 215: end tag for "img" omitted, but OMITTAG NO was specified
Line 1, Column 112: DTDs other than base allowed only if CONCUR YES or EXPLICIT YES
Line 1, Column 112: DTDs other than base allowed only if CONCUR YES or EXPLICIT YES
…rg/TR/xhtml1/DTD/xhtml1-strict.dtd"><!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1…
✉
Error Line 1, Column 206: DTD did not contain element declaration for document type name
…//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html>
✉
A DOCTYPE declares the version of the language used, as well as what the root (top) element of your document will be. For example, if the top element of your document is <html>, the DOCTYPE declaration will look like: "<!DOCTYPE html".
In most cases, it is safer not to type or edit the DOCTYPE declaration at all, and preferable to let a tool include it, or copy and paste it from a trusted list of DTDs.
Error Line 1, Column 207: Missing xmlns attribute for element html. The value should be: http://www.w3.org/1999/xhtml
…//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html>
✉
Many Document Types based on XML need a mandatory xmlns attribute on the root element. For example, the root element for XHTML might look like:
<html xmlns="http://www.w3.org/1999/xhtml">
Error Line 3, Column 75: end tag for "meta" omitted, but OMITTAG NO was specified
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Info Line 3, Column 3: start tag was here
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Error Line 4, Column 59: end tag for "link" omitted, but OMITTAG NO was specified
<link rel="stylesheet" type="text/css" href="style.css">
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
这是我页面的来源:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.1//EN"
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
indent="yes"></xsl:output>
<xsl:template match="/">
<xsl:text disable-output-escaping='yes'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></xsl:text>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<link rel="stylesheet" type="text/css" href="style.css"></link>
<title>Titre</title>
</head>
<body>
<img alt="image" style="margin-top:8px;"><xsl:attribute name="src" >images/D.png</xsl:attribute></img>
....
答:
0赞
Daniel Haley
2/19/2015
#1
我看到两件事。
输出方法是 ,但引用的是 XML DTD (xhtml)。将输出方法更改为或引用 HTML DTD(HTML DTD 是 SGML)。
html
xml
由于您要使用 输出 doctype 声明,因此应删除您尝试输出的 doctype 声明。不能有多个 doctype 声明。
xsl:output
xsl:text
例:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
indent="yes"/>
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Titre</title>
</head>
<body>
<img alt="image" style="margin-top:8px;">
<xsl:attribute name="src">images/D.png</xsl:attribute>
</img>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
评论
0赞
Sami Li
2/19/2015
你能给我语法吗!
0赞
Daniel Haley
2/19/2015
我加了一个例子。我所做的只是删除并更改为 .xsl:text
method="html"
method="xml"
0赞
Sami Li
2/19/2015
谢谢你,但我不明白为什么是xml,因为我想有一个Html页面
0赞
Daniel Haley
2/19/2015
因为您指向的是 XHTML DTD,即 XML。您是否希望我使用 HTML DTD 更新我的示例?
0赞
Sami Li
2/19/2015
好吧,我也有这个错误:错误行 35,第 215 列:省略了“img”的结束标签,但指定了 OMITTAG NO
评论