in reply to xml stream

The way I choose to accomplish this task is I create an HTML form on the server that is to send the XML. This form has a hidden field. This hidden field is a long string of XML.

The sender then posts the form.

I then read the hidden field of XML and pass it to the parser of my choice as a string. XML::DOM and other parsers can read a string of XML instead of a file if you ask it to.

Replies are listed 'Best First'.
($code or die): Re: Re: xml stream
by $code or die (Deacon) on Jan 24, 2001 at 11:43 UTC
    I am not sure if that is the best way of doing it. I don't like hidden form fields except where "necessary", but I think that a long string of XML in a hidden form would be a bit messy and this would require user interaction. Also it would be a pain if you wanted different XML sent at different times.

    My choice would be to do the following:
    1. Think of it as requesting the XML from the "other server" (the other way round is more complex)
    2. Have a script (or static XML file) on the "other server" that simply produces\displays the XML. Secure this with password protection if necessary.
    3. Have the script on "local" server use an LWP module to request the XML from the other server. This will usually take less than 5 lines of coding =)
    4. Parse the XML.

    I think that this is basically what the reader has asked for. If you do it this way, then you can schedule\automate the task of grabbing the XML and parsing it very easily. I do advise to secure the XML output of the "other server" script if it contains sensitive data.

    $code or die
    Using perl at
    The Spiders Web

    Update: Besides standard LWP docs, see use LWP::Protocol::https for some info and sample script, and also look up Net::SSLeay and Crypt::SSLeay on CPAN