Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

LibXML, XPath and Namespaces

by space_monk (Chaplain)
on Mar 21, 2013 at 14:42 UTC ( [id://1024765]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    <?xml version="1.0"?>
    <GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
    ...
    <!-- A valid Body payload with a namespace declaration on the first el
    +ement -->
    </Body>
    </GovTalkMessage>
    
  2. or download this
       my $dom = XML::LibXML->load_xml( string => $xml);
       my $xc = XML::LibXML::XPathContext->new($dom);
       $xc->registerNs( 'gt', 'http://www.govtalk.co.uk/CM/envelope');
       $envelopeVersion = $xc->findvalue( '//gt:EnvelopeVersion');
    

Log In?
Username:
Password:

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

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

    No recent polls found