in reply to Need help with converting a text file to XML

You could play around with SOAP::Lite's debugging hooks to try to get access to raw XML text of the message. Alternately, you could pass the parsed data-structure to XML::Simple's XMLout() routine, which will give you the rough equivalent.

-sam

  • Comment on Re: Need help with converting a text file to XML

Replies are listed 'Best First'.
Re^2: Need help with converting a text file to XML
by perlchild (Acolyte) on Jun 21, 2007 at 18:38 UTC
    Thanks sam,
    I messed around with XMLout() before and did not get very far but after reading your post I thought I may revisit that method.
    So I came up with this that works for the time being. It just places the plain text attributes in <opt> </opt> tags but that is okay for now. Here is my client code that calls a soap server that implements two functions to convert temp between celcius and farenheit. #!/usr/bin/perl -w use SOAP::Lite; use XML::Simple; $xmlS = new XML::Simple; my $soap = SOAP::Lite -> uri('http://<fubared host>/Temperatures') -> proxy('http://<fubared host>/'); $xmlS = XMLout ($soap ->(37.5) -> result); print $xmlS; print "\n"; xmlS = XMLout ($soap -> f2c(99.5) -> result); print $xmlS; print "\n"; Then later I can work on the formatting of the xml file.