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

Attachments


Subject: Feature Request: Getting Doctype Parts
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1175873358-16610-10"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 533
Download (untitled) / with headers
text/plain 533b
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
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1175873338-16449-7"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: application/octet-stream; name="XML-Twig-3.29-get_doctype_parts.diff"
Content-Disposition: inline; filename="XML-Twig-3.29-get_doctype_parts.diff"
Content-Transfer-Encoding: base64
Content-Length: 936
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;
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS
In-Reply-To: <rt-3.6.HEAD-16610-1175873385-464.26137-4-0 [...] rt.cpan.org>
Received-SPF: neutral (x1.develooper.com: local policy)
References: <RT-Ticket-26137 [...] rt.cpan.org> <rt-3.6.HEAD-16610-1175873385-464.26137-4-0 [...] rt.cpan.org>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 549634D8265 for <bug-XML-Twig [...] rt.cpan.org>; Fri, 6 Apr 2007 14:03:31 -0400 (EDT)
Received: (qmail 21607 invoked by alias); 6 Apr 2007 18:03:30 -0000
Received: from jack.tiscali.it (HELO jack.tiscali.it) (213.205.33.53) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 06 Apr 2007 11:03:25 -0700
Received: from [192.168.2.200] (217.133.3.216) by jack.tiscali.it (7.2.079) id 45E582FD005D441A for bug-XML-Twig [...] rt.cpan.org; Fri, 6 Apr 2007 20:03:18 +0200
Delivered-To: cpan-bug+xml-twig [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #26137] Feature Request: Getting Doctype Parts
User-Agent: Thunderbird 1.5.0.10 (X11/20070306)
Return-Path: <mirod [...] xmltwig.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-XML-Twig [...] rt.cpan.org
Date: Fri, 06 Apr 2007 20:11:58 +0200
Message-Id: <46168D6E.4070705 [...] xmltwig.com>
To: bug-XML-Twig [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: mirod <mirod [...] xmltwig.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-16449-1175882621-1678.26137-0-0 [...] rt.cpan.org>
Content-Length: 1105
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


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.