- struct output_driver *d;
- struct html_driver *html;
-
- html = xzalloc (sizeof *html);
- d = &html->driver;
- output_driver_init (&html->driver, &html_driver_class, file_name,
- device_type);
- html->css = parse_boolean (opt (d, o, "css", "true"));
- html->borders = parse_boolean (opt (d, o, "borders", "true"));
-
- html->file_name = xstrdup (file_name);
- html->chart_file_name = parse_chart_file_name (opt (d, o, "charts",
- file_name));
- html->file = NULL;
- html->chart_cnt = 1;
-#ifdef HAVE_CAIRO
- parse_color (d, o, "background-color", "#FFFFFFFFFFFF", &html->bg);
- parse_color (d, o, "foreground-color", "#000000000000", &html->fg);
-#endif
- html->file = fn_open (html->file_name, "w");
- if (html->file == NULL)
- {
- msg_error (errno, _("error opening output file `%s'"), html->file_name);
- goto error;
- }
-
- fputs ("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n"
- " \"http://www.w3.org/TR/html4/loose.dtd\">\n", html->file);
- fputs ("<HTML>\n", html->file);
- fputs ("<HEAD>\n", html->file);
- print_title_tag (html->file, "TITLE", _("PSPP Output"));
- fprintf (html->file, "<META NAME=\"generator\" CONTENT=\"%s\">\n", version);
- fputs ("<META HTTP-EQUIV=\"Content-Type\" "
- "CONTENT=\"text/html; charset=utf-8\">\n", html->file);
-
- if ( html->css)
+ fputs ("<!doctype html>\n", html->file);
+ fprintf (html->file, "<html");
+ char *ln = get_language ();
+ if (ln)
+ fprintf (html->file, " lang=\"%s\"", ln);
+ free (ln);
+ fprintf (html->file, ">\n");
+ fputs ("<head>\n", html->file);
+ print_title_tag (html->file, "title", _("PSPP Output"));
+ fprintf (html->file, "<meta name=\"generator\" content=\"%s\">\n", version);
+ fputs ("<meta http-equiv=\"content-type\" "
+ "content=\"text/html; charset=utf-8\">\n", html->file);
+
+ if (html->css)