Learning XML::LibXML::XPathContext

N

Nene

Hi,
I'm learning this module today and I'm getting 'invalid expression' every time I run it. The error seems to be related to my syntax/code rather than the contents of the test.xml file. Any help would be greatly appreciated, thank you in advance.



#!/usr/local/bin/perl
use warnings;
use Data::Dumper;
use XML::LibXML;


my $parser = XML::LibXML->new();
my $xc = $parser->parse_file("test.xml");


my $xpc = XML::LibXML::XPathContext->new($xc);


my @x = $xpc->find('/Something//Child::*');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top