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 ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-19 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found