Skip Menu |

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

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

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

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in:
  • 3.30
  • 3.31
  • 3.32



Subject: Feature Request: Getting Doctype Parts
XML::Twig has a method for setting parts of the DOCTYPE node and a method for retrieving the whole DOCTYPE node. There is no method to retrieve the individual parts of the DOCTYPE node from XML::Twig. XML::Twig already stores the parts of the DOCTYPE node separately. I'm including a patch that exposes these to the user. This will save the user of grabbing the whole DOCTYPE node and hitting it with more code. I'm a iffy on the method names, but I based them on similar packages (XML::Libxml, XML::Xerces). -- Brian J. Pugh
Subject: XML-Twig-3.29-get_doctype_parts.diff
diff -uNr XML-Twig-3.29.orig/Twig.pm XML-Twig-3.29/Twig.pm --- XML-Twig-3.29.orig/Twig.pm 2007-01-22 04:38:15.000000000 -0500 +++ XML-Twig-3.29/Twig.pm 2007-04-05 11:07:34.961174900 -0400 @@ -2424,6 +2424,30 @@ $doctype->{internal} = $internal if( defined $internal); } +sub get_doctype_name + { my $t= shift; + my $doctype= $t->{twig_doctype} or return ''; + return $doctype->{name} or return ''; + } + +sub get_system_id + { my $t= shift; + my $doctype= $t->{twig_doctype} or return ''; + return $doctype->{sysid} or return ''; + } + +sub get_public_id + { my $t= shift; + my $doctype= $t->{twig_doctype} or return ''; + return $doctype->{pub} or return ''; + } + +sub get_internal_subset + { my $t= shift; + my $doctype= $t->{twig_doctype} or return ''; + return $doctype->{internal} or return ''; + } + # return the dtd object sub dtd { my $t= shift;
Subject: Re: [rt.cpan.org #26137] Feature Request: Getting Doctype Parts
Date: Fri, 06 Apr 2007 20:11:58 +0200
To: bug-XML-Twig [...] rt.cpan.org
From: mirod <mirod [...] xmltwig.com>
admiral.grinder@gmail.com via RT wrote: Show quoted text
> Fri Apr 06 11:29:44 2007: Request 26137 was acted upon. > Transaction: Ticket created by admiral.grinder@gmail.com > Queue: XML-Twig > Subject: Feature Request: Getting Doctype Parts > Broken in: (no value) > Severity: Wishlist > Owner: Nobody > Requestors: admiral.grinder@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=26137 > > > > XML::Twig has a method for setting parts of the DOCTYPE node and a > method for retrieving the whole DOCTYPE node. There is no method to > retrieve the individual parts of the DOCTYPE node from XML::Twig. > XML::Twig already stores the parts of the DOCTYPE node separately. I'm > including a patch that exposes these to the user. This will save the > user of grabbing the whole DOCTYPE node and hitting it with more code. > > I'm a iffy on the method names, but I based them on similar packages > (XML::Libxml, XML::Xerces).
Thanks, I added the methods, removing the get_ part from their name, to be consistent with the rest of the API. -- mirod