Find Jobs
Hire Freelancers

perl script or module to generate an XML fragment

$30-5000 USD

Closed
Posted about 18 years ago

$30-5000 USD

Paid on delivery
I'm trying to write an application that sends questions to a server that speaks XML, and understands the replies that come back. Everything is specified in XML, including the format of the commands I can issue to the remote server. On this web page: [login to view URL] are several XML documents, including:- [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] Together - they form the basis of specifications for my project. I require a perl script which parses the above documents, and makes available to me a single perl function - &generateXML() - which I can call to generate XML output, as per the above specs. For example, in [login to view URL], we find this definition of the things we can do - including issue a simple , or send a :- Here is an example of my calling perl script:- #!perl use XML::Your_Module; print &generateXML('epp::hello'); Here is what the output of my program must look like:- [See below (deliverables) for additional information] ## Deliverables [...continued from "Description" above] Again - from [login to view URL] - we find the following definition:- If I issue this from my script:- print &generateXML('epp::command::login', 'clID' => 'chrisdrake', 'pw' => 'foobar', 'options' => \%options, 'svcs' => \%svcs); Here is the output I expect to see:- chrisdrake foobar 1.0 en-AU urn:ietf:params:xml:ns:xriAU urn:ietf:params:xml:ns:xriINU urn:ietf:params:xml:ns:xriINA urn:ietf:params:xml:ns:xriISV urn:ietf:params:xml:ns:xri idcommons ... and so on. Because the sub &generateXML() is XML-driven, it must also therefore be able to return verbose and useful errors to me if - for example - I tried to do this:- print &generateXML('epp::command::login','version'=>'test'); ...because the XML specification for the command knows there is no such element 'version', and further, that the required elements 'clID, pw, options, and svcs are missing. I'd expect to see an error like "error calling epp::command::login. element 'version' was specified by does not exist. element 'clID' is missing. element 'pw' is missing. element 'options' is missing. element 'svcs' is missing. (yes - I realize that it looks like there's a element inside the one - but that's not a variable - it's a fixed numeric constant of '1.0' in the specs. There is no paramater supplyable to ) Ideally - I would also like to be able to read responses to my XML commands too - so it would be nice to have a perl function &readXML() to do this. For example - again from [login to view URL] - we find this:- So my perl script:- my %data=&readXML($xmltext); print $data{'greeting'}{'svDate'}; should output the following text:- 2006-04-12T13:14:22.0Z (assuming $xmltext contained a valid XML reply from the server) Deliverables:- 1) perl script or module, with working examples 2) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 3) Deliverables must be in ready-to-run condition 4) All deliverables will be considered "work made for hire" under U.S. Copyright law. ## Platform Linux, Perl I do not know XML very well, but the CPAN module "XML::LibXML" looks like it might be handy for this? Update: No: I LibXML doesn't look like it works or is complete. My example scripts above are just a guide - if you prefer to use object-oriented notation, that is also acceptable (providing you supply sufficient example test cases for me to grasp how to use your code).
Project ID: 3487265

About the project

1 proposal
Remote project
Active 18 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $26 USD for this job
User Avatar
See private message.
$25.50 USD in 14 days
5.0 (3 reviews)
1.0
1.0

About the client

Flag of UNITED STATES
Houston, United States
5.0
90
Payment method verified
Member since Feb 19, 2012

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.