2

I'm producing an HTML report from a query using:

set markup html on table "WIDTH='100%' BORDER='1'
cellpadding='2px' cellspacing='0px'";

Is there a way of including a doctype declaration such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

I've searched but I can't see an obvious way of doing this.

UPDATE: Simply adding a prompt with a doctype produces the following (which produces another validation error!):

<html>
    <head>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
        <style type="text/css">pre{background-color:white;font-family:"Courier New";font-size:16;color:black;}</style>
    </head>
<body>
    <pre>
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3
  • DOCTYPE declarations need to be at the beginning of the file. They are above / outside the <html> element. You can view the source of this webpage and see. Commented Dec 3, 2009 at 17:25
  • Yeah I know DOCTYPEs need to be at the start of the file. Any idea about how to do it? ;) Commented Dec 4, 2009 at 16:11
  • put the PROMPT statement BEFORE the set markup html on statement? Commented Dec 9, 2009 at 21:44

2 Answers 2

1

I assume you're executing from the command line something like this:

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > output.html

What you can do is add some shell scripting to concatenate the DOCTYPE and the report. Let's assume the doctype is being put in a file DOCTYPE.TXT. You don't specify an environment, but let's try... Windows. Then we would have

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > intermediate.html
COPY DOCTYPE.TXT+intermediate.html output.html
Sign up to request clarification or add additional context in comments.

Comments

0

Why not simply put a

prompt <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">

in your script, BEFORE the set markup html on statement?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.