tomazos has asked for the wisdom of the Perl Monks concerning the following question:
Rather than write my own parser, I want to resuse XML::Parser or whatever is appropriate. I want it to be able to parse the above into an object such that I can randomly access elements in it.<?xml version='1.0' encoding='ISO-8859-1'?> <transactionUpdate xmlns='http://www.mypayproc.com/transaction'> <!-- This email is to let you know blah blah blah. --> <transaction> <theTID>GH95QFEFAC80</theTID> <registerTo>John Citizen</registerTo> <customerEmails> oldjohn@citizen.com </customerEmails> </transaction> <updatedInformation dateOfChange='2001-6-25'> <customerEmails> newjohn@citizen.com </customerEmails> <customerEmail>newjohn@citizen.com</customerEmail> </updatedInformation> </transactionUpdate> <!-- END XML FILE -->
I have seen code that parses it and just prints it out again, but not one that functions as a real object factory. I am pretty sure XML::Parser can do this - but never seen a code example of it actually being done.
Does anyone know how to make XML::Parser act as an object factory? Example code appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML Transaction - random access.
by andreychek (Parson) on Jun 29, 2001 at 22:41 UTC | |
by epoptai (Curate) on Jun 30, 2001 at 00:28 UTC | |
|
Re: XML Transaction - random access.
by mirod (Canon) on Jun 30, 2001 at 12:40 UTC | |
|
Re: XML Transaction - random access.
by toma (Vicar) on Jun 30, 2001 at 22:25 UTC | |
|
Re: XML Transaction - random access.
by Anonymous Monk on Jul 01, 2001 at 06:32 UTC |