Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hello! I'm a brand new to Perl, but not to programming.

So far, I'm able to read in and parse and XML doc to the screen, but I'm currently at a loss as what to do next. I've been searching for some help, but am a little directionless as all-things-Perl is too new for me yet. I probably passed by some good help and didn't know it already...

Here what I'm trying to do:

- Load in an XML file
- Parse the file and look for content in it (recordsets)
- Take those records that match certain criteria and
WRITE them to a new XML file on the server.
- Do this about 30 times, for different criteria, from the master XML file from the first step.


As of yet, I can't find a way to do this. I'm not looking for hand-holding, but some good info or tips or tutorials to get me going, so I can then formulate the next intelligent question.

I started from ground zero today, with utterly no knowledge of Perl. I got it running on my PC and got this far (which to me was a LOT):

#!/usr/local/bin/perl -w use warnings; use XML::Parser; my $p1 = new XML::Parser(Style => 'Debug'); $p1->parsefile('test.xml');

Thanks,

Doug

In reply to Help with XML Parsing by dbonneville

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (9)
As of 2024-04-23 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found