[xml] XHTML DTD changes behaviour for empty tags



Dear all,

could anybody please give me a hint why xmllint'ing the following two
files makes a difference regarding the handling of the empty <test> tag?
It's printed as "<test></test>" if the DTD is present.

I already played around with xmlSaveNoEmptyTags in my code to get around
that but that seems not to make a difference. libxml2 is 2.6.32.

Thanks!
Matthias

-- file 1 --
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
        <head><meta http-equiv="Content-Type" content="text/html;
charset=utf-8" /></head>
        <body>
                <p>foo<test />bar</p>
        </body>
</html>

-- file 2 --
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml";>
        <head><meta http-equiv="Content-Type" content="text/html;
charset=utf-8" /></head>
        <body>
                <p>foo<test />bar</p>
        </body>
</html>



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