Skip Menu |
 

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

Report information
The Basics
Id: 72279
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: ambrus [...] math.bme.hu
Cc:
AdminCc:

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



Subject: Private method flush of XML::Twig::Elt used in code example in docs
Date: Tue, 8 Nov 2011 18:49:58 +0100
To: bug-XML-Twig [...] rt.cpan.org
From: Zsbán Ambrus <ambrus [...] math.bme.hu>
Download (untitled) / with headers
text/plain 656b
This is a bug report about an incorrect code example in the documentation of XML::Twig. In the documentation for the object methods of XML::Twig::Elt, you say that flush is a private method, and "always flush the twig, not an element". However, in the section "Processing an XML document chunk by chunk" you have a code example that seems to use this private method. It says $section->flush; # outputs the section and frees memory where $section is apparently the element the handler has triggered for. Please fix the example to use the documented interface only. This is about the documentation from XML-Twig version 3.39. Ambrus
Subject: Re: [rt.cpan.org #72279] Private method flush of XML::Twig::Elt used in code example in docs
Date: Tue, 8 Nov 2011 19:06:37 +0100
To: bug-XML-Twig [...] rt.cpan.org
From: Zsbán Ambrus <ambrus [...] math.bme.hu>
Download (untitled) / with headers
text/plain 474b
On Tue, Nov 8, 2011 at 6:50 PM, Bugs in XML-Twig via RT <bug-XML-Twig@rt.cpan.org> wrote: Show quoted text
> This is a bug report about an incorrect code example in the > documentation of XML::Twig.
PS. Interestingly, this code seems to parallel a bug in XML::LibXML. https://rt.cpan.org/Public/Bug/Display.html?id=59814 That resolved bug was also a typo in one of the code examples in the docs, and that too had the problem in the statement that writes the XML to an IO handle. Ambrus
Subject: Re: [rt.cpan.org #72279] Private method flush of XML::Twig::Elt used in code example in docs
Date: Tue, 08 Nov 2011 19:27:13 +0100
To: bug-XML-Twig [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
Download (untitled) / with headers
text/plain 1.4k
On 11/08/2011 06:50 PM, ambrus@math.bme.hu via RT wrote: Show quoted text
> Tue Nov 08 12:50:41 2011: Request 72279 was acted upon. > Transaction: Ticket created by ambrus@math.bme.hu > Queue: XML-Twig > Subject: Private method flush of XML::Twig::Elt used in code example in docs > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ambrus@math.bme.hu > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=72279> > > > This is a bug report about an incorrect code example in the > documentation of XML::Twig. > > In the documentation for the object methods of XML::Twig::Elt, you say > that flush is a private method, and "always flush the twig, not an > element". However, in the section "Processing an XML document chunk > by chunk" you have a code example that seems to use this private > method. It says > > $section->flush; # outputs the section and frees memory > > where $section is apparently the element the handler has triggered > for. Please fix the example to use the documented interface only. > > This is about the documentation from XML-Twig version 3.39.
Thanks, Actually you can use flush on an element, I use it quite often with "inline handlers" to write section => sub { $_->flush } instead of the uglier section => sub { $_[0]->flush } I changed the doc for flush to: flush flushes the twig up to the current element (strictly equivalent to C<< $elt->root->flush >>) Thanks for spotting the mistake. -- mirod


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.