Search notes:

Perl module XML::LibXML

use XML::LibXML;
use strict;
use warnings;
my $parser = XML::LibXML->new;

my $xmlp= $parser -> parse_file("stackoverflow_17722520.xml");
my $rootel = $xmlp -> getDocumentElement();

my $elname = $rootel -> getName();
my @rootelements=$rootel -> getAttributes();


foreach my $rootatt(@rootelements){
    my  $name = $rootatt -> getName();
    my $value = $rootatt -> getValue();
    print " ${name}[$value]\n ";
}

my @kids = $rootel -> childNodes();
foreach my $child(@kids) {
# print "\nchild: $child\n";
  my @grand_kids = $child -> childNodes();

  foreach my $grand_kid (@grand_kids) {

    my $elname = $grand_kid -> getName();
    my @atts = $grand_kid -> getAttributes();
    foreach my $at (@atts) {
        print "--\n";
        my $name = $at -> getName();
        my $value = $at -> getValue();
        print "   ${name}[$value]\n ";

    }
  }
}
Github repository PerlModules, path: /XML/LibXML/script.pl

See also

Perl modules
XML

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759391026, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/XML/LibXML/index(76): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78