2015-02-18 1 views
0

При попытке проверить страницу поддержки контактов я получаю следующие ошибки.конечный тег для «meta» опущен, но был указан OMITTAG NO

И для жизни меня я не могу получить эту страницу для подтверждения. Кроме того, я получаю это, что не имеет никакого смысла:

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> 

.... 
+0

Хм, вы пытаетесь проверить это необработанный источник XML, как если бы это был XHTML, или вы пытаетесь проверить полученный XHTML (после преобразования XSLT)? –

ответ

0

Я вижу две вещи.

  1. Ваш метод вывода является html, но вы ссылки в XML DTD (XHTML). Либо измените метод вывода на xml, либо укажите HTML DTD (HTML DTD - SGML).

  2. Поскольку вы выводили объявление doctype с помощью xsl:output, вы должны удалить декларацию doctype, которую вы пытаетесь вывести, с помощью xsl:text. У вас не может быть более одного объявления 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> 
+0

Можете ли вы дать мне синтаксис! –

+0

Я добавил пример. Все, что я сделал, это удалить «xsl: text» и изменить 'method =" html "' to 'method =" xml "'. –

+0

Спасибо, но я не понимаю, почему xml, потому что я хочу иметь страницу Html. –

 Смежные вопросы

  • Нет связанных вопросов^_^