View on
Fotango Ltd > Froody-42.034 > Froody::Structure



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source   Latest Release: Froody-42.041_2


Froody::Structure - object representing the structure used by the response


  # abstract class, see Froody::Method or Froody::ErrorType




Create a new reflection object

match_to_regex( "*" )

Class method that returns a regular expression that will determine if a string matches the specification passed in



A hash reference containing the specification of how the data that will be returned will be aranged - essentially the blueprint for constructing the response.

You probably don't want to create these by hand; The Froody::API::XML module will create these given a suitable example. See that module documentaion for more info.

The structure is a simple hash with a 'xpath' style key pointing to a hash containing elts (elements) and attr (attributes) arrayrefs.

 { 'people' =>
       { attr => ['group'],
         elts => [qw/person/],
   'people/person' =>
       { elts => [qw/name/],
         attr => [qw/nick number/],
         text => 0,
         multi => 1,

elts should contain a list of all elements under this node. Each one of these elements will require a further entry in the hash unless the element contains only text and cannot be repeated (for example, the title and description in the above data structure are like this.)

The hashrefs may also contain other flags. The text flag can be used to indicate if it is valid for this node to contain text or not. The multi flag is used to indicate if there can be repeate occurances of the elements.

This would mean that the above data structure would validate this XML structure:

 <people group="frameworks" />
   <person nick="clkao" number="243">
     <name>Chia-liang Kao</name>
   <person nick="Trelane" number="234">
     <name>Mark Fowler</name>
   <person nick="Nichloas" number="238">
     <name>Nicholas Clark</name>
   <person nick="nnunley" number="243">
     <name>Norman Nunley</name>
   <person nick="skugg" number="214">
     <name>Stig Brautaset</name>
   <person nick="jerakeen" number="235">
     <name>Tom Insam</name>
   Frameworks is a department of Fotango.  We work on lots of
   software, including writing tools like Froody.

An example of the response we expect to see when this is rendered. This should be a Froody::Response object.


None known.

Please report any bugs you find via the CPAN RT system.


Copyright Fotango 2005. All rights reserved.

Please see the main Froody documentation for details of who has worked on this project.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Froody, Froody::Repository, Froody::Method, Froody::ErrorType

syntax highlighting: