Re: [xml] xmllint and HTML



By the way, it would be nice if --html do not complain if you send him a
xml file (looking to the header we could change to XML parser without
the user need to look at the file to see if it is xhtml).

  Hum, if people use xmllint to check SGML HTML, then they are
checking for the vocabulary used too, and switching transparently
to an XML parser which would just check well formedness doesn't
sound right. If a simple XML file

<foobar/>

ends up in the middle of your set of HTML files, then with the
behaviour you suggest xmllint would not raise any error about it.
No that doesn't sound a good idea to me.

OK. It is a good point.
only one more thing: xhtml is not valid html?
I mean, the following behaviour is expected?

[albie natura albie]$ xmllint --html index.html > _.xhtml
[albie natura albie]$ xmllint --html _.xhtml > /dev/null
_.xhtml:1: error: htmlParseStartTag: invalid element name
<?xml version="1.0" standalone="yes"?>
 ^
_.xhtml:2: error: Misplaced DOCTYPE declaration
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org^



Daniel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]