I can see the code and data samples, but I was not able to understand what exactly you are trying to achieve. For example, the following script processes both the input files (enhanced by the namespace declarations). I do not see any issue with the namespace - what exactly do you want to do with the elements in the dc namespace?
#!/usr/bin/perl
use warnings;
use strict;
use XML::LibXML;
my $xpc = 'XML::LibXML::XPathContext'->new;
$xpc->registerNs(x => 'http://checklists.nist.gov/xccdf/1.1');
$xpc->registerNs(dc => 'http://purl.org/dc/elements/1.1');
for my $file (glob '*.xml') {
print "# $file:\n";
my $string;
my $xml = 'XML::LibXML'->load_xml(location => $file);
$string .= $_ for $xpc->findnodes('/x:Group/x:Rule/x:check/x:check
+-content/text()',
$xml->documentElement);
print "$string\n";
}
|