Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Extract a string from the line

by choroba (Cardinal)
on May 29, 2021 at 09:32 UTC ( [id://11133254]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use XML::LibXML;
    
    my $dom = 'XML::LibXML'->load_xml(location => 'file.xml');
    my $digits = $dom->findvalue('//stlib:mem_bit');
    print $digits, "\n";
    
  2. or download this
    <r xmlns:stlib="http://stlib.xml.ns">
      <ch>
        <stlib:mem_bit>72</stlib:mem_bit>
      </ch>
    </r>
    
  3. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    $xpc->registerNs(s => 'http://stlib.xml.ns');
    my $digits = $xpc->findvalue('//s:mem_bit', $dom);
    print $digits, "\n"
    

Log In?
Username:
Password:

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

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

    No recent polls found