Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

XML::LibXML and namespaces

by Anonymous Monk
on Nov 09, 2012 at 09:29 UTC ( #1003089=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $parser = XML::LibXML->new->parse_file($file);
    my $xml = XML::LibXML::XPathContext->new($parser);
    $xml->registerNs($string,'http://www.garmin.com/xmlschemas/TrainingCen
    +terDatabase/v2');
    
  2. or download this
    for my $key ($xml->findnodes('//x:Lap')) {
     $string = norm_date($key->findvalue("\@StartTime"));
    }
    
  3. or download this
    for my $node ($xml->findnodes('//y:Trackpoint')) {
     $time = $node->findvalue("Time");
     push @X,$time;
    }
    
  4. or download this
    for my $node ($xml->findnodes("//y:Trackpoint")) {
     for my $ch ($node->childNodes) {
    ...
     }
     push @X,$time;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-21 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (104 votes), past polls