=encoding euc-jp =head1 NAME =begin original HTML::HeadParser - Parse section of a HTML document =end original HTML::HeadParser - HTML 文書の セクションをパースする (訳注: (TBR)がついている段落は「みんなの自動翻訳@TexTra」による 機械翻訳です。) =head1 SYNOPSIS require HTML::HeadParser; $p = HTML::HeadParser->new; $p->parse($text) and print "not finished"; $p->header('Title') # to access .... $p->header('Content-Base') # to access $p->header('Foo') # to access $p->header('X-Meta-Author') # to access $p->header('X-Meta-Charset') # to access =head1 DESCRIPTION =begin original The C is a specialized (and lightweight) C that will only parse the EHEAD>...E/HEAD> section of an HTML document. The parse() method will return a FALSE value as soon as some EBODY> element or body text are found, and should not be called again after this. =end original Cは、HTML文書のEHEAD>.E/HEAD>セクションのみを解析する特殊な(軽量な)Cです。 parse()メソッドは、EBODY>要素または本文テキストが見つかるとすぐにFALSE値を返します。 この後は再度呼び出さないでください。 (TBR) =begin original Note that the C might get confused if raw undecoded UTF-8 is passed to the parse() method. Make sure the strings are properly decoded before passing them on. =end original 生のデコードされていないUTF-8がparse()メソッドに渡されると、Cのが混乱する可能性があることに注意してください。 文字列を渡す前に、文字列が正しくデコードされていることを確認してください。 (TBR) =begin original The C keeps a reference to a header object, and the parser will update this header object as the various elements of the EHEAD> section of the HTML document are recognized. The following header fields are affected: =end original Cはヘッダーオブジェクトへの参照を保持しており、パーサーはHTML文書のEHEAD>セクションのさまざまな要素が認識されると、このヘッダーオブジェクトを更新します。 次のヘッダーフィールドが影響を受けます。 (TBR) =over 4 =item Content-Base: =begin original The I header is initialized from the Ebase href="..."> element. =end original Iヘッダーは、Ebase href=".">要素から初期化されます。 (TBR) =item Title: =begin original The I header is initialized from the E<lt>title>...E<lt>/title> element. =end original I<Title>ヘッダーは、E<lt>title>.E<lt>/title>要素から初期化されます。 (TBR) =item Isindex: =begin original The I<Isindex> header will be added if there is a E<lt>isindex> element in the E<lt>head>. The header value is initialized from the I<prompt> attribute if it is present. If no I<prompt> attribute is given it will have '?' as the value. =end original E<lt>head>にE<lt>isindex>要素がある場合、I<Isindex>ヘッダーが追加されます。 ヘッダー値は、I<prompt>属性が存在する場合、それから初期化されます。 I<prompt>属性が指定されていない場合、値は'?'になります。 (TBR) =item X-Meta-Foo: =begin original All E<lt>meta> elements containing a C<name> attribute will result in headers using the prefix C<X-Meta-> appended with the value of the C<name> attribute as the name of the header, and the value of the C<content> attribute as the pushed header value. =end original C<name>属性を含むすべてのE<lt>meta>要素は、プレフィックスC<X-Meta->を使用するヘッダーになり、ヘッダーの名前としてC<name>属性の値が追加され、プッシュされたヘッダー値としてC<content>属性の値が追加されます。 (TBR) =begin original E<lt>meta> elements containing a C<http-equiv> attribute will result in headers as in above, but without the C<X-Meta-> prefix in the header name. =end original C<http-equiv>属性を含むE<lt>meta>要素は、上記のようにヘッダーになりますが、ヘッダー名にC<X-Meta->プレフィックスはありません。 (TBR) =begin original E<lt>meta> elements containing a C<charset> attribute will result in an C<X-Meta-Charset> header, using the value of the C<charset> attribute as the pushed header value. =end original C<charset>属性を含むE<lt>meta>要素は、プッシュされたヘッダ値としてC<charset>属性の値を使用して、C<X-Meta-Charset>ヘッダとなる。 (TBR) =back =head1 METHODS =begin original The following methods (in addition to those provided by the superclass) are available: =end original (スーパークラスによって提供されるメソッドに加えて)次のメソッドを使用できます。 (TBR) =over 4 =cut =item $hp = HTML::HeadParser->new =item $hp = HTML::HeadParser->new( $header ) =begin original The object constructor. The optional $header argument should be a reference to an object that implement the header() and push_header() methods as defined by the C<HTTP::Headers> class. Normally it will be of some class that is a or delegates to the C<HTTP::Headers> class. =end original オブジェクトコンストラクタ。 オプションの$header引数は、C<HTTP::Headers>クラスで定義されているheader()およびpush_header()メソッドを実装するオブジェクトへの参照である必要があります。 通常、この引数は、C<HTTP::Headers>クラスのまたはデリゲートであるクラスのものです。 (TBR) =begin original If no $header is given C<HTML::HeadParser> will create an C<HTTP::Headers> object by itself (initially empty). =end original $headerが指定されていない場合、C<HTML::HeadParser>は自身でC<HTTP::Headers>オブジェクトを作成します(最初は空)。 (TBR) =cut =item $hp->header; =begin original Returns a reference to the header object. =end original ヘッダーオブジェクトへの参照を返します。 (TBR) =item $hp->header( $key ) =begin original Returns a header value. It is just a shorter way to write C<$hp-E<gt>header-E<gt>header($key)>. =end original ヘッダー値を返します。 これは、C<$hp-E<gt>header-E<gt>header($key)>を記述するための簡単な方法です。 (TBR) =cut =back =head1 EXAMPLE $h = HTTP::Headers->new; $p = HTML::HeadParser->new($h); $p->parse(<<EOT); <title>Stupid example Normal text starts here. EOT undef $p; print $h->title; # should print "Stupid example" =head1 SEE ALSO L, L =begin original The C class is distributed as part of the I package. If you don't have that distribution installed you need to provide the $header argument to the C constructor with your own object that implements the documented protocol. =end original Cクラスは、Iパッケージの一部として配布されています。 この配布パッケージをインストールしていない場合は、文書化されたプロトコルを実装する独自のオブジェクトを使用して、Cコンストラクタに$header引き数を提供する必要があります。 (TBR) =head1 COPYRIGHT Copyright 1996-2001 Gisle Aas. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =begin meta Translate: SHIRAKATA Kentaro Status: in progress =end meta =cut