2

我正在使用以下查询生成 HTML 报告:

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

有没有办法包含一个 doctype 声明,例如:

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

我已经搜索过,但我看不到这样做的明显方法。

更新:只需添加带有 doctype 的提示就会产生以下内容(这会产生另一个验证错误!):

<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">
4

2 回答 2

1

我假设您正在从命令行执行如下操作:

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

您可以添加一些 shell 脚本来连接 DOCTYPE 和报告。假设文档类型被放入文件 DOCTYPE.TXT 中。您没有指定环境,但让我们尝试... Windows。然后我们会有

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > intermediate.html
COPY DOCTYPE.TXT+intermediate.html output.html
于 2009-12-09T21:34:09.733 回答
0

为什么不简单地放一个

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

在您的脚本中,在set markup html on声明之前?

于 2009-11-23T12:21:27.890 回答