James A. Pattie > business-payroll-1.3 > Business::Payroll::XML::Parser

Download:
payroll/business-payroll-1.3.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 1.2   Source  

NAME ^

Parser - The XML Configuration Parser Module.

SYNOPSIS ^

  use Business::Payroll::XML::Parser;
  my $obj = Business::Payroll::XML::Parser->new(periodNames => \%periodNames,
            validCountries => \%knownCountries);
  my $dataObj = $obj->parse(file => "config.xml");
  # this is a Data object.

DESCRIPTION ^

Parser will parse XML files that have been generated to the payroll specification. See the Business::Payroll::XML::Data man page for the structure of the returned data.

FUNCTIONS ^

(validCountries, periodNames) required: validCountries - hash ref of available countries, periodNames - hash ref of periods

Business::Payroll::XML::Data parse(file, string) Does the actual parsing of the XML file and generates the resulting data object and returns it.

    file points to the XML Config file to use.

    If you don't specify a file to work with then you must specify the
    xml via the string argument.  If you specify both, then the string
    will take precedence.  The file must still point to a valid file.

    returns: Business::Payroll::XML::Data instance with parsed info.

hash getAttributes(node) # requires: node - XPath Node # returns: hash of attributes for the specified node.

array getNodes(path, context) # required: path - XPath to search for # optional: context - the XPath object to base the search from. Make sure your path is relative to it! # returns: array - array of nodes returned. These are the XPath objects representing each node.

string getType(void) returns the type value from the parent <payroll> tag.

string getVersion(void) returns the version value from the parent <payroll> tag.

VARIABLES ^

  dataFile - The xml file name we are working with or the contents
               of the string of xml passed in.

  dataInVersion - The version of the input XML file we require.

  dataOutVersion - The version of the output XML file we require.

  dataObj - Data object that represents the xml file.

  xmlObj - The XML::LibXML object being used to parse the XML File.

  NOTE:  All data fields are accessible by specifying the object
         and pointing to the data member to be modified on the
         left-hand side of the assignment.
         Ex.  $obj->variable($newValue); or $value = $obj->variable;

AUTHOR ^

PC & Web Xperience, Inc. (mailto:admin at pcxperience.com)

SEE ALSO ^

perl(1), Business::Payroll::XML::Data(3)