タグのhref
属性に不正な構文を含むHTMLファイルのセットがあります。<a>
例えば、
<a name="Conductor, "neutral""></a>
また
<meta name="keywords" content="Conductor, "hot",Conductor, "neutral",Hot wire,Neutral wire,Double insulation,Conductor, "ground",Ground fault,GFCI,Ground Fault Current Interrupter,Ground fault,GFCI,Ground Fault Current Interrupter,Arc fault circuit interrupter,Arc fault breaker,AFCI," />
また
<b>Table of Contents:</b><ul class="xoxo"><li><a href="1.html" title="Page 1: What are "series" and "parallel" circuits?">What are "series" and "parallel" circuits?</a>
XML::Twig
を使用してPerlのモジュールでファイルを処理しようとしていますparsefile_html($file_name)
。この構文を持つファイルを読み取ると、次のエラーが発生します。
x has an invalid attribute name 'y""' at C:/strawberry/perl/site/lib/XML/Twig.pm line 893
私が必要としているのは、モジュールに不正な構文を受け入れて処理させる方法、または属性内の二重引用符を見つけて一重引用符に置き換える正規表現のいずれかです。