Page 1 of 1

xhtml package does not make closing tag </html>

Posted: 30 Dec 2014 10:02
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

Posted: 30 Dec 2014 14:53
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>.