xhtml package does not make closing tag </html>

Discussions related to Visual Prolog
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

xhtml package does not make closing tag </html>

Unread post by B.Hooijenga »

I am experimenting with the xhtml - package.
This is my code:

Code: Select all

implement tryout     open core, xmlLite, xhtmlWriter constants     filename8 : string = "xhmlLiteDemo8.html". clauses     test() :-         OutFile8 = outputStream_file::create(filename8, stream::binary),         write(OutFile8, core::utf8),         OutFile8:close().   class predicates     write : (outputStream Output, core::codePage CodePageId). clauses     write(Output, CodepageId)  :-         XmlWriter = xhtmlWriter::new(),         XmlWriter:setOutput(Output, CodepageId),         XmlWriter:setProperty(indent, b_true),         XmlWriter:startHtml5(),         XmlWriter:writeAttributeString("lang","en"),         XmlWriter:writeEndElement(),         XmlWriter:writeEndDocument(),         XmlWriter:flush().   end implement tryout
I get this sourcecode:
<!DOCTYPE html>
<html lang="en" />

while expecting this:
<!DOCTYPE html>
<html lang="en">
</html>


What must be done to get the html closing tag?

Kind regards

Ben
User avatar
Thomas Linder Puls
VIP Member
Posts: 1178
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

When an element is empty it can be closed by placing a slash / directly in front of the > in the tag:

I.e. <xxx /> is the same as <xxx></xxx>.
Regards Thomas Linder Puls
PDC
Post Reply