XML::Mini::Element is a Perl implementation of the XML::Mini Element API.
SYNOPSIS
use XML::Mini::Document;
my $xmlDoc = XML::Mini::Document->new();
# Fetch the ROOT element for the document
# (an instance of XML::Mini::Element)
my $xmlElement = $xmlDoc->getRoot();
# Create an tag
my $xmlHeader = $xmlElement->header('xml');
# add the version to get
$xmlHeader->attribute('version', '1.0');
# Create a sub element
my $newChild = $xmlElement->createChild('mychild');
$newChild->text('hello mommy');
# Create an orphan element
my $orphan = $xmlDoc->createElement('annie');
$orphan->attribute('hair', '#ff0000');
$orphan->text('tomorrow, tomorrow');
# Adopt the orphan
$newChild->appendChild($orphan);
# ...
# add a child element to the front of the list
$xmlElement->prependChild($otherElement);
print $xmlDoc->toString();
The code above would output:
< ?xml version="1.0" ? > < mychild > hello mommy < annie hair="#ff0000" > tomorrow, tomorrow < /annie > < /mychild >
Product's homepage
Requirements:
· Perl