Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.xml.sax.SAXParseException: The element type "head" must be terminated by the matching end-tag "".

When i check this site http://visaraimpex.com/ in http://www.w3.org/2003/12/semantic-extractor.html

like image 509
Jitendra Vyas Avatar asked Dec 29 '25 03:12

Jitendra Vyas


1 Answers

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

This illustrates the kind of problems you have trying to extract stuff from real-world 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.

like image 69
Stephen C Avatar answered Dec 31 '25 17:12

Stephen C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!