xml 変換を行っています。ここではルート タグを book として定義していますが、ここで定義されている不明なルート タグを取得するには、共通のシンテックスが必要です。
use twig;
my $story_file = XML::Twig->new(
twig_handlers =>{
'book' => \&book,
keep_atts_order => 1,
},
pretty_print => 'indented',
);
$story_file->parsefile('unknown.xml');
$story_file->print($out);
私は試した、
use twig;
my $story_file = XML::Twig->new(
twig_handlers =>{
root => \&book,
keep_atts_order => 1,
},
pretty_print => 'indented',
);
$story_file->parsefile('unknown.xml');
$story_file->print($out);
ルートタグのコマンドシンテックスがある場合は機能しませんでした。例を示してください