Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Adjacency List Processing in XML::Twig

by princepawn (Parson)
on Aug 18, 2001 at 15:20 UTC ( #105906=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    <border_list>
    
    ...
    <pair><city>hillesdale</city><city>san mateo</city></pair>
    
    </border_list>
    
  2. or download this
    use XML::Twig;
    
    ...
    # print them out in a human-readable form
    map { $_->print } @adj;
    
  3. or download this
      <pair>
        <city>menlo park</city>
    ...
        <city>atherton</city>
        <city>menlo park</city>
      </pair>
    
  4. or download this
    # this routine takes a search text and a list of XML elements and
    # searches them for the text
    ...
        my ($search_text, @data) = @_;
        grep { grep { $_->text eq $search_text } $_->children  } @data;
    }
    
  5. or download this
    <city>boise</city>
    
  6. or download this
    <pair><city>mountain view</city><city>sunnyvale</city></pair>
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-30 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls