NAME

Spreadsheet::XLSX::Reader::LibXML::XMLReader - A LibXML::Reader xlsx base class

SYNOPSIS

	package MyPackage;
	use MooseX::StrictConstructor;
	use MooseX::HasDefaults::RO;
	extends	'Spreadsheet::XLSX::Reader::LibXML::XMLReader';
    

DESCRIPTION

This documentation is written to explain ways to use this module when writing your own excel parser. To use the general package for excel parsing out of the box please review the documentation for Workbooks, Worksheets, and Cells

This module provides a generic way to open an xml file or xml file handle and then extract information using the XML::LibXML::Reader parser. The class does this by using delegation from the ~::Reader module to import useful functions to this module. Aside from the delegation piece this module provides four other useful elements. First, the module has an attribute to load the file or file handle and uses coercion to turn a file into a file handle from the Types library. Second, the module has an attribute to store an error handler. Third, the module provides a rewind function since that is not available in the XML::LibXML::Reader parser. Finally, this module has a hook for classes that extend this functionality during the initial build. The initialization of the file will also attempt to call '_load_unique_bits'. It will only call that method once on initialization.

Further use of the module or specialization of the reader can be done by extending the class.

Attributes

Data passed to new when creating an instance. For modification of these attributes see the listed 'attribute methods'. For general information on attributes see Moose::Manual::Attributes. For ways to manage the instance when opened see the Methods.

file

    Definition: This attribute holds the file handle for the file being read. If the full file name and path is passed to the attribute it is coerced to an IO::File file handle.

    Default: no default - this must be provided to read a file

    Required: yes

    Range: any unencrypted xml file name and path or file handle

    attribute methods Methods provided to adjust this attribute

      set_file

        Definition: change the file value in the attribute (this will reboot the file instance and lock the file)

      get_file

        Definition: Returns the file handle of the file even if a file name was passed

      has_file

        Definition: this is used to see if the file loaded correctly.

      clear_file

        Definition: this clears (and unlocks) the file handle

error_inst

    Definition: This attribute holds the error handler .

    Default: no default - this must be provided to read a file

    Required: yes

    Range: any object instance that can provide the required delegated methods.

    delegated methods Methods provided delegated by the attribute

      error

        Definition: returns the stored error string

      set_error

        Definition: Sets the error string

      clear_error

        Definition: clears the error string

      set_warnings

        Definition: Sets the state that determins if the instance pro-activly warns with the error string when the error string is set.

      if_warn

        Definition: Returns the current state of the state value from 'set_warnings'

Class Methods

These are the methods provided by this class. They most likely should be agumented with file specific methods when extending this module.

start_the_file_over

    Definition: This will disconnect the XML::LibXML::Reader from the file handle, rewind the file handle, and then reconnect the XML::LibXML::Reader to the file handle.

    Accepts: nothing

    Returns: nothing

Delegated Methods

These are the methods delegated to this class from XML::LibXML::Reader. For more general parsing of subsections of the xml file also see Spreadsheet::XLSX::Reader::LibXML.

copy_current_node

Delegated from: "copyCurrentNode (deep)" in XML::LibXML::Reader

byte_consumed

Delegated from: "byteConsumed ()" in XML::LibXML::Reader

start_reading

Delegated from: "read ()" in XML::LibXML::Reader

next_element

Delegated from: "nextElement" in XML::LibXML::Reader

node_type

Delegated from: "nodeType" in XML::LibXML::Reader

node_name

Delegated from: "name" in XML::LibXML::Reader

node_value

Delegated from: "value" in XML::LibXML::Reader

has_value

Delegated from: "hasValue" in XML::LibXML::Reader

node_depth

Delegated from: "depth" in XML::LibXML::Reader

move_to_first_att

Delegated from: "moveToFirstAttribute" in XML::LibXML::Reader

move_to_next_att

Delegated from: "moveToNextAttribute" in XML::LibXML::Reader

encoding

Delegated from: "encoding ()" in XML::LibXML::Reader

SUPPORT

TODO

    1. Nothing currently

AUTHOR

Jed Lund
jandrew@cpan.org

COPYRIGHT

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

The full text of the license can be found in the LICENSE file included with this module.

This software is copyrighted (c) 2014, 2015 by Jed Lund

DEPENDENCIES

SEE ALSO