#!/usr/bin/perl use strict; use warnings; use XML::Twig; use Data::Dumper; my $xml = qq|<?xml version="1.0" encoding="ISO-8859-1"?> <CustDetails> <CustName>Unix</CustName> <CustomerId>999</CustomerId> <Age>28</Age> </CustDetails> |; my $t= XML::Twig->new( twig_handlers => { 'CustDetails/CustomerId' => sub { $_->pri +nt } } ) ->parsefile($xml); warn Dumper $t;
In reply to Parsing XML by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |