Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: rishid [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.545
Fixed in: (no value)



Subject: Ancestor function
I found a small bug in the ancestor function of Writer. I don't even understand why it is happening .... this is the code I am using to create a simple Xpath to where the writer is. I can't seem to figure out why it adds the same element twice... here is a simple script that shows the bug. use XML::Writer; use IO::File; use strict; my $output = new IO::File(">test.xml"); my $writer = new XML::Writer(OUTPUT => $output, DATA_MODE => 1, DATA_INDENT => 1); $writer->startTag("ROOT"); $writer->startTag("NODE1"); $writer->startTag("NODE2"); my $n = 0; my $xpath; while ($writer->ancestor($n)) { $xpath = "/" . $writer->ancestor($n) . $xpath; print "$n -- " . $writer->ancestor($n) . " -- $xpath\n"; $n++; } $writer->endTag(); $writer->endTag(); $writer->endTag(); $writer->end(); $output->close();