Ringing::XML::Methods
NAME
Ringing::XML::Methods - parse and access XML method collections
SYNOPSIS
use Ringing::Methods; $methods = new Ringing::Methods('my-collection.xml'); foreach ($methods->methods) { # Do something };
DESCRIPTION
This module parses an XML structure containing a collection of methods, and gives access to the data in it.
XML SCHEMA
For information on the XML structures which this module understands, see the documentation at http://methods.ringing.org/xml.html.
In particular, all the elements discussed belong in the namespace associated to the URL
http://methods.ringing.org/NS/method
which is also the value of the string $Ringing::Method::ns
.
CONSTRUCTOR
$methods = new Ringing::XML::Methods ('filename.xml'); $methods = new Ringing::XML::Methods ($document); $methods = new Ringing::XML::Methods ($node);
The constructor for this class takes a single argument, which should be one of:
-
a string containing the filename of an XML file, which contains a document whose document element is a <methods> element;
-
an XML::LibXML::Document object containing such a document;
-
an XML::LibXML::Element object containing a <methods> element.
FUNCTIONS
methods
@method_list = $methods->methods;
This function returns a list of Ringing::Method objects, one for each method in the collection, in document order.
size
$n = $methods->size;
This function returns the number of methods in the collection.
node
$node = $methods->node;
This function returns the underlying <methods> element node containing the method collection. It is an XML::LibXML::Element object.
SEE ALSO
Ringing::XML::Library, Ringing::XML::Method
AUTHOR
Martin Bright <martin@boojum.org.uk>
COPYRIGHT AND LICENCE
Copyright (C) 2004 Martin Bright
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.