<<

NAME

Feed::Parser::NS

DESCRIPTION

This is the base class for extension namespaces. Namespace classes are never instantiated and do not provide objects.

CLASS METHODS

deserializers

Returns a list of modules implementing the Feed::Parser::Deserializer interface that this module requires to function.

feed_keys

Returns a list of "ELEMENT PATTERNS" that are valid in the feed or channel element.

item_key

Returns a regexp that will match an item or entry element. See the "ma" entry in "ELEMENT PATTERNS" for details on what this regexp should look like.

ignore_keys

Returns a list of regexps that will match elements that should be ignored. See the "ma" entry in "ELEMENT PATTERNS" for details on what this regexp should look like.

item_keys

Returns a list of "ELEMENT PATTERNS" that are valid in the item or entry element.

ELEMENT PATTERNS

These look like:

    ['link'           => {ma=>qr[<>rss/<>channel/<>link]}],

These are array references. The first array entry is the NAME under which elements that match this pattern should be stored. The second entry is a hash reference that looks like:

  {ma=>qr[...],s=>'...',t=>'...'}
ma

This is a regexp that is matched against the current tag path, including name spaces. Each tag in the path is seperated by a "/". The namespace is prepended to the tagname and wrapped in < and >. This means:

 <rss>
   <channel>
     <link>...</link>
   </channel>
 </rss>
A pattern that matches the link tag would look like:

 qr[<>rss/<>channel/<>link]
These regexps are always matched as if they were written with "^" at the start and "$" at the end. That is, they must match the entire tag path.

s

This describes how the data in this element is serialized. This name must be the name of a method in Feed::Parser::Deserializer or one of the modules returned by the deserializers method. If no deserializer is specified then it defaults to "content".

Some deserializers will read additional arguments from the hash. For instance the "attr" deserializer will look at the "attr" hash key and the "map" hash key.

t

This describes where and how the data should be stored after it has been deserialized. Options are:

list

This is used when the element may show up multiple times. Each element is pushed onto an arrayref.

hash

Elements are stored on the parent element, using it as a hash. They are stored the same way attributes are stored.

hash_list

The same as hash except that the value is pushed onto an arrayref. Basically it works like list except that its adding to the parent element instead of the current feed or item element.

list_append

This is a weirdo that was added to support iTunes categories. If it is given a "to" attribute then it will append to the value of its parent element's attribute as named in "to". Otherwise it will append to its parent element's content. It appends "/" + its value. Probably the "/" should be configurable as well.

scalar

This is the default. If more then one element with the same key shows up then the bozo flag is set and details are stored there. Only the first element is stored.

<<