Skip Menu |

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

Report information
The Basics
Id: 24927
Status: open
Priority: 0/
Queue: XML-Atom

People
Owner: Nobody in particular
Requestors: takeru.inoue+perl [...] gmail.com
Cc:
AdminCc:

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



Subject: Namespace of XML::Atom::Category should be independent from its parent element
I implemented XML::Atom::Service, that supports Service/Category Documents defined in Atom Publishing Protocol (APP). I found that the namespace of XML::Atom::Category is defined by its parent element, but it seems strange. In XML::Atom::Category ver.0.25, the parent namespace is inherited since XML::Atom::Category::element_ns returns undef. However, category and its parent (categories) must be different namespaces; category element is in http://purl.org/atom/ns# or http://www.w3.org/2005/Atom, while categories element is in http://purl.org/atom/app# . It's better that XML::Atom::Category::element_ns would return its namespace explicitly, as follows. sub XML::Atom::Category::element_ns { $XML::Atom::Util::NS_MAP{$XML::Atom::DefaultVersion} };
I'll make this change once I can confirm this is the right fix. Can you quote from Atom RFC spec confirming this is correct? A test patch for this would be nice too.
From: takeru.inoue+perl [...] gmail.com
Thank you for your response. But now, I think there is no perfect solution for this issue and the current implementation is better. In XML::Atom, XML element must inherit the namespace from their parents. This is because XML::Atom handles two namespaces "http://www.w3.org/2005/Atom" and "http://purl.org/atom/ns#", and namespace of each XML element can't be defined statically. On the other hand, XML::Atom::Service uses just a single namespace "http://www.w3.org/2005/Atom" based on the Internet-Draft, and the namespace can be defined statically like: --- XML::Atom::Service --- sub XML::Atom::Category::element_ns { $XML::Atom::Util::NS_MAP{$XML::Atom::DefaultVersion}; } --- If XML::Atom defined namespace like this, it couldn't handle the other namespace.