[英]How to solve this error “The element type ”head“ must be terminated > by the matching end-tag ”</head>"?
Why i'm getting this error 为什么我收到这个错误
Using org.apache.xerces.parsers.SAXParser Exception net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException: The element type "head" must be terminated by the matching end-tag "".
使用org.apache.xerces.parsers.SAXParser异常net.sf.saxon.trans.XPathException:org.xml.sax.SAXParseException:元素类型“head”必须由匹配的结束标记“”终止。 org.xml.sax.SAXParseException: The element type "head" must be terminated by the matching end-tag "".
org.xml.sax.SAXParseException:元素类型“head”必须由匹配的结束标记“”终止。
When i check this site http://visaraimpex.com/ in http://www.w3.org/2003/12/semantic-extractor.html 当我在http://www.w3.org/2003/12/semantic-extractor.html上查看这个网站http://visaraimpex.com/时
I think that these two lines are part of the problem: 我认为这两行是问题的一部分:
<script src="js/jquery-1.3.2.min.js" type="text/javascript"/></script>
<script src="js/dropdown.js" type="text/javascript"/></script>
Since this is XHTML (according to the DOCTYPE), you can either change "/>" to ">", or delete the "</script>". 由于这是XHTML(根据DOCTYPE),您可以将“/>”更改为“>”,或删除“</ script>”。
This illustrates the kind of problems you have trying to extract stuff from real-world HTML. 这说明了您尝试从真实HTML中提取内容的问题。 If that is what you are doing, maybe you should be using HTMLTidy or a similar "permissive" HTML parser rather than a strict parser.
如果你正在做的事情,也许你应该使用HTMLTidy或类似的“宽容”HTML解析器而不是严格的解析器。
You close your <script> tags twice: 您关闭<script>标记两次:
<script src="js/jquery-1.3.2.min.js" type="text/javascript"/></script>
Remove </script> and it should work. 删除</ script>,它应该工作。
Replace the head part of your HTML code with the following snippet: 使用以下代码段替换HTML代码的head部分:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Visara Impex</title>
<meta name="keywords" content="">
<meta name="Visara Impex" content="">
<link href="default.css" rel="stylesheet" type="text/css" media="screen">
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/dropdown.js" type="text/javascript"></script>
<script type="text/javascript" src="js/rb.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#menu li:nth-child(1)").addClass("current_page_item");
$("#menu").css("background" , "url(images/nav/7.jpg) no-repeat left top");
});
</script>
</head>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.