Thread XHTML Strict und CGI-Modul (1 answers)
Opened by Perlator at 2007-03-06 23:39

Perlator
 2007-03-06 23:39
#9704 #9704
User since
2007-01-23
5 Artikel
BenutzerIn
[default_avatar]
Hallo,

ich würde gern XHTML Strict konforme Seiten mit dem CGI Modul erzeugen, aber dieses hat ja Transitional als Standard Doctype.

Habe es jetzt erst mal so gemacht:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
use CGI -no_xhtml;
use CGI::Carp qw( fatalsToBrowser );
my $cgi = new CGI;
print    $cgi->header(-type    =>'text/html'),
$cgi->start_html(    -dtd    => '-//W3C//DTD XHTML 1.0 Strict//EN',
               
 -meta    =>{'author'    =>'Perlator'},
               
 -title    =>'Hallo Welt',
               
 -style    =>'../css/screen.css'),


Als Language habe ich jetzt aber "en-US" im Quelltext!

Siehe hier:

Code: (dl )
1
2
3
4
5
6
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html lang="en-US"><head><title>Hallo Welt</title>
<meta name="author" content="Perlator">
<link rel="stylesheet" type="text/css" href="../css/screen.css">
</head>


Wie bekomme ich jetzt einen sauberen Quelltext hin der ungefähr so aussieht?!:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">

    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="author" content="Perlator" />
        
        <title>Startseite</title>

        <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen,projection" />

    </head>


Danke!

Perlator

---
Modedit Gwendragon: Perlcode in CODE-Tags stellen; Emoticons deaktiviert
---\n\n

<!--EDIT|GwenDragon|1173271569-->

View full thread XHTML Strict und CGI-Modul