The documentation seems perfectly clear to me ... here's an example
use XML::Mini::Document; my $newDoc = XML::Mini::Document->new(); my $root = $newDoc->getRoot(); my $header = $root->header('xml'); # set the header $header->attribute('version', '1.0'); my $kid = $root->createChild('foo'); $kid->text("Yes, I am a kid"); $root->createChild('foo')->text('Me Too'); print $newDoc->toString(); __END__ <?xml version="1.0"?> <foo> Yes, I am a kid </foo> <foo> Me Too </foo>
Holler if this ain't clear for you, but be sure to provide more context (and show that you've read the documentation, cause the documentation is thorough).

update: I can see now (through ESP) how you might be confused. The text methods APPENDS (appends) values to an element. The only way to get at the XML::Mini::Node's is to cheat and look at an XML::Mini::Element's _children attribute. The XML::Mini API is thus flawed and for no apparent reason.

update: I've added this to Feature Requests.
[ 712722 ] missing a XML::Mini::Element method to set text

package XML::Mini::Element; sub insertNode { splice @{ $_[0]->{_children} }, $_[1], 0, $_[2]; return $_[2]; } sub prependNode { unshift @{ $_[0]->{_children} }, $_[1]; return $_[1]; } sub removeNode { return splice @{ $_[0]->{_children} }, $_[1], 1; } sub removeAllNodes { my $kids = $_[0]->{_children}; $_[0]->{_children} = []; return $kids; } sub getAllNodes { return $_[0]->{_children}; }


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Altering values in XML-mini by PodMaster
in thread Altering values in XML-mini by AndyH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.