Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Validation 省略了“meta”的结束标记,但指定了OMITTAG NO_Validation_Xslt_Xhtml_W3c Validation - Fatal编程技术网

Validation 省略了“meta”的结束标记,但指定了OMITTAG NO

Validation 省略了“meta”的结束标记,但指定了OMITTAG NO,validation,xslt,xhtml,w3c-validation,Validation,Xslt,Xhtml,W3c Validation,当我尝试验证我的联系人支持页面时,出现以下错误 就我的一生而言,我无法让这一页得到验证。 还有,我得到了这个,这毫无意义: 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:

当我尝试验证我的联系人支持页面时,出现以下错误

就我的一生而言,我无法让这一页得到验证。 还有,我得到了这个,这毫无意义:

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'>&lt;!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>

....
我看到两件事

您的输出方法是html,但您引用的是XML DTD xhtml。将输出方法更改为xml或引用HTML DTD HTML DTD是SGML

由于使用xsl:output输出doctype声明,因此应该删除尝试使用xsl:text输出的doctype声明。不能有多个doctype声明

例如:

<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>

你能告诉我语法吗!我加了一个例子。我所做的只是删除xsl:text并将method=html更改为method=xml。谢谢,但我不明白为什么是xml,因为我想要一个html页面,因为您指向的是XHTML DTD,它是xml。您想让我用HTML DTD更新我的示例吗?我还有一个错误:错误行35,第215列:img的结束标记被省略,但忽略标记否被指定DHM,您是在尝试验证这个原始XML源,就像它是XHTML一样,还是在XSLT转换后尝试验证生成的XHTML?