Subject: | xml:lang attribute |
I wrote RSS.
My Perl Code is following.
-- Perl Code --
use IO;
use XML::Writer;
use Encode;
my $rssns = "http://purl.org/rss/1.0";
my $rdfns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
my $lang = "ja";
my $output = new IO::File(">output4.xml");
my $writer = new XML::Writer( OUTPUT => $output,
NAMESPACES => 1,
PREFIX_MAP =>{
$rdfns=>'rdf',
$rssns=>''
},
FORCED_NS_DECLS=>[
$rdfns,
$rssns
],
DATA_MODE=>true);
$writer->xmlDecl('UTF-8', 'yes');
$writer->startTag([$rdfns, 'RDF'], 'xml:lang'=>'ja');
$writer->startTag('channel', [$rdfns, 'about']=>"http://www.kanzaki.com/info/rss.rdf");
$writer->startTag('title');
$writer->characters('The Web KANZAKI - Japan, music and computer');
$writer->endTag();
$writer->startTag('link');
$writer->characters('http://www.kanzaki.com');
$writer->endTag();
$writer->startTag('description');
$writer->characters('abcdefg');
$writer->endTag();
$writer->startTag('items');
$writer->startTag([$rdfns, 'Seq']);
$writer->emptyTag([$rdfns, 'li'], [$rdfns, 'resource']=>"http://www.kanzaki.com/bass/");
$writer->emptyTag([$rdfns, 'li'], [$rdfns, 'resource']=>"http://www.kanzaki.com/docs/htminfo.html");
$writer->endTag();
$writer->endTag();
$writer->endTag();
$writer->endTag();
$writer->end();
------------------------
and Error is following.
-- Error ----------------
Attribute name 'xml:lang' contains ':'
------------------------