Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: missperception of XML::LibXML

by ikegami (Patriarch)
on Oct 17, 2011 at 19:31 UTC ( [id://931994]=note: print w/replies, xml ) Need Help??


in reply to missperception of XML::LibXML

#!/usr/bin/perl use strict; use warnings; use XML::LibXML qw( ); my $file = $ARGV[0]; my $parser = XML::LibXML->new(); my $dom = $parser->parse_file($file); my $root = $doc->documentElement(); for my $psr_node ($root->findnodes('//ParagraphStyleRange')) { if ($psr_node->getAttribute('AppliedParagraphStyle') =~ /BODY TEXT/ +) { my ($content_node) = $psr_node->findnodes('CharacterStyleRange/C +ontent') or die; say $content_node->textContent() } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://931994]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found