Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

LibXML, XPath and Namespaces

by space_monk (Chaplain)
on Mar 21, 2013 at 14:42 UTC ( #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
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? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-12-21 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls