The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

XML::Hash - Converts from a XML into a Hash.

SYNOPSYS

my $xml_converter = XML::Hash->new();

# Convertion from a XML String to a Hash
my $xml_hash = $xml_converter->fromXMLStringtoHash($xml);

# Convertion from a Hash back into a XML String
my $xml_str = $xml_converter->fromHashtoXMLString($xml_hash);

#  Convertion from a XML::DOM::Document into a HASH
$xml_hash = $xml_converter->fromDOMtoHash($xml_doc);

# Convertion from a HASH back info a XML::DOM::Document
my $xml_doc = $xml_converter->fromHashtoDOM($xml_hash);

DESCRIPTION

Simplifies the XML manipulation of documents by converting XML to perl Hashes.

You can manipulate the perl Hash and dump back to XML file. It accepts strings as well as XML::DOM::Documents. Also provides reverse methods that convert the Hash back into string/XML::DOM::Documents.

The interface it is OO based and extents XML::Simple functionality.

METHODS

new
Constructor: passes the default options to XML::Simple superclass
fromDOMtoHash
Converts from XML::DOM::Document to a Hash

$self->fromDOMtoHash($doc)
fromHashtoDOM
Converts from a HASH into XML::DOM::Document

$self->fromHashtoDOM($hash)
fromXMLStringtoHash
Converts from a XML String to a Hash

$self->fromXMLStringtoHash($str)
fromHashtoXMLString
Converts from a Hash into a XML String

$self->fromHashtoXMLString($hash)

AUTHOR

Luis Azevedo, <braceta@cpan.org>

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc XML::Hash

COPYRIGHT & LICENSE

Copyright 2008 Luis Azevedo, all rights reserved.

This program is free software licensed under the BSD License

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