Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: ovid [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.600
Fixed in: 0.601



Subject: Broken namespace report
use XML::Writer; my $t_param = [ 'uri:test', 'parameter' ]; my $writer = XML::Writer->new( NAMESPACES => 1, OUTPUT => \my $xml, PREFIX_MAP => { 'uri:test' => 'test' }, ); $writer->startTag($t_param); $writer->characters('name eq "foo"'); $writer->endTag; $writer->startTag($t_param); # this has the error $writer->characters(20); $writer->endTag; $writer->end; print $xml; That generates the error: Element name 'test:parameter' contains a colon. at xml.pl line 15 Note that it's the *second* instance of that which causes the error. Comment out that line and the next two lines and it creates valid XML. In response to an email about this, another person wrote: Yes, the problem is that startTag *modifies* the array ref passed to prefx:localname so the second time round you are just passing the prefixed string. Work around is easy: my $ns = 'uri:test'; $writer->startTag([ $ns, 'parameter' ]) Being forced to constantly use the latter syntax makes it more difficult to factor out the common bits. Cheers, Ovid
Download (untitled) / with headers
text/plain 129b
Acknowledged as a bug, test case committed to CVS. I'll fix it when I have a chance to look at it, but feel free to send a patch.
Download (untitled) / with headers
text/plain 194b
On Mon Oct 10 17:17:39 2005, JOSEPHW wrote: Show quoted text
> Acknowledged as a bug, test case committed to CVS. I'll fix it when I > have a chance to look at it, but feel free to send a patch.
Fixed in 0.601.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.