How to: Basic XML Parsing with Perl
"Stephen Christensen" <[email protected]>
| Newsgroups | gmane.text.xml.xerces-p.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi. I'm a high school student working at the University of Kentucky after
school most days on a research project. I'm working with the Computer
Science department, and my mentor has assigned me a project that involves
parsing XML.
Before I started on this research project, I had taken two semesters of C++,
and that's all. Now, I have made a couple of dozen programs with Perl,
several decent CGI applications, and messed around with Javascript and HTML.
To finish the research project, I need to be able to parse XML, preferably
with Perl. Specifically, I need to be able to take an XML document, parse
it, and make each node available for a user to edit.
My problem is this: I have no idea (programming-wise) what to do after
eval {$parser->parse ($file)};
I need to have a loop that analyzes each node of the document and seperates
it into sections based on the nodenames. However... I have no idea how to
do this. None of the samples on the Perl site seemed to help. Likewise,
there is no API, except a reference to the C++ API. I don't have enough
experience with either programming language to be able to figure out how to
parse with Perl. I've been banging my head against the wall the past month
trying to figure it out.
Finally, to my question. Can someone either give me a sample Perl file that
uses Xerces, or perhaps walk me through how to use it?
I apologize for how basic this question is... I'm ashamed to clutter the
developer mailing list with it. But really, I'm having great difficulty
finding any documentation for Xerces Perl.
Thanks a million for any help you can give,
~Stephen Christensen
Senior, Dunbar High School
_________________________________________________________________
Fast, faster, fastest: Upgrade to Cable or DSL today!
https://broadband.msn.com