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.
In reply to XML Transaction - random access. by tomazos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |