Skip Menu |

This queue is for tickets about the XML-Writer CPAN distribution.

Report information
The Basics
Id: 12736
Status: resolved
Priority: 0/
Queue: XML-Writer

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.531
Fixed in: (no value)



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 ':' ------------------------
[guest - Tue May 10 03:58:04 2005]: Show quoted text
> I wrote RSS. > My Perl Code is following.
... Show quoted text
> $writer->startTag([$rdfns, 'RDF'], 'xml:lang'=>'ja');
You need to supply the namespace URI separate from the local name, even for the 'xml:' prefix. Use: Show quoted text
> $writer->startTag([$rdfns, 'RDF'],
['http://www.w3.org/XML/1998/namespace', 'lang']=>'ja');