in reply to Re: Create Mixed Content with XML::LibXML
in thread Create Mixed Content with XML::LibXML

As code:

my $term1 = XML::LibXML::Element->new('term'); $term1->appendTextNode('Einführung'); my $term2 = XML::LibXML::Element->new('term'); $term2->appendTextNode('Soziologie'); my $head = XML::LibXML::Element->new('head'); $head->addChild($term1); $head->appendTextNode(' in die '); $head->addChild($term2);

(Pay attention to the notes for addChild in the docs.)

Replies are listed 'Best First'.
Re^3: Create Mixed Content with XML::LibXML
by Anonymous Monk on Apr 14, 2011 at 15:22 UTC
    thank you both, i didn't know i could just add a text node inbetween those two nodes. thanks a lot!